From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-il1-x129.google.com (mail-il1-x129.google.com [IPv6:2607:f8b0:4864:20::129]) by sourceware.org (Postfix) with ESMTPS id D64F6388C020 for ; Tue, 22 Sep 2020 16:07:42 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org D64F6388C020 Received: by mail-il1-x129.google.com with SMTP id x18so15378597ila.7 for ; Tue, 22 Sep 2020 09:07:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=GHqu+WHrPIefuX+kqyUq0rRT0SVqf2s6ffo6ck1iIDc=; b=kYXXbsA2/1JMSA2u8w9ne6Gmh6MFqq+PuwwdBuB1vcQTraladDE4WfA1qomIl/Yo5c MNP/rb93t/p5dRF2SO+NbahJ4vEqBeWWpE9n2owdp1JUM/B3rYdPo1v1MsRkTAptQcHW iOQ52TGkkiso6J3KXHs6uNILT7AADuaOMh7DpI8mBWZUUKwhevzJc6xMlwJVOjs3XOxo 884wLCJFpl/C5W7dul1VDKSB4JLqp/5IshVT5wef1G9/G8imFtAE06R2EW0PMSaMiRC4 LbX0aiMe0SNZWXUdSJtibzgyC/OT0XvTwiJrqgqdGbVTBRBOR4QILuZinvqu+NjHGTcC kcuQ== X-Gm-Message-State: AOAM532NXBBgduMbkjDl45LR/ixHes2HezOc1J/zH2bwHHziKzD/ci9b W4X+Gjl1tnjY3p9FkUWA8dyFmHk5VhWqglUILME= X-Google-Smtp-Source: ABdhPJw5BEA1b3xpefPehIrKmiPDHRFjOhZdmNIrxV9JNskk9qDP8ceDVjgSuOMTX2BkUEvzg3OdGoWWKGwvV5DsMtE= X-Received: by 2002:a92:1b19:: with SMTP id b25mr5031005ilb.290.1600790862309; Tue, 22 Sep 2020 09:07:42 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: papadave Date: Wed, 23 Sep 2020 00:07:40 +0800 Message-ID: Subject: Re: Cross build gcc failed.build=x86_64-freebsd target=x86_64-solaris To: Kai Ruottu , gcc-help@gcc.gnu.org X-Spam-Status: No, score=-1.2 required=5.0 tests=BAYES_00, BODY_8BITS, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, HTML_MESSAGE, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 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, 22 Sep 2020 16:07:45 -0000 Thanks for your reply. But I think it is more like a multilib issue. GCC build system failed to find amd64 objects in 'amd64' subdirectory. Kai Ruottu =E4=BA=8E2020=E5=B9=B49=E6=9C=8822=E6= =97=A5=E5=91=A8=E4=BA=8C =E4=B8=8B=E5=8D=8811:37=E5=86=99=E9=81=93=EF=BC=9A > papadave via Gcc-help kirjoitti 22.9.2020 klo 17.41: > > Hello, > > Recently I was trying to cross build a latest gcc on FreeBSD amd64 ,and > > target is x86_64 Solaris. I built the binutils with following configure= : > > > > ../configure --build=3Dx86_64-unknown-freebsd12 > > --target=3Dx86_64-unknown-solaris2.11 --prefix=3D/opt/toolchains > > --sysconfdir=3D/etc --localstatedir=3D/var --libexecdir=3D'${prefix}/li= b' > > --with-system-zlib --with-gmp=3D/usr/local --with-mpfr=3D/usr/local > > --disable-rpath --enable-deterministic-archives --enable-nls > --enable-gold > > --enable-ld --enable-plugins > > > > Later I configured the gcc in a new subdirectory as follows: > > > > ../gcc-10.2.0/configure --build=3Dx86_64-unknown-freebsd12 > > --target=3Dx86_64-unknown-solaris2.11 --disable-bootstrap > > --enable-gnu-indirect-function --prefix=3D/opt/toolchains --sysconfdir= =3D/etc > > --localstatedir=3D/var --libexecdir=3D'${prefix}/lib/gcc' --disable-rpa= th > > --program-prefix=3Dx86_64-unknown-solaris2.11- --program-suffix=3D-10.2 > > --with-gnu-as --with-gnu-ld --with-gmp=3D/usr/local > --with-pkgversion=3DRivoreo > > --with-system-zlib --enable-languages=3Dc,c++,objc,fortran,obj-c++,go > > --enable-multilib > > > Ok, for a crosscompiler one needs just the same target C library stuff > (here for > x86_64-unknown-solaris2.11) as is needed in a native GCC build for the > target. > Usually it will be copied/unpacked into a chosen $sysroot on the host > machine > (here x86_64-unknown-freebsd12). And a "--with-sysroot=3D$sysroot" optio= n is > given both in binutils and GCC configure commands to tell to "ld" and "gc= c" > where the target libraries and headers are. In your case choosing the > "/opt/toolchains/host-x86_64-unknown-solaris2.11" as the $sysroot could b= e > one choice if your aim is to put more crosstoolchains for all kind of > targets into > the "/opt/toolchains". And use the "/opt/toolchains/host-$target" as the > standard for the install places for their C libraries. > > I remember the "native install" for Solaris2.x C library being quite > complicated so using > the default "$prefix/$target/include" and "$prefix/$target/lib" would > need some > scratching of one's head to get everything in the Solaris2.x C library > being found > there. Much easier is to let it be similar to the native scheme in the > $sysroot > (the cross "/" is the $sysroot on the host system). > > > -B/opt/toolchains/x86_64-unknown-solaris2.11/bin/ > > -B/opt/toolchains/x86_64-unknown-solaris2.11/lib/ > > -isystem /opt/toolchains/x86_64-unknown-solaris2.11/include > > -isystem /opt/toolchains/x86_64-unknown-solaris2.11/sys-include > > These tell where the target C library will be searched now. Please don't > ask for what > purpose the "sys-include" is there. Just take it as a relic from the > ancient time when > someone maybe knew why he/she needed it :) The funny thing is that it > will be searched > before the "include" unless the order is the same as given in the > "-isystem " options > (the old order was changed in the 'gcc/cppdefaults.c' or something). > >