Bug 1789 - binutils fails to build for i386
Summary: binutils fails to build for i386
Status: RESOLVED FIXED
Alias: None
Product: buildroot
Classification: Unclassified
Component: Other (show other bugs)
Version: unspecified
Hardware: PC Linux
: P5 minor
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-19 20:34 UTC by buildroot
Modified: 2010-05-30 08:43 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description buildroot 2010-05-19 20:34:37 UTC
I'm trying to build buildroot for i386 using the default configuration (i.e. make ARCH=i386 defconfig ; make), but it stops when building binutils:

/usr/bin/gcc -Wl,-rpath -Wl,/media/disk/git/test/host/usr/lib -I/media/disk/git/test/host/include -I/media/disk/git/test/host/usr/include -c -DHAVE_CONFIG_H -g -O2  -I. -I/media/disk/git/test/toolchain/binutils-2.20.1/libiberty/../include  -W -Wall -Wwrite-strings -Wc++-compat -Wstrict-prototypes -pedantic  /media/disk/git/test/toolchain/binutils-2.20.1/libiberty/fibheap.c -o fibheap.o
/media/disk/git/test/toolchain/binutils-2.20.1/libiberty/fibheap.c: In function 'fibheap_union':
/media/disk/git/test/toolchain/binutils-2.20.1/libiberty/fibheap.c:151: warning: implicit declaration of function 'free'
/media/disk/git/test/toolchain/binutils-2.20.1/libiberty/fibheap.c: In function 'fibheap_replace_key_data':
/media/disk/git/test/toolchain/binutils-2.20.1/libiberty/fibheap.c:220: error: 'LONG_MIN' undeclared (first use in this function)
/media/disk/git/test/toolchain/binutils-2.20.1/libiberty/fibheap.c:220: error: (Each undeclared identifier is reported only once
/media/disk/git/test/toolchain/binutils-2.20.1/libiberty/fibheap.c:220: error: for each function it appears in.)
/media/disk/git/test/toolchain/binutils-2.20.1/libiberty/fibheap.c: In function 'fibheap_delete_node':
/media/disk/git/test/toolchain/binutils-2.20.1/libiberty/fibheap.c:261: error: 'LONG_MIN' undeclared (first use in this function)
/media/disk/git/test/toolchain/binutils-2.20.1/libiberty/fibheap.c:265: warning: implicit declaration of function 'abort'
/media/disk/git/test/toolchain/binutils-2.20.1/libiberty/fibheap.c:265: warning: incompatible implicit declaration of built-in function 'abort'
/media/disk/git/test/toolchain/binutils-2.20.1/libiberty/fibheap.c: In function 'fibheap_consolidate':
/media/disk/git/test/toolchain/binutils-2.20.1/libiberty/fibheap.c:368: warning: implicit declaration of function 'memset'
/media/disk/git/test/toolchain/binutils-2.20.1/libiberty/fibheap.c:368: warning: incompatible implicit declaration of built-in function 'memset'
make[3]: *** [fibheap.o] Error 1
make[3]: Leaving directory `/media/disk/git/test/toolchain/binutils-2.20.1-build/libiberty'
make[2]: *** [all-libiberty] Error 2
make[2]: *** Waiting for unfinished jobs....
checking if /usr/bin/gcc -Wl,-rpath -Wl,/media/disk/git/test/host/usr/lib -I/media/disk/git/test/host/include -I/media/disk/git/test/host/usr/include supports -fno-rtti -fno-exceptions... no
checking for /usr/bin/gcc -Wl,-rpath -Wl,/media/disk/git/test/host/usr/lib -I/media/disk/git/test/host/include -I/media/disk/git/test/host/usr/include option to produce PIC... -fPIC -DPIC
checking if /usr/bin/gcc -Wl,-rpath -Wl,/media/disk/git/test/host/usr/lib -I/media/disk/git/test/host/include -I/media/disk/git/test/host/usr/include PIC flag -fPIC -DPIC works... yes
checking if /usr/bin/gcc -Wl,-rpath -Wl,/media/disk/git/test/host/usr/lib -I/media/disk/git/test/host/include -I/media/disk/git/test/host/usr/include static flag -static works... yes
checking if /usr/bin/gcc -Wl,-rpath -Wl,/media/disk/git/test/host/usr/lib -I/media/disk/git/test/host/include -I/media/disk/git/test/host/usr/include supports -c -o file.o... yes
checking if /usr/bin/gcc -Wl,-rpath -Wl,/media/disk/git/test/host/usr/lib -I/media/disk/git/test/host/include -I/media/disk/git/test/host/usr/include supports -c -o file.o... (cached) yes
checking whether the /usr/bin/gcc -Wl,-rpath -Wl,/media/disk/git/test/host/usr/lib -I/media/disk/git/test/host/include -I/media/disk/git/test/host/usr/include linker (/usr/bin/ld -L/media/disk/git/test/host/lib -L/media/disk/git/test/host/usr/lib -m elf_x86_64) supports shared libraries... yes
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... no
checking whether to build static libraries... yes
Setting warning flags = -W -Wall -Wstrict-prototypes -Wmissing-prototypes
checking whether to enable maintainer-specific portions of Makefiles... no
checking whether to install libbfd... no
checking whether NLS is requested... no
checking whether NLS is requested... no
checking for msgfmt... /usr/bin/msgfmt
checking for gmsgfmt... /usr/bin/msgfmt
checking for xgettext... /usr/bin/xgettext
checking for msgmerge... /usr/bin/msgmerge
checking for string.h... (cached) yes
checking for strings.h... (cached) yes
checking for stdlib.h... (cached) yes
checking limits.h usability... yes
checking limits.h presence... yes
checking for limits.h... yes
checking whether basename is declared... yes
checking whether stpcpy is declared... yes
checking linker --as-needed support... yes
checking for cos in -lm... yes
configure: updating cache ./config.cache
configure: creating ./config.status
config.status: creating Makefile
config.status: creating po/Makefile.in
config.status: creating config.h
config.status: executing depfiles commands
config.status: executing libtool commands
config.status: executing default-1 commands
config.status: creating po/POTFILES
config.status: creating po/Makefile
make[2]: Leaving directory `/media/disk/git/test/toolchain/binutils-2.20.1-build'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/media/disk/git/test/toolchain/binutils-2.20.1-build'
make: *** [/media/disk/git/test/toolchain/binutils-2.20.1-build/binutils/objdump] Error 2


