Bug 10376 - configure: error: cannot compute sizeof (off_t), 77
Summary: configure: error: cannot compute sizeof (off_t), 77
Status: RESOLVED OBSOLETE
Alias: None
Product: binutils
Classification: Unclassified
Component: binutils (show other bugs)
Version: 2.19
: P2 normal
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-07-07 20:50 UTC by booleandomain
Modified: 2022-11-25 03:29 UTC (History)
2 users (show)

See Also:
Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu
Build: x86_64-pc-linux-gnu
Last reconfirmed:


Attachments
bfd/config.log (11.75 KB, text/plain)
2009-07-07 20:51 UTC, booleandomain
Details

Note You need to log in before you can comment on or make changes to this bug.
Description booleandomain 2009-07-07 20:50:15 UTC
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.
Comment 1 booleandomain 2009-07-07 20:51:54 UTC
Created attachment 4043 [details]
bfd/config.log
Comment 2 booleandomain 2009-07-08 15:19:22 UTC
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
Comment 3 booleandomain 2009-07-08 17:22:50 UTC
I just tried binutils cvs, but the problem persists.
Comment 4 H.J. Lu 2009-07-08 17:52:15 UTC
(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?
Comment 5 booleandomain 2009-07-08 19:32:54 UTC
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.
Comment 6 H.J. Lu 2009-07-08 19:46:09 UTC
(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.
Comment 7 booleandomain 2009-07-08 20:46:15 UTC
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...
Comment 8 booleandomain 2009-07-09 19:55:41 UTC
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.
Comment 9 Alan Modra 2022-11-25 03:29:15 UTC
Surely no longer relevant