I'm trying to compile binutils-2.19.1 with gcc-4.4.0. It fails with the following error message: checking size of off_t... configure: error: in `/home/booleandomain/tmp/lfs/sources/binutils-build/bfd': configure: error: cannot compute sizeof (off_t), 77 See `config.log' for more details. make[1]: *** [configure-bfd] Error 1 make[1]: Leaving directory `/home/booleandomain/tmp/lfs/sources/binutils-build' make: *** [all] Error 2 I configured binutils as follows: --prefix=/tools --build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu --target=x86_64-pc-linux-gnu Looking at bfd/config.log it seems the problem is due to the fact binutils is looking in /tools for libz.so.1 (it doesn't exist there). If I install zlib in /tools and then try again building binutils, everything works. I think this is a bug because binutils should look at /lib64/libz.so.1 instead.
Created attachment 4043 [details] bfd/config.log
It seems the problem is related to the fact I have in CFLAGS the following option: -Wl,--dynamic-linker,/tools/lib64/ld-linux-x86-64.so.2
I just tried binutils cvs, but the problem persists.
(In reply to comment #2) > It seems the problem is related to the fact I have in CFLAGS the following > option: -Wl,--dynamic-linker,/tools/lib64/ld-linux-x86-64.so.2 If you remove it, will build work?
Yes, but I need that option because I'm building a GNU/Linux toolchain inside of /tools, and packages have to link to the dynamic linker inside of it.
(In reply to comment #5) > Yes, but I need that option because I'm building a GNU/Linux toolchain inside of > /tools, and packages have to link to the dynamic linker inside of it. That is not supported. You may try the sysroot option.
I tried both --with-build-sysroot=/tools and --with-sysroot=/tools (undocumented?) but I get for example: $ ldd binutils/ar linux-vdso.so.1 => (0x00007fff2b5ff000) libz.so.1 => /lib/libz.so.1 (0x00007fc61e1e0000) libc.so.6 => /lib/libc.so.6 (0x00007fc61de85000) /lib64/ld-linux-x86-64.so.2 (0x00007fc61e3f6000) This is not going to work inside a chrooted environment. Perhaps I must build binutils statically...
It seems the problem is not related to CFLAGS containing -Wl,--dynamic-linker,/tools/lib64/ld-linux-x86-64.so.2, but to the fact I probably installed glibc in /tools in the wrong way. In fact, I configured in with --prefix=/tools instead of installing it with install_root=/tools. I can't see why, but it seems there is a difference between the two.
Surely no longer relevant