From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 1gzaHy9vAmVexhUAWB0awg (envelope-from ) for ; Wed, 13 Sep 2023 22:25:51 -0400 Authentication-Results: simark.ca; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=ubYDeER/; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 745BB1E0C3; Wed, 13 Sep 2023 22:25:51 -0400 (EDT) Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 65ED31E092 for ; Wed, 13 Sep 2023 22:25:49 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D4B9C3858C5F for ; Thu, 14 Sep 2023 02:25:48 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D4B9C3858C5F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1694658348; bh=nshqe8kqVfde3tsT4f4U4pnsE/KTbF5bLC9SdHHeyoQ=; h=Date:Subject:To:References:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=ubYDeER/8j8+uMbVyXREe6TmcpTeWrSPceHdfPXaU2ifjqKQsptQxhkEmrwwidJ70 RsDHnRbLpo2VXljFymdye0GNVI3WPbuCLEBMuahO3k3GjlsFAjbh96ookEURaGuLNp zDuTf+SSgahQ5q0GfcQDsQzrzqdT28twsqlpc0to= Received: from smtp.polymtl.ca (smtp.polymtl.ca [132.207.4.11]) by sourceware.org (Postfix) with ESMTPS id 7A8E83858D20 for ; Thu, 14 Sep 2023 02:25:20 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 7A8E83858D20 Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id 38E2PEf2008844 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 13 Sep 2023 22:25:18 -0400 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 38E2PEf2008844 Received: from [10.0.0.170] (modemcable238.237-201-24.mc.videotron.ca [24.201.237.238]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id 0BE551E092; Wed, 13 Sep 2023 22:25:14 -0400 (EDT) Message-ID: <730f5338-f4c4-4697-852c-a8fec42a5744@polymtl.ca> Date: Wed, 13 Sep 2023 22:25:12 -0400 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Bug when cross-compiling for ppc Content-Language: fr To: Vincent Fortier , gdb@sourceware.org References: In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Thu, 14 Sep 2023 02:25:14 +0000 X-Spam-Status: No, score=-3031.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Simon Marchi via Gdb Reply-To: Simon Marchi Errors-To: gdb-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb" On 9/12/23 12:42, Vincent Fortier via Gdb wrote: > As introduction, I part of SynoCommunity who maintains free software > packages that can be installed on synology NAS. Multiple archs are > supported from armv5, v7, v8, ppc, i686 and x64. I am able to build > gdb for all archs with exception of ppc, more specifically qoriq arch > using gcc-4.9.3 from Synology provided toolchain. > > github PR available here: https://github.com/SynoCommunity/spksrc/pull/5879 > > I was finally able to figure out why (now needs to know how to fix it) > gdb fails to cross-compile for ppc. I am able to reproduce this > problem on both gdb-7.12.1 and latest 13.2. > > Basically, when it goes into the configure script under sim/ppc at a > certain point it tests the "build" c compiler: > > checking for i686-pc-linux-gcc... gcc > checking whether the C compiler works... no > configure: error: in > `/home/spksrc/qoriq-debug/spksrc/cross/gdb-latest/work-qoriq-6.2.4/gdb-13.2/sim/ppc/build.4119280': > configure: error: C compiler cannot create executables > See `config.log' for more details > mv: cannot stat 'config.h': No such file or directory > > The end-result way later on is that build-config.h is then missing: > > fatal error: build-config.h: No such file or directory > 23 | #include "build-config.h" > | ^~~~~~~~~~~~~~~~ > compilation terminated. > > As at the end of sim/ppc/configure it does a mv config.h > ../build-config.h but config.h was not generated in the first place. > > What I ended-up doing is commenting out the tmpdir removal from that > configure script: > > CFLAGS="${saved_CFLAGS}" > mv config.h ../build-config.h > cd .. > ###rm -rf $tempdir > > Which allowed me to keep track of the real error happening in background: > > configure:2482: checking whether the C compiler works > configure:2504: gcc -g -O > -I/home/spksrc/qoriq-debug/spksrc/toolchain/syno-qoriq-6.2.4/work/powerpc-e500v2-linux-gnuspe/powerpc-e500v2-linux-gnuspe/sysroot/usr/include > -mcpu=8548 -mhard-float -mfloat-gprs=double > -I/home/spksrc/qoriq-debug/spksrc/cross/gdb-latest/work-qoriq-6.2.4/install/usr/local/gdb/include > conftest.c >&5 > gcc: warning: '-mcpu=' is deprecated; use '-mtune=' or '-march=' instead > gcc: error: unrecognized command-line option '-mfloat-gprs=double' > configure:2508: $? = 1 > configure:2546: result: no > > When testing the "build" compiler it includes the "target" flags which > includes -mcpu=8548 -mhard-float -mfloat-gprs=double. In turns these > flags should never get used on with "build" compiler making it to > fail. > > Now the question is, how to fix that? Help would be much welcomed :) Not a way to fix it but to circumvent it. Do you need sim support (it's a simulator hosted inside GDB)? If not, you can configure with --disable-sim, it will skip configuring/building the sim directory. Simon