From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=polymtl.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=polymtl.ca 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=polymtl.ca; s=default; t=1694658319; bh=nshqe8kqVfde3tsT4f4U4pnsE/KTbF5bLC9SdHHeyoQ=; h=Date:Subject:To:References:From:In-Reply-To:From; b=DpFHI3UUiDBvBU7BgzHuoqMA1q/79/ZyO8kOzUSZB6vMkiq86ky7LZydk9i/74QDJ jdhBq1dJ32m1GpCX4qMMQcTg7EWtnwT2NdzBzbhbgBWEIIxhnr+gy0BkVaOXrJZF32 xeeiTHiC/9IV+Mkb3cPWksDRQpvFida9tAj6p+q0= 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: From: Simon Marchi 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 List-Id: 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