-
-
Notifications
You must be signed in to change notification settings - Fork 206
Description
Hi,
we'd like to package Heads in the GNU Guix distribution.
There is a slight problem we are working around:
Our compilers use the (gcc) environment variables CPATH, C_INCLUDE_PATH, CPLUS_INCLUDE_PATH, LIBRARY_PATH (and OBJC_INCLUDE_PATH and OBJCPLUS_INCLUDE_PATH) in order to specify the location of the system headers, see gcc/incpath.c. Almost all our packages set those environment variables while building.
Heads builds its own cross compiler (via musl-cross) which we have already packaged.
However, when Heads later uses that cross compiler, it doesn't unset the environment variables above (it doesn't set them either--but they have been set by us before) and thus when using musl-cross's compiler we get a mix of cross and non-cross headers, which isn't good.
It would be nice if there was a generic mechanism to pass environment variables to a module. Right now, your CROSS_TOOLS make variable sometimes gets passed on as environment variable and sometimes only as (child) make variable--which isn't good.
Some of Heads' modules use the cross compiler and some use the native compiler, so it cannot be reliably automatically detected whether or not the environment variables are required--that is also why we don't just unset the environment variables before invoking make in Heads (with prebuilt musl-cross). For example the Heads module linux uses elfutils but there's no Heads module elfutils (neither cross-compiled using musl-cross nor otherwise). There are Heads modules that require both a cross and a non-cross (host) compiler.
Similar with slsh (which has a heads package) and termcap (which doesn't have a heads package - ncurses isn't used, right?).
Also, libusb seems to use CXXCPP which your main Makefile doesn't set up for the cross compiler (neither does it set up CPP).