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 5E1C63858D20 for ; Thu, 14 Sep 2023 02:30:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 5E1C63858D20 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 38E2UFP6010987 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 13 Sep 2023 22:30:19 -0400 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 38E2UFP6010987 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=polymtl.ca; s=default; t=1694658620; bh=Rw04CeLTUFBIJDUEvw2JGats7ytRt6MeLPUHa/Wona8=; h=Date:Subject:To:References:From:In-Reply-To:From; b=tGq+xxkBCMnH88aVIJaaj9yvuK5hLrbebhBV4pEO3I/EOQvAGYAlzMjAJW6ocyI7r gREbM7umQcYFckvbzoze2jvf8zovNbHLgVfUif5S0lasAw58rRssO2+/rEuZ0X6qhd qYDmfTphPJctyw6g8qVs1h9dbUZ/HMgCuIA7TMJk= 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 1E3D61E092; Wed, 13 Sep 2023 22:30:15 -0400 (EDT) Message-ID: Date: Wed, 13 Sep 2023 22:30:14 -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: <730f5338-f4c4-4697-852c-a8fec42a5744@polymtl.ca> From: Simon Marchi In-Reply-To: <730f5338-f4c4-4697-852c-a8fec42a5744@polymtl.ca> 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:30:15 +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/13/23 22:25, Simon Marchi via Gdb wrote: > 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. Also, what does you full configure line looks like? Simon