Bug 1651

Summary: Build fail caused by ccache in module-init-tools
Product: buildroot Reporter: Mitch Davis <mjd+busybox.net>
Component: Outdated packageAssignee: unassigned
Status: RESOLVED FIXED    
Severity: normal CC: buildroot, mjd+busybox.net, paulius.zaleckas
Priority: P4    
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Host: Target:
Build:
Attachments: Listing of build showing breakage.

Description Mitch Davis 2010-04-29 04:28:29 UTC
I am having problems with the latest buildroot.  If I take a stock buildroot checkout from git, run make menuconfig, then save and make, it compiles.  If I then run make menuconfig, choose Kernel -> Kernel type -> linux (same version as Linux headers), then do a make, the build fails.

The build fails when it tries to compile module-init-tools.  The makefiles call /usr/lib/ccache/gcc, which fails saying "/usr/bin/ld: cannot find -lc".  Please see attached build log.
Comment 1 Mitch Davis 2010-04-29 04:29:20 UTC
Created attachment 1591 [details]
Listing of build showing breakage.
Comment 2 Mitch Davis 2010-04-29 06:14:57 UTC
The ccache setting was not changed, so it has the default value of unset.

mjd@milhouse ~/src/buildroot $ grep CCACHE .config
# BR2_CCACHE is not set
# BR2_PACKAGE_CCACHE_TARGET is not set
mjd@milhouse ~/src/buildroot $ 
Comment 3 Paulius Zaleckas 2010-04-30 08:07:32 UTC
This is because glibc static library is missing on the host.
On Fedora "yum install glibc-static" solves this problem.

However I admit that buildroot could check and report that you need to install it.
Comment 4 Mitch Davis 2010-04-30 10:05:11 UTC
Interesting.  Why is the host's static version of libc needed?

(And thanks for the workaround)
Comment 5 Mitch Davis 2010-04-30 10:06:37 UTC
Or looking a little higher up the cause-of-failure tree, why is module-init-tools being compiled with ccache (when it's turned off in the config)?
Comment 6 Mitch Davis 2010-05-12 00:17:03 UTC
Hello buildroot guys, anyone had some time to look at this please?
Comment 7 Thomas Petazzoni 2010-06-24 10:35:59 UTC
Mitch, with the merge of the linux-cleanup work, the module-init-tools package has been upgraded and migrated to the autotools infrastructure. So it is possible that the problem you're seeing has been fixed.

Can you give a try at the latest Buildroot git ?
Comment 8 Sérgio 2010-07-27 02:09:22 UTC
(In reply to comment #7)
> Mitch, with the merge of the linux-cleanup work, the module-init-tools package
> has been upgraded and migrated to the autotools infrastructure. So it is
> possible that the problem you're seeing has been fixed.
> 
> Can you give a try at the latest Buildroot git ?

Hi, I'm getting this error:
make[2]: Entering directory `buildroot/output/build/host-module-init-tools-3.11/build'
/usr/lib64/ccache/gcc  -Ibuildroot/output/host/include -Ibuildroot/output/host/usr/include -Wunused -Wall -static -Lbuildroot/output/host/lib -Lbuildroot/output/host/usr/lib -Wl,-rpath,buildroot/output/host/usr/lib -o insmod.static insmod.o libmodtools.a 
/usr/bin/ld: cannot find -lc
collect2: ld returned 1 exit status

with git and ccache enabled , and  yum install glibc-static , fixes the problem.


but what should I do ? disable CCACHE or use glibc-static  ?
Comment 9 Peter Korsgaard 2010-07-27 05:34:57 UTC
(In reply to comment #8)

> but what should I do ? disable CCACHE or use glibc-static  ?

short of us hacking the module-init-tools makefile, it is building a static version of insmod - So I would say install the glibc package.
Comment 10 Thomas Petazzoni 2010-12-14 11:05:05 UTC
The issue was in fact that glibc-static was missing on the user host system. We have added a FAQ entry in Buildroot documentation to document this. See http://git.buildroot.net/buildroot/commit/?id=706683b8b912aa3304d71652d7a4a74d8b74f58e