Building gcc10 against glibc+sysroot

Oleg Smolsky
Tue Mar 9 16:24:44 GMT 2021

Hello, I've built glibc 2.33 with a stand-alone version of GCC10 this way:

PATH=$gcc/bin:$PATH ../configure \
     --prefix=/usr --libdir=/usr/lib \
     --host=x86_64-unknown-linux --enable-kernel=4.15.1 \

make -k install-headers cross_compiling=yes install_root=$sysroot
make install_root=$sysroot install

Now I'm trying to build GCC10 against that glibc/sysroot:


LDFLAGS="$linker$rpath" ../configure \
     --prefix=$destination \
     --enable-languages=c,c++ \
     --enable-gold=default \
     --disable-multilib \

Things progress for a while... until I hit an issue with 
`build/genmatch`. I see two executables in the tree: the first has the 
right glibc baked in with rpath, and the second does not:

$ ldd ./gcc-build/prev-gcc/build/genmatch =>  (0x00007fffe51d1000) => /opt/sysroot/lib64/ (0x00007f88bfa10000)
         /opt/sysroot/lib64/ => 
/lib64/ (0x00007f88bfdd3000)

$ ldd ./gcc-build/gcc/build/genmatch
./gcc-build/gcc/build/genmatch: /lib/x86_64-linux-gnu/ version 
`GLIBC_2.33' not found (required by ./gcc-build/gcc/build/genmatch) =>  (0x00007ffdc8bf1000) => /lib/x86_64-linux-gnu/ (0x00007f222fa33000) => /lib/x86_64-linux-gnu/ (0x00007f222f669000)
         /lib64/ (0x00007f222fd3c000)

The second one breaks the build. I can only guess that the LDFLAGS value 
I'm trying to squeeze through the entire build process got lost somewhere...

Could someone give me a pointer as to how this kind of sysroot 
arrangement is supposed to function please? This recipe worked with 
older versions of GCC and GLibc... but that does not help much.

Thanks in advance,

More information about the Gcc-help mailing list