Hi, Bryan. On 2 September 2014 12:04, Bryan Hundven <bryanhundven@xxxxxxxxx> wrote: > Shaun, > >> >> On 28 August 2014 11:30, Shaun Jackman <sjackman@xxxxxxxxx> wrote: >>> I'm attempting to compile a native GCC compiler that uses a newly >>> downloaded set of Linux headers and a newly compiled glibc. These two >>> packages are installed in different directories. I'd like to specify >>> --with-native-system-header-dir twice, once for each set of headers. I >>> didn't in fact try that, but I'm guessing that it's not supported. I >>> tried using --with-headers, but it's supported only for cross >>> compiles. Is there a set of configuration parameters that I can use to >>> accomplish this? My configure line is: >>> >>> ../configure --with-sysroot=/home/sjackman/.linuxbrew >>> --prefix=/Cellar/xgcc/4.9.1 >>> --with-native-system-header-dir=/opt/glibc/include >>> >>> The glibc headers are installed in $sysroot/opt/glibc/include. >>> The linux headers are installed in $sysroot/opt/linux-headers/include >>> and also symlinked into $sysroot/include. >>> >>> Thanks, >>> Shaun >>> >>> http://sjackman.ca > On Tue, Sep 2, 2014 at 10:25 AM, Shaun Jackman <sjackman@xxxxxxxxx> wrote: >> The simple work around to this problem is to symlink both the glibc >> and Linux headers into the single directory specified with >> --with-native-system-header-dir. It would still be nice to be able to >> specify multiple header directories. gettext (libintl.h) seems to be a >> third dependency of building GCC --with-sysroot. > > I understand what you are trying to do. My question is to find out > your intentions; Why do you feel it is necessary to separate headers > that belong in one $sysroot/$prefix/include directory? > > -Bryan Homebrew is a package manager for Mac OS. I maintain the port of Homebrew for Linux, named Linuxbrew. The file arrangement in Homebrew is that each package is installed in $prefix/Cellar/$package/$version and then {bin,include,lib} of that package are optionally symlinked into $prefix/{bin,include,lib}. The most recent version of each package is also symlinked into $prefix/opt/$package. $prefix is the installation directory of Homebrew, typically ~/.linuxbrew I'd like to be able to compile GCC --with-sysroot without requiring that glibc be symlinked into $prefix. Within Linuxbrew, executables are compiled with their rpath set to $prefix/lib so that they can find libraries installed by Linuxbrew. Additionally executables compiled against a Homebrew-compiled-and-installed glibc have the dynamic-linker set to that of the new GLIBC using -Wl,--dynamic-linker. If a particular executable is compiled against the system glibc, and the new glibc is symlinked into $prefix/lib, it can cause the error "ELF file OS ABI invalid". I'd like to support compiling executables either with the system GCC and glibc or the Homebrew-managed GCC and glibc, which precludes linking libc.so.6 into $prefix/lib due to setting rpath to $prefix/lib. For now I'm making progress by symlinking Linux headers, glibc and libintl.h into $sysroot. Cheers, Shaun