$  uname -a
Linux terdaan 2.6.24-27-generic #1 SMP Wed Mar 24 11:03:26 UTC 2010 x86_64 GNU/Linux


This bug first appeared after commit 6b939d40f6a29a43277566adc9d4312d49cb3abf; starting from the previous comit d701a82321ad2f3e5bfa16639e93532294cad4ce buildroot compiles without errors.

Bye, Ludger
Comment 1 Thomas Petazzoni 2010-05-21 09:50:42 UTC
I tried exactly the same configuration :
 make ARCH=i386 defconfig
 make

and I cannot reproduce the build failure. fibheap.c just builds fine here:

if [ x"" != x ]; then \
          /usr/bin/gcc -Wl,-rpath -Wl,/home/test/buildroot/output/host/usr/lib -I/home/test/buildroot/output/host/include -I/home/test/buildroot/output/host/usr/include -c -DHAVE_CONFIG_H -g -O2  -I. -I/home/test/buildroot/output/toolchain/binutils-2.20.1/libiberty/../include  -W -Wall -Wwrite-strings -Wc++-compat -Wstrict-prototypes -pedantic   /home/test/buildroot/output/toolchain/binutils-2.20.1/libiberty/fibheap.c -o pic/fibheap.o; \
        else true; fi
/usr/bin/gcc -Wl,-rpath -Wl,/home/test/buildroot/output/host/usr/lib -I/home/test/buildroot/output/host/include -I/home/test/buildroot/output/host/usr/include -c -DHAVE_CONFIG_H -g -O2  -I. -I/home/test/buildroot/output/toolchain/binutils-2.20.1/libiberty/../include  -W -Wall -Wwrite-strings -Wc++-compat -Wstrict-prototypes -pedantic  /home/test/buildroot/output/toolchain/binutils-2.20.1/libiberty/fibheap.c -o fibheap.o
Comment 2 Thomas Petazzoni 2010-05-21 09:56:42 UTC
See my config:
 http://free-electrons.com/~thomas/pub/bug1789/config1

And the full build log:
 http://free-electrons.com/~thomas/pub/bug1789/build1.log
Comment 3 buildroot 2010-05-24 10:55:44 UTC
> See my config:
>  http://free-electrons.com/~thomas/pub/bug1789/config1

Yes, it's the same config as I am using (only with different number of simultaneous jobs). I have uploaded the full log to http://files.invalid-domain.net/buildroot-without-patch.log


I tried the patch you posted to the mailing list (changing   
    HOST_CFLAGS+=-Wl,-rpath -Wl,$(HOST_DIR)/usr/lib 
to
    HOST_LDFLAGS+=-Wl,-rpath -Wl,$(HOST_DIR)/usr/lib

in packages/Makefile.in) and it fixed the compiling problems for binutils for me. Unfortunately, fakeroot reports an error ("fakeroot: preload library not found, aborting.") when creating the ext2 fs. Log can be found at http://files.invalid-domain.net/buildroot-with-proposed-patch.log

Completely removing the line 
    HOST_CFLAGS+=-Wl,-rpath -Wl,$(HOST_DIR)/usr/lib 
from packages/Makefile.in) leads to a successfull build (see log at http://files.invalid-domain.net/buildroot-with-dirty-fix.log).
Comment 4 Thomas 2010-05-29 19:31:37 UTC
for me, removing the line 

   HOST_CFLAGS+=-Wl,-rpath -Wl,$(HOST_DIR)/usr/lib

leads to a successful build too, otherwise I have the same problems as described in this bug report. Tested with buildroot 2010.05rc3.

My host system is Ubuntu 8.04/32-bit. Target AT91RM9200.
Comment 5 Peter Korsgaard 2010-05-30 08:43:04 UTC
I've reverted the commit (6b939d40f6a) for now, thanks.