From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Nieuwenhuizen Subject: Re: [PATCH 01/10] gnu: cross: Use CROSS_*_INCLUDE_PATH for system headers. Date: Mon, 02 May 2016 19:59:54 +0200 Message-ID: <871t5kxrvp.fsf@drakenvlieg.flower> References: <1461942751-23883-1-git-send-email-janneke@gnu.org> <87zis8naw1.fsf@igalia.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:38273) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1axI9Q-0005iw-B9 for guix-devel@gnu.org; Mon, 02 May 2016 14:01:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1axI9E-0005s2-8d for guix-devel@gnu.org; Mon, 02 May 2016 14:00:50 -0400 In-Reply-To: <87zis8naw1.fsf@igalia.com> (Andy Wingo's message of "Mon, 02 May 2016 10:04:46 +0200") 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: Andy Wingo Cc: guix-devel@gnu.org Andy Wingo writes: [cc: Ludovic] > On Fri 29 Apr 2016 17:12, Jan Nieuwenhuizen writes: > >> * gnu/packages/patches/gcc-cross-environment-variables.patch: Also use C= ROSS_ >> variants: CROSS_C_INCLUDE_PATH, CROSS_CPLUS_INCLUDE_PATH, >> CROSS_OBJC_INCLUDE_PATH, CROSS_OBJCPLUS_INCLUDE_PATH to be used for syst= em >> libraries, see >> https://lists.gnu.org/archive/html/guix-devel/2016-04/msg00620.html. >> * gnu/packages/cross-base.scm (cross-gcc, cross-gcc-arguments, cross-lib= c): >> Use CROSS_*_INCLUDE_PATH (WAS: CPATH). >> --- > > LGTM, for what it's worth. I get lost in the patches-to-patches part of > the mail but it does not seem to be incorrect. Ok, thanks! > One final ignorant question: there really is no way to do this without > patching GCC? And why just one CROSS_C_INCLUDE_PATH -- would it not be > necessary in theory to have such a CROSS_ARCH_... for each ARCH that we > might be interested in? I am not suggesting that you make the change > now but I want to know what the right thing is :) I really like your questions! (again :-) The traditional way of supporting multiple (cross) compilers is to configure gcc using --with-sysroot and possibly --with-build-sysroot. Extra libraries with their headers are installed there and you never specify any environment include paths. Happy as I am that the MinGW cross build starts to look real nice, I'm not to happy with the environment vars and patching gcc. A sysroot approach could be nicer, but I'm not sure how to do that in Guix. Would it be possible to create sysroot profiles, similar to user profiles that are linked from ~/.guix-profile, where each gcc/target has a named, versioned profile that is used as sysroot, eg /var/guix/profiles/per-arch/mingw-32/guix-profile-0-link -> /gnu/store/.. and version that something like 0: binutils 1: binutils + gcc-sans-libc 2: binutils + gcc-sans-libc + libc 3: binutils + libc + gcc or maybe cross packages could use a sysroot off profile like ~/.guix-profile/bin/gcc ~/.guix-profile/bin/i686-w64-mingw32-gcc ~/.guix-profile/sysroot/i686-mingw-w32/include ~/.guix-profile/sysroot/i686-mingw-w32/lib ~/.guix-profile/sysroot/i686-mingw-w32/bin/gcc Then, invoke gcc using i686-w64-mingw32-gcc --sysroot =3D ~/.guix-profile/sysroot/i686-mingw-w3= 2/ =20=20=20 or create a wrapper adding this... Sadly this is just dreaming way beyond my Guix/nix knowledge. For example, why aren't we using/creating profile in our build root and set just one directory like PATH=3D/gnu/store/...-profile/bin FOO=3D/gnu/store/...-profile/foo =20=20=20=20 etc, populated with symlinks, but use environment-variables and long PATHs... Greetings, Jan --=20 jan Nieuwenhuizen | GNU LilyPond http://lilypond.org Freelance IT http://JoyofSource.com | Avatar=C2=AE http://AvatarAcademy.nl= =20=20