This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: How to build/test glibc with new gcc
- From: Torvald Riegel <triegel at redhat dot com>
- To: Szabolcs Nagy <szabolcs dot nagy at arm dot com>
- Cc: GNU C Library <libc-alpha at sourceware dot org>
- Date: Mon, 20 Jul 2015 18:41:10 +0200
- Subject: Re: How to build/test glibc with new gcc
- Authentication-results: sourceware.org; auth=none
- References: <55A9324B dot 2090503 at arm dot com>
On Fri, 2015-07-17 at 17:50 +0100, Szabolcs Nagy wrote:
> i'm wondering what's the official way to build glibc with new gcc.
>
> the documentation about building glibc assumes that the host
> compiler is used when doing a native build, but if gcc is installed
> at some prefix path, then the tests don't use the right libraries:
>
> they use libgcc_s.so.1 and libstdc++.so.6 of the host (or fail
> when the host does not have these).
>
> Using LD_LIBRARY_PATH does not work as the tests override the
> library path, but i assume this can be solved by either adding
> -Wl,-rpath=/gcc/prefix/lib to the LDFLAGS of the tests or
> copying the compiler runtime into the build path:
>
> export PATH="/path/to/gcc-prefix/bin:$PATH"
> cp -a /path/to/gcc-prefix/lib*/*.so* .
> /path/to/glibc-src/configure --prefix=/usr
> make -j
> make check
>
> is there a cleaner way to do it?
>
I use the following in a separate build dir, and it seems to work (I
haven't actually checked whether I'm using the host libs as you
mentioned):
../glibc/configure --prefix=/usr CC=/path/to/gcc/bin/gcc
CPP=/path/to/gcc/bin/cpp CXX=/path/to/gcc/bin/g++
The compiler I use is a fairly recent GCC trunk build.