From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ciao.gmane.io (ciao.gmane.io [116.202.254.214]) by sourceware.org (Postfix) with ESMTPS id CE46F3858D33 for ; Mon, 13 Feb 2023 07:25:03 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org CE46F3858D33 Authentication-Results: sourceware.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=m.gmane-mx.org Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1pRTCw-0006gp-IV for gcc-help@gcc.gnu.org; Mon, 13 Feb 2023 08:25:02 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: gcc-help@gcc.gnu.org From: Christer Solskogen Subject: Re: Problem cross-compiling gcc Date: Mon, 13 Feb 2023 08:23:38 +0100 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.7.2 Content-Language: en-US In-Reply-To: X-Spam-Status: No, score=1.4 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FORGED_MUA_MOZILLA,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,KAM_DMARC_STATUS,NICE_REPLY_A,NML_ADSP_CUSTOM_MED,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=no autolearn_force=no version=3.4.6 X-Spam-Level: * X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 12.02.2023 21:01, Kai Ruottu wrote: > Christer Solskogen via Gcc-help kirjoitti 12.2.2023 klo 19.51: >> While cross compiling gcc with musl I see this: >> >> checking for exported symbols... /home/solskogen/gcc/libcc1/configure: >> line 15053: -T: command not found >> yes >> checking for -rdynamic... /home/solskogen/gcc/libcc1/configure: line >> 15063: -T: command not found >> no >> checking for library containing dlopen... none required >> checking for -fPIC -shared... yes >> configure: error: >>    Building GCC with plugin support requires a host that supports >>    -fPIC, -shared, -ldl and -rdynamic. >> make[1]: *** [Makefile:11890: configure-libcc1] Error 1 >> >> This is the configure line: /home/solskogen/gcc/configure >> --prefix=/usr --libexecdir=/lib --host=aarch64-centrix-linux-musl >> --target=aarch64-centrix-linux-musl --build=x86_64-pc-linux-gnu > > What is intersting in this case is WHICH GCC the build tries to use when > compiling libgcc. It should be the 'aarch64-centrix-linux-musl' targeted > cross-GCC, used for the becoming $host > system to create the executables and libraries for it. So what are the > CC_FOR_TARGET, GCC_FOR_TARGET, CXX_FOR_TARGET and GXX_FOR_TARGET in the > main Makefile and in the one > used for libgcc?  My habit has been years to define these in environment > before running configure. Maybe these simply don't work in the "native > Canadian Cross" case. (To create a native > GCC with a cross-GCC). > > I see this in configure: Configuring in ./libcc1 configure: loading cache ./config.cache checking build system type... x86_64-pc-linux-gnu checking host system type... aarch64-centrix-linux-musl checking target system type... aarch64-centrix-linux-musl checking for aarch64-centrix-linux-musl-gcc... aarch64-centrix-linux-musl-gcc checking whether the C compiler works... yes Which *should* mean that it finds the correct compiler. In the Makefile I see this: CC = aarch64-centrix-linux-musl-gcc CXX = aarch64-centrix-linux-musl-g++ GCC_FOR_TARGET=$(STAGE_CC_WRAPPER) aarch64-centrix-linux-musl-gcc CXX_FOR_TARGET=$(STAGE_CC_WRAPPER) aarch64-centrix-linux-musl-c++ CC_FOR_TARGET=$(STAGE_CC_WRAPPER) aarch64-centrix-linux-musl-gcc All of the other tools also have the aarch64-centrix-linux-musl- prefix as well, so as far as I understand this *should* work.