[Nix-dev] Re: [Nix-commits] SVN commit: nix - 18833 - viric - in nixpkgs/branches/stdenv-updates/pkgs: development/compilers/gcc-4.3 development/compilers/gcc-4.4 top-level

Ludovic Courtès ludo at gnu.org
Tue Dec 8 20:02:12 CET 2009


Hi Lluís,

Lluís Batlle <viriketo at gmail.com> writes:

> 2009/12/8 Ludovic Courtès <ludo at gnu.org>:

[...]

>> The patches you committed are against ‘configure’ and ‘Makefile.in’
>> files; the former are large automatically generated scripts and the
>> latter are large automatically generated makefile templates.  I think
>> maintaining patches against such beasts is going to be a lot of work.
> I agree. We should push for proper patches to get upstream.

Sure, but before a “fix” would be considered upstream, it should be
clear that the build system doesn’t conform to its documentation, and
that we didn’t miss any option to do what we want to achieve.

[...]

> It may very well work - while I use --with-headers, I did not try
> --with-libs. I will try. I hope we can avoid then the libtool patches
> for -B.

Yes, that’d be great.

>> It seems similar to what I described in
>> http://gcc.gnu.org/ml/gcc-help/2008-04/msg00185.html .  My understanding
>> was that $LDFLAGS_FOR_TARGET alone is not enough; ‘-B’ also needs to be
>> passed in $BOOT_LDFLAGS at ‘make’ time (not at ‘configure’ time).
> The BOOT_LDFLAGS are used only in building a native compiler, for the
> internal bootstrap, afaik.

According to http://gcc.gnu.org/install/build.html $BOOT_CFLAGS (and I
assume $BOOT_LDFLAGS) is only used by the stage2 and stage3 compilers,
regardless of whether we’re building a cross-compiler.

> And even using them, -B will not pass to the libmudflap shared library
> I think. Have you checked that?

No.  This document also reads:

  BOOT_CFLAGS does not apply to bootstrapped target libraries.  Since
  these are always compiled with the compiler currently being
  bootstrapped, you can use CFLAGS_FOR_TARGET to modify their
  compilation flags, as for non-bootstrapped target libraries.

IIUC, this would mean that ‘CFLAGS_FOR_TARGET=-B/path/to/target/libc’
would do the right thing.

[...]

>> As was said ‘--without-headers’ probably isn’t the right option (what
>> would it mean to build without C library headers?).  AIUI, it should be
>> ‘--with-headers=/path/to/cross/glibc/include’.
> In order to bootstrap a cross-compiler, the usual build steps I've
> seen around are:
> 1. Build a gcc without libc, capable of compiling C into object files,
> not capable of creating ELFs or any shared object.
> 2. With the gcc in 1., build a libc. After that, we will have
> startfiles, headers and libs installed.
> 3. With the gcc in 1. and the libc of 2., build the final gcc
> involving the libc headers, libc libraries, startfiles and whatever
> libc parts.

My understanding of build.html is that there are shortcuts:

  If you are not building a C library in the same source tree as GCC,
  you should also provide the target libraries and headers before
  configuring GCC, specifying the directories with --with-sysroot or
  --with-headers and --with-libs.

Thanks,
Ludo’.



More information about the nix-dev mailing list