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 C86703858C56 for ; Mon, 28 Mar 2022 10:29:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org C86703858C56 Received: from [IPv6:240e:358:1129:8400:dc73:854d:832e:3] (unknown [IPv6:240e:358:1129:8400: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)) (Client did not present a certificate) (Authenticated sender: xry111@mengyan1223.wang) by mengyan1223.wang (Postfix) with ESMTPSA id 1B63366297; Mon, 28 Mar 2022 06:29:11 -0400 (EDT) Message-ID: Subject: Re: architecture dependent directory of C header From: Xi Ruoyao To: Da Shi Cao , "gcc-help@gcc.gnu.org" Date: Mon, 28 Mar 2022 18:29:06 +0800 In-Reply-To: References: <186f56a70b2179d945d7bb61ad2e3e6c37e7e3be.camel@mengyan1223.wang> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.44.0 MIME-Version: 1.0 X-Spam-Status: No, score=-3031.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, JMQ_SPF_NEUTRAL, SPF_HELO_PASS, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE 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: Mon, 28 Mar 2022 10:29:17 -0000 On Sun, 2022-03-27 at 15:14 +0000, Da Shi Cao wrote: > Hi Ruoyao, >=20 > I'm trying to build a cross gcc on X86_64, with target armhf. The > cross gcc will have /usr/include/arm-linux-gnueabihf, which is already > populated, as its header search directory if the gcc is configured > with: > --enable-multiarch --with-arch=3Darmv7-a --with-fpu=3Dneon-vfpv4 --with- > float=3Dhard >=20 > But to build a gcc with target aarch64, only --with-arch=3Darmv8-a is > used in the configuration and /usr/include/aarch64-linux-gnueabi will > be among the header search directories of the resulting gcc. I'll do > this build again to confirm it. >=20 Yes this is the expected behavior. Note that the "multiarch" directory is normally not used for a cross compiler. If your cross compiler relies on something in /usr/include, it looks like you are doing something wrong. Generally a sysroot is used by a cross compiler to find target headers and libraries. --=20 Xi Ruoyao School of Aerospace Science and Technology, Xidian University