From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 1EtmCl5wAmXYxhUAWB0awg (envelope-from ) for ; Wed, 13 Sep 2023 22:30:54 -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=x5h0i7po; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 216D21E0C3; Wed, 13 Sep 2023 22:30:54 -0400 (EDT) Received: from server2.sourceware.org (ip-8-43-85-97.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 10ED41E092 for ; Wed, 13 Sep 2023 22:30:52 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 8AABC385842A for ; Thu, 14 Sep 2023 02:30:51 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8AABC385842A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1694658651; bh=Rw04CeLTUFBIJDUEvw2JGats7ytRt6MeLPUHa/Wona8=; 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=x5h0i7po7AesBDuEFpwzjLxeImnSU6MXbVCcVmaxPj9Z9jIGSeuCe2lHko9m6R56w 6nUH22TEuOIuaSDlrO4x58TK1ttJeeqkl/aANY12UHE9CHScTVG8rd1TWSrvqQYH2L ErrWc6vdpido22fnigg0opuZXqSpZqdfIHVwIO/U= 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 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 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> 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 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/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