From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marius Bakke Subject: Re: Crosscompiling C++ for powerpc64le fails Date: Mon, 03 Jun 2019 20:30:59 +0200 Message-ID: <8736kq8qsc.fsf@devup.no> References: <20190528203151.5b87be76@scratchpost.org> <20190529121016.1c593a7c@scratchpost.org> <87tvdal27b.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" Return-path: Received: from eggs.gnu.org ([209.51.188.92]:35267) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hXrr3-0002iJ-3H for guix-devel@gnu.org; Mon, 03 Jun 2019 14:38:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hXrjf-0004om-Bs for guix-devel@gnu.org; Mon, 03 Jun 2019 14:31:08 -0400 In-Reply-To: <87tvdal27b.fsf@gnu.org> List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: Ludovic =?utf-8?Q?Court=C3=A8s?= , Danny Milosavljevic Cc: guix-devel@gnu.org --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Ludovic Court=C3=A8s writes: > Hi Danny, > > Danny Milosavljevic skribis: > >> I've investigated a bit more: >> >> Guix's gcc-4.7 passes >> >> (string-append "--with-native-system-header-dir=3D" libc "/include") >> where libc is (assoc-ref %build-inputs "libc") >> >> . >> >> However, further down, there is >> >> `(let* ((libc (assoc-ref %build-inputs "libc")) >> (libc-native (or (assoc-ref %build-inputs "libc-n= ative") >> libc))) >> >> >> which makes me think that "--with-native-system-header-dir=3D" should use >> libc-native if the latter is present. >> >> It would be possible to pass "--with-headers=3D" to gcc which would make= it copy >> the specified directory into the gcc installation directory and everythi= ng >> would work without weird workarounds. > > You=E2=80=99re probably right, it would be worth giving it a try. > > The weird thing is that: > > guix build mpfr --target=3Darm-linux-gnueabihf > > works fine on current master, which uses GCC 5.5 for cross-compilation. > > The issue that Tobias reports reminds me of the CPATH vs. C_INCLUDE_PATH > issue that was causing troubles with newer GCCs, and that I think Marius > addressed in =E2=80=98core-updates=E2=80=99 (?). Marius, does that ring = a bell? Unfortunately there are still issues with cross-compiling C++ on 'core-updates'. For 'C', the workaround was to go back to "CROSS_CPATH" instead of "CROSS_C_INCLUDE_PATH", like with native builds. For native builds on core-updates, GCC7 occasionally fails if the libc or kernel headers are not on C_INCUDE_PATH (see e.g. f90d6c3). It could be that cross builds need a similar workaround, but I have not found the magic incantation yet. --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCgAdFiEEu7At3yzq9qgNHeZDoqBt8qM6VPoFAlz1Z2MACgkQoqBt8qM6 VPqHEQf+K4zNU0fUloJcHhO8RhAxk/L04KLDhkGMv5YF0tiJzRv4jLhxQOM9pnqw f+ElrgQospg9a2C/IjfJ51G0Q4vEC06+WeK9H/UEPNIRys31/ukNSszoqSlEFos4 6aO2qO5RScgmJ1vl4Uri3lNFN5tFNsGHxRsC4M5Z98xfbWKD7vNMnoGHbZXe2eMR G0L9P+grA9Y5p2MoF3mmnjr26w87iLCRyU8nd1E8uh/fNf7y64ATBgjPWQKstFsA RZDnu9HIA2y1iYfVAMG9myJm00LrXkP1IYQ8t0Ynt/IW20LgtRotv9S2g4Yq8a42 KZ72mn5TSDhuI76VGLcULqfKaQWgOQ== =C33H -----END PGP SIGNATURE----- --=-=-=--