Building gcc11 with sysroot

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello there! I'm trying to setup a GCC 11.2 using --with-sysroot=$sysroot
(into which glibc is already installed). I get far enough to have `xgcc`
executable (which works). The executable itself is configured to get glibc
from sysroot (I did that via LDFLAGS):

```
$ ldd ./gcc/xgcc
        linux-vdso.so.1 (0x00007ffec27d7000)
        libm.so.6 => /opt/sysroot/usr/lib/libm.so.6 (0x00007fc12463c000)
        libc.so.6 => /opt/sysroot/usr/lib/libc.so.6 (0x00007fc124440000)
        /opt/sysroot/usr/lib/ld-linux-x86-64.so.2 =>
/lib64/ld-linux-x86-64.so.2 (0x00007fc124718000)
```

where
LDFLAGS="-Wl,--dynamic-linker,$sysroot/usr/lib/ld-linux-x86-64.so.2,--rpath,$sysroot/usr/lib"

Things break a little further down the road when building libgomp:

checking whether we are cross compiling... configure: error: in
`.../gcc11sr/_obj/x86_64-pc-linux-gnu/libgomp':
configure: error: cannot run C compiled programs.

The issue here, it seems, is the absence of LDFLAGS that I had passed to
the top-level `configure` script. We can see the compiler invocation in the
log:

configure:3996: .../gcc11sr/_obj/./gcc/xgcc -B.../gcc11sr/_obj/./gcc/
-B/opt/gcc-11sr/x86_64-pc-linux-gnu/bin/
-B/opt/gcc-11sr/x86_64-pc-linux-gnu/lib/ -isystem
/opt/gcc-11sr/x86_64-pc-linux-gnu/include -isystem
/opt/gcc-11sr/x86_64-pc-linux-gnu/sys-include    -o conftest -g -O2
conftest.c  >&5

The compiler yields a correctly-formed executable when I take that very
command line and add LDFLAGS.

So, finally my question: is this the right way to build a "sysrooted" GCC?
IIRC this recipe worked in the GCC7 days...

Thanks in advance,
Oleg.




[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux