public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Building gcc for C and C++ with a custom glibc
@ 2021-01-17 21:04 Tom Honermann
  2021-01-17 21:08 ` H.J. Lu
  0 siblings, 1 reply; 3+ messages in thread
From: Tom Honermann @ 2021-01-17 21:04 UTC (permalink / raw)
  To: gcc

Hi all.  I've been trying to build a custom gcc (trunk) with a custom 
glibc (trunk) with support for C and C++ on x86_64 Linux and have so far 
been unsuccessful at identifying a sequence of configure/make 
invocations that completes successfully.  I'm not trying to build a 
cross compiler.

The scenario I'm trying to satisfy is testing some changes to gcc, and 
additional changes to libstdc++ that have new autoconf and header 
dependencies on the presence of new functions in existing glibc headers.

The glibc installation I'm trying to use was built with:

    mkdir glibc-build
    cd glibc-build
    ../glibc/configure \
         CC=gcc \
         CXX=g++ \
         --prefix /.../glibc
    make && make install

For gcc, I've tried numerous variants of the following:

    mkdir gcc-build
    cd gcc-build
    ../gcc/configure \
         CC=gcc \
         CXX=g++ \
         --prefix /.../gcc \
         --disable-multilib \
         --enable-languages=c,c++ \
         --enable-checking=release \
         --disable-bootstrap \
         --disable-lto

Things I've tried include setting CFLAGS, CXXFLAGS, and LDFLAGS to 
specify additional glibc paths, to specify alternate paths (via 
-nostdinc/-nostdinc++), setting LIBRARY_PATH and CPATH, passing 
--with-sysroot, passing --with-headers and --with-libs, passing 
--with-native-system-header-dir, some of those in conjunction with 
removing --disable-bootstrap, and wrapping gcc in a script that attempts 
to substitute certain include paths.

The problem I'm having is that, in every attempt, the glibc headers and 
libraries from under /usr end up getting used instead of the custom 
glibc ones at some point leading to build failures.

Does anyone have a recipe available for doing this?

Tom.


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-01-23 17:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-17 21:04 Building gcc for C and C++ with a custom glibc Tom Honermann
2021-01-17 21:08 ` H.J. Lu
2021-01-23 17:49   ` Tom Honermann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).