From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mengyan1223.wang (mengyan1223.wang [89.208.246.23]) by sourceware.org (Postfix) with ESMTPS id 584A23858C3A for ; Tue, 11 Jan 2022 06:54:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 584A23858C3A Received: from [IPv6:240e:358:119b:ea00:dc73:854d:832e:3] (unknown [IPv6:240e:358:119b:ea00:dc73:854d:832e:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature ECDSA (P-384) server-digest SHA384) (Client did not present a certificate) (Authenticated sender: xry111@mengyan1223.wang) by mengyan1223.wang (Postfix) with ESMTPSA id EDDDA65A6A; Tue, 11 Jan 2022 01:54:02 -0500 (EST) Message-ID: Subject: Re: [EXTERNAL] Re: Compiling GCC 11 for Windows targeting ARM on Linux From: Xi Ruoyao To: Thomas Sobczynski , "gcc-help@gcc.gnu.org" Date: Tue, 11 Jan 2022 14:53:55 +0800 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.42.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3031.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, JMQ_SPF_NEUTRAL, KAM_SHORT, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-help@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-help mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Jan 2022 06:54:07 -0000 On Tue, 2022-01-11 at 03:44 +0000, Thomas Sobczynski wrote: > Update: I kept peering at the configure scripts and their embedded > comments, and concluded that it's at least worth trying to add "-- > with-newlib" to the configure script parameters. That may not be the > right move, but it did get me further into the build process. However, > although its configure script finished, the GCC build seems unable to > compile libstdc++ (tail end of output below).  > > Am I barking up the wrong tree with "--with-newlib"?  I think --with-newlib is needed, as it's the de-facto C library on bare metal ARM. But you need to install newlib for the target before building libstdc++, because libstdc++ needs a C library. And your configuration may trigger https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100017, which is fixed in GCC 11 branch recently. You may need to "git pull" your GCC 11 branch to overcome it. Maybe you can add --disable-libstdcxx and build a GCC without libstdc++, reboot into Windows, and then compile newlib & libstdc++ for target with the toolchain just built. However, honestly I don't do any serious development on Windows... > Does it make sense that the build is supplying include search > directories from the GCC v11 build tree (compiler being compiled) to > the native cross compiler which is GCC v9.x? I already misunderstood > the build/host/target config earlier. Is it perhaps not_a_ GCC cross > toolchain that I need, but perhaps I need to build _the_ compiler > (v11) and then turn around and use it to build for the non-native > Host? "__has_builtin" is introduced in GCC 10, so GCC 9 can't recognize it. IIRC libstdc++ from a specific GCC version is only expected to be built with GCC with the same version. Jonathan? -- Xi Ruoyao School of Aerospace Science and Technology, Xidian University