guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 01/10] gnu: cross: Use CROSS_*_INCLUDE_PATH for system header


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
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)

Andy Wingo writes:

[cc: Ludovic]

> On Fri 29 Apr 2016 17:12, Jan Nieuwenhuizen <address@hidden> writes:
>
>> * gnu/packages/patches/gcc-cross-environment-variables.patch: Also use CROSS_
>> variants: CROSS_C_INCLUDE_PATH, CROSS_CPLUS_INCLUDE_PATH,
>> CROSS_OBJC_INCLUDE_PATH, CROSS_OBJCPLUS_INCLUDE_PATH to be used for system
>> 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-libc):
>> 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 = ~/.guix-profile/sysroot/i686-mingw-w32/
   
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=/gnu/store/...-profile/bin
    FOO=/gnu/store/...-profile/foo
    
etc, populated with symlinks, but use environment-variables and long
PATHs...

Greetings, Jan

-- 
jan Nieuwenhuizen <address@hidden> | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar®  http://AvatarAcademy.nl  



reply via email to

[Prev in Thread] Current Thread [Next in Thread]