Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 79519 - When using ccache: ld: file format not recognized; treating as linker script
Summary: When using ccache: ld: file format not recognized; treating as linker script
Status: RESOLVED WORKSFORME
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All All
: High major
Assignee: Robin Johnson
URL:
Whiteboard:
Keywords:
: 317533 327871 328293 337573 345875 402123 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-01-25 14:49 UTC by Ajay Sharma
Modified: 2012-02-05 14:52 UTC (History)
12 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
ccache log, as requested by Brian (ccache.log,17.43 KB, text/plain)
2005-03-19 07:16 UTC, Andrej Kacian (RETIRED)
Details
ASCII .o files (files.tgz,14.39 KB, application/octet-stream)
2010-04-06 08:18 UTC, Benny Lønstrup Ammitzbøll
Details
Suspect files from ccache cache directory. (suspect-ccache-files.tar,100.00 KB, application/octet-stream)
2010-04-19 12:58 UTC, Tim
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ajay Sharma 2005-01-25 14:50:00 UTC
This is when I try to emerge in the new stable xorg-x11-6.8.0-r4.  Hopefully, I've included enough info:

i686-pc-linux-gnu-gcc -O2 -march=athlon-mp -pipe -fno-strict-aliasing -ansi -pedantic -Wno-return-type -w    -fno-
merge-constants -I.. -I../../../../../../programs/Xserver/hw/xfree86/common -I../../../../../../programs/Xserver/h
w/xfree86/os-support            -I../../../../../../programs/Xserver/cfb -I../../../../../../programs/Xserver/mfb 
-I../../../../../../programs/Xserver/mi            -I../../../../../../programs/Xserver/include -I../../../../../.
./exports/include/X11 -I../../../../../../include/fonts            -I../../../../../../programs/Xserver/render -I.
./../../../../../include/extensions  -I../../../../../.. -I../../../../../../exports/include   -Dlinux -D__i386__ 
-D_POSIX_C_SOURCE=199309L                               -D_POSIX_SOURCE -D_XOPEN_SOURCE                          -
D_BSD_SOURCE -D_SVID_SOURCE                              -D_GNU_SOURCE                           -DSHAPE -DXINPUT 
-DXKB -DLBX -DXAPPGROUP         -DXCSECURITY -DTOGCUP   -DXF86BIGFONT -DDPMSExtension     -DPANORAMIX    -DRENDER 
-DRANDR         -DXFIXES -DDAMAGE -DCOMPOSITE -DXEVIE -DGCCUSESGAS -DAVOID_GLYPHBLT -DPIXPRIV -DSINGLEDEPTH      -
DXFreeXDGA -DXvExtension                                -DXFree86LOADER  -DXFree86Server                         -
DXF86VIDMODE                            -DXvMCExtension                                 -DSMART_SCHEDULE          
-DXResExtension                                 -DX_BYTE_ORDER=X_LITTLE_ENDIAN                          -DXORG_VER
SION_CURRENT="(((6) * 10000000) + ((8) * 100000) + ((0) * 1000) + 0)" -DNDEBUG   -DFUNCPROTO=15 -DNARROWPROTO  -DI
N_MODULE -DXFree86Module -DLSBFIRST   -c xaaTEGlyph.c
rm -f DONE
touch DONE
rm -f lsb_first.o
i686-pc-linux-gnu-gcc -nostdlib -r  xaaBitmap.o xaaBitmap3.o xaaStipple.o xaaStipple3.o xaaTEGlyph.o -o lsb_first.
o
/usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.5/../../../../i686-pc-linux-gnu/bin/ld:xaaStipple.o: file format not recogn
ized; treating as linker script
/usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.5/../../../../i686-pc-linux-gnu/bin/ld:xaaStipple.o:1: syntax error
collect2: ld returned 1 exit status
make[7]: *** [lsb_first.o] Error 1
make[7]: Leaving directory `/var/tmp/portage/xorg-x11-6.8.0-r4/work/xc/programs/Xserver/hw/xfree86/xaa/lsb_first'
make[6]: *** [lsb_first] Error 2
make[6]: Leaving directory `/var/tmp/portage/xorg-x11-6.8.0-r4/work/xc/programs/Xserver/hw/xfree86/xaa'
make[5]: *** [all] Error 2
make[5]: Leaving directory `/var/tmp/portage/xorg-x11-6.8.0-r4/work/xc/programs/Xserver/hw/xfree86'
make[4]: *** [hw/xfree86] Error 2
make[4]: Leaving directory `/var/tmp/portage/xorg-x11-6.8.0-r4/work/xc/programs/Xserver'
make[3]: *** [all] Error 2
make[3]: Leaving directory `/var/tmp/portage/xorg-x11-6.8.0-r4/work/xc/programs'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/var/tmp/portage/xorg-x11-6.8.0-r4/work/xc'
make[1]: *** [World] Error 2
make[1]: Leaving directory `/var/tmp/portage/xorg-x11-6.8.0-r4/work/xc'
make: *** [World] Error 2

!!! ERROR: x11-base/xorg-x11-6.8.0-r4 failed.
!!! Function src_compile, Line 266, Exitcode 2
!!! make World failed
!!! If you need support, post the topmost build error, NOT this status message.

Here's my Info:

Portage 2.0.51-r3 (default-linux/x86/2004.2, gcc-3.3.5, glibc-2.3.4.20040808-r1, 2.4.28 i686)
=================================================================
System uname: 2.4.28 i686 AMD Athlon(tm) MP 1600+
Gentoo Base System version 1.4.16
ccache version 2.3 [enabled]
Autoconf: sys-devel/autoconf-2.59-r6,sys-devel/autoconf-2.13
Automake: sys-devel/automake-1.8.5-r2,sys-devel/automake-1.5,sys-devel/automake-1.4_p6,sys-devel/automake-1.6.3,sys-devel/automake-1.7.9,sys-devel/automake-1.9.4
Binutils: sys-devel/binutils-2.15.92.0.2-r1
Headers:  sys-kernel/linux-headers-2.4.21-r1
Libtools: sys-devel/libtool-1.5.10-r3
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CFLAGS="-O2 -march=athlon-mp -pipe"
CHOST="i686-pc-linux-gnu"
COMPILER=""
CONFIG_PROTECT="/etc /usr/X11R6/lib/X11/xkb /usr/kde/2/share/config /usr/kde/3/share/config /usr/share/config /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-O2 -march=athlon-mp -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs autoconfig ccache distlocks sandbox sfperms"
GENTOO_MIRRORS="http://gentoo.osuosl.org http://distro.ibiblio.org/pub/Linux/distributions/gentoo"
MAKEOPTS="-j3"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY=""
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="x86 3dnow X aim alsa apache2 apm avi berkdb bitmap-fonts cdparanoia cdr clamav crypt cups curl divx4linux encode esd f77 faad fam flac font-server foomaticdb fortran gd gdbm gif gpm gtk gtk2 imagemagick imlib innodb ipv6 jpeg libwww mad maildir mmx mpeg mysql mysqli ncurses nvidia oggvorbis opengl oss pam pcre perl php png qt quicktime readline samba sdl slang spell sse sse2 ssl svga tcltk tcpd tidy truetype truetype-fonts type1-fonts xml2 xmms xosd xv xvid xvmc zlib"
Comment 1 Donnie Berkholz (RETIRED) gentoo-dev 2005-01-25 15:07:11 UTC
Can you reproduce this?
Comment 2 Donnie Berkholz (RETIRED) gentoo-dev 2005-01-25 15:13:27 UTC
Try recompiling with FEATURES="-ccache"
Comment 3 Ajay Sharma 2005-01-25 16:09:33 UTC
recompiling with FEATURES="-ccache" in my /etc/make.conf worked.
Comment 4 Donnie Berkholz (RETIRED) gentoo-dev 2005-01-25 16:15:29 UTC
This may be a ccache bug, but it's a little tough to tell. Brian, if you search bugzilla for that ld string "file format not recognized; treating as linker script" you'll see quite a few bugs. One I read suggested that ccache might be copying .c to .o rather than compiling.
Comment 5 Andrej Kacian (RETIRED) gentoo-dev 2005-03-19 06:12:42 UTC
I've had this happen with kdelibs-3.4.0, all the way from beta1 to full 3.4.0 release.
Comment 6 Brian Harring (RETIRED) gentoo-dev 2005-03-19 06:52:52 UTC
set CCACHE_LOGFILE="/var/tmp/portage/ccache.log" please for a run in which you can verify/catch it bailing.

Post that log please.  It's going to slowdown your run, but neh, do it anyways.
Comment 7 Andrej Kacian (RETIRED) gentoo-dev 2005-03-19 07:16:50 UTC
Created attachment 53863 [details]
ccache log, as requested by Brian

/bin/sh ../libtool --silent --mode=link --tag=CXX i686-pc-linux-gnu-g++ 
-Wnon-virtual-dtor -Wno-long-long -Wundef -ansi -D_XOPEN_SOURCE=500
-D_BSD_SOURCE -Wcast-align -Wconversion -Wchar-subscripts -Wall -W
-Wpointer-arith -Wwrite-strings -DNDEBUG -DNO_DEBUG -O2 -march=pentium4 -O2
-pipe -fomit-frame-pointer -Wformat-security -Wmissing-format-attribute
-fno-exceptions -fno-check-new -fno-common -fno-exceptions -fno-check-new
-fno-common -fvisibility=hidden -fvisibility-inlines-hidden 
-DQT_CLEAN_NAMESPACE -DQT_NO_ASCII_CAST -DQT_NO_STL -DQT_NO_COMPAT
-DQT_NO_TRANSLATION	-o libkdecore.la -rpath /usr/kde/3.4/lib
-L/usr/qt/3/lib -R /usr/kde/3.4/lib -R /usr/kde/3.4/lib -R /usr/qt/3/lib -R
/usr/lib  -L/usr/lib  -version-info 6:0:2 -no-undefined -Wl,--no-undefined
-Wl,--allow-shlib-undefined libintl.lo kapplication.lo kdebug.lo netwm.lo
kconfigbase.lo kconfig.lo ksimpleconfig.lo kconfigbackend.lo
kmanagerselection.lo kdesktopfile.lo kstandarddirs.lo ksock.lo kpty.lo
kprocess.lo kprocctrl.lo klocale.lo krfcdate.lo kiconeffect.lo kicontheme.lo
kiconloader.lo kwin.lo kwinmodule.lo krootprop.lo kcharsets.lo kckey.lo
kshortcut.lo kkeynative_x11.lo kkeyserver_x11.lo kaccelaction.lo
kshortcutmenu.lo kaccelbase.lo kaccel.lo kglobalaccel_x11.lo kglobalaccel.lo
kstdaccel.lo kshortcutlist.lo kcrash.lo kurl.lo kregexp.lo kglobal.lo
kglobalsettings.lo kallocator.lo kvmallocator.lo kmimesourcefactory.lo
kinstance.lo kpalette.lo kipc.lo klibloader.lo ktempfile.lo
kuniqueapplication.lo kaccelmanager.lo ksavefile.lo krandomsequence.lo
kstringhandler.lo kcompletion.lo kcmdlineargs.lo kaboutdata.lo
kcompletionbase.lo knotifyclient.lo kaudioplayer.lo kdcoppropertyproxy.lo
ksockaddr.lo kextsock.lo netsupp.lo kprocio.lo kbufferedio.lo
kpixmapprovider.lo kurldrag.lo kmdcodec.lo ksocks.lo fakes.lo vsnprintf.lo
ksycoca.lo ksycocadict.lo ksycocafactory.lo kxmessages.lo kstartupinfo.lo
kcatalogue.lo kasyncio.lo kmultipledrag.lo kstaticdeleter.lo kappdcopiface.lo
kclipboard.lo kcheckaccelerators.lo kdeversion.lo kdebugdcopiface.lo
kcalendarsystem.lo kcalendarsystemgregorian.lo kcalendarsystemhijri.lo
kcalendarsystemhebrew.lo kcalendarsystemfactory.lo kmacroexpander.lo kidna.lo
ktempdir.lo kshell.lo kmountpoint.lo kcalendarsystemjalali.lo
kprotocolinfo_kdecore.lo kprotocolinfofactory.lo kxerrorhandler.lo kuser.lo
kconfigskeleton.lo kconfigdialogmanager.lo klockfile.lo ksycoca_skel.lo
kappdcopiface_skel.lo kdebugdcopiface_skel.lo malloc/libklmalloc.la
network/libkdecorenetwork.la svgicons/libkdesvgicons.la ../dcop/libDCOP.la
../libltdl/libltdlc.la -lXext -lresolv -lutil -L/usr/lib -lart_lgpl_2 -lm -lidn
../kdefx/libkdefx.la 
/usr/lib/gcc/i686-pc-linux-gnu/3.4.3/../../../../i686-pc-linux-gnu/bin/ld:.libs/kaccelbase.o:
file format not recognized; treating as linker script
/usr/lib/gcc/i686-pc-linux-gnu/3.4.3/../../../../i686-pc-linux-gnu/bin/ld:.libs/kaccelbase.o:1:
syntax error
collect2: ld returned 1 exit status
make[4]: *** [libkdecore.la] Error 1
make[4]: Leaving directory
`/var/tmp/portage/kdelibs-3.4.0/work/kdelibs-3.4.0/kdecore'
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory
`/var/tmp/portage/kdelibs-3.4.0/work/kdelibs-3.4.0/kdecore'
make[2]: *** [all] Error 2
make[2]: Leaving directory
`/var/tmp/portage/kdelibs-3.4.0/work/kdelibs-3.4.0/kdecore'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/var/tmp/portage/kdelibs-3.4.0/work/kdelibs-3.4.0'
make: *** [all] Error 2

!!! ERROR: kde-base/kdelibs-3.4.0 failed.
!!! Function kde_src_compile, Line 166, Exitcode 2
!!! died running emake, kde_src_compile:make
!!! If you need support, post the topmost build error, NOT this status message.
Comment 8 Stian Skjelstad 2005-06-27 08:17:44 UTC
>
/usr/lib/gcc/i686-pc-linux-gnu/3.4.3/../../../../i686-pc-linux-gnu/bin/ld:.libs/kaccelbase.o:
file format not recognized; treating as linker script
>
/usr/lib/gcc/i686-pc-linux-gnu/3.4.3/../../../../i686-pc-linux-gnu/bin/ld:.libs/kaccelbase.o:1:
syntax error
> collect2: ld returned 1 exit status


If anybody still can reproduce this, please upload the .o file, so we can see
how the broken file looks.
Comment 9 Brian Harring (RETIRED) gentoo-dev 2005-07-01 07:24:28 UTC
Need info... (aforementioned .o file)
Comment 10 Benny Lønstrup Ammitzbøll 2010-04-06 08:18:34 UTC
Created attachment 226709 [details]
ASCII .o files

jpeg-8a wrong .o files (ASCII)
Comment 11 Benny Lønstrup Ammitzbøll 2010-04-06 08:24:39 UTC
Think I just saw this error - when doing emerge --update --deep --newuse world, media-libs/jpeg-8a failed with:

/usr/lib/gcc/i686-pc-linux-gnu/4.3.4/../../../../i686-pc-linux-gnu/bin/ld:.libs/jcarith.o: file format not recognized; treating as linker script                            
/usr/lib/gcc/i686-pc-linux-gnu/4.3.4/../../../../i686-pc-linux-gnu/bin/ld:.libs/jcarith.o:1: syntax error                                                                   

And when I looked in the dir, some of the .o files were ASCII:

vostro1700 jpeg-8a # file *.o | grep ASCII
jcarith.o:  ASCII C program text
jcdctmgr.o: ASCII C program text
jchuff.o:   ASCII C program text
jcmarker.o: ASCII C program text
jcmaster.o: ASCII C program text
jcparam.o:  ASCII C program text
jcsample.o: ASCII text
jdarith.o:  ASCII C program text, with very long lines
jdcoefct.o: ASCII text
jdhuff.o:   ASCII C program text
jdinput.o:  ASCII C program text

I've attached these as 'files.tgz'.

If I did a manual make clean; make in the dir there was no problem. And all .o files were ok. But emerge still failed.

Then I found this bug report, and sure enough, removing ccache cured the problem.
Comment 12 Tim 2010-04-19 12:54:01 UTC
I just saw this attempting to genkernel. 
...
*         >> Compiling 2.6.32-gentoo-r7 modules...
* ERROR: Failed to compile the "modules" target...

* -- Grepping log... --

  CC [M]  fs/ocfs2/dlm/dlmrecovery.o
objdump: fs/ocfs2/dlm/.tmp_dlmrecovery.o: File format not recognized
  LD [M]  fs/ocfs2/dlm/ocfs2_dlmfs.o
  LD [M]  fs/ocfs2/dlm/ocfs2_dlm.o
fs/ocfs2/dlm/dlmrecovery.o: file not recognized: File format not recognized
make[3]: *** [fs/ocfs2/dlm/ocfs2_dlm.o] Error 1

Unfortunately I deleted these .o files before encountering this Bug. Searching the ccache cache directory revealed the suspicious files attached.
Comment 13 Tim 2010-04-19 12:58:19 UTC
Created attachment 228385 [details]
Suspect files from ccache cache directory.
Comment 14 Chí-Thanh Christopher Nguyễn gentoo-dev 2010-04-30 02:53:49 UTC
Reopening.
Comment 15 Chí-Thanh Christopher Nguyễn gentoo-dev 2010-04-30 02:54:21 UTC
*** Bug 317533 has been marked as a duplicate of this bug. ***
Comment 16 SpanKY gentoo-dev 2010-04-30 12:36:51 UTC
looks like filesystem corruption.  not a bug in ccache when that occurs.  run fsck and clear your ccache.  if this occurs in the normal run of things (no filesytem corruption or kernel crash), we can look.
Comment 17 Chí-Thanh Christopher Nguyễn gentoo-dev 2010-04-30 19:22:13 UTC
I think this issue is way too common to dismiss as a hardware problem.
Comment 18 SpanKY gentoo-dev 2010-04-30 19:39:26 UTC
every investigated case so far has been disk corruption.  if you want to work on ccache to make it more resilient to such issues, feel free to contact upstream.
Comment 19 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2010-04-30 23:37:00 UTC
chithanh:
I provided instructions on the -dev list as to how to confirm that it wasn't a hardware problem. I'd love any testcase where you can prove using my instructions that it's not a hardware problem. When you get one, open a bug with all the relevant details.

Specifically to repeat my instructions.
0. disable distcc entirely.
1. Backup your ccache dir, then clear it out.
2. Build once to populate the empty ccache.
3. Build again, the bug should exist here now if there is one.
Comment 20 Rafał Mużyło 2010-05-08 01:05:33 UTC
In my experience, many of ccache related failures happen
due to parallel make, that is if a package fails due to parallel make,
sometimes an incorrect object, created during such aborted emerge,
gets stuck in ccache.

Those are in most cases irreproducible, as they are timing reliant.
Comment 21 Samuli Suominen (RETIRED) gentoo-dev 2010-07-12 05:55:12 UTC
*** Bug 327871 has been marked as a duplicate of this bug. ***
Comment 22 Samuli Suominen (RETIRED) gentoo-dev 2010-07-14 21:21:25 UTC
*** Bug 328293 has been marked as a duplicate of this bug. ***
Comment 23 Ryan Hill (RETIRED) gentoo-dev 2010-11-14 19:11:53 UTC
*** Bug 337573 has been marked as a duplicate of this bug. ***
Comment 24 SpanKY gentoo-dev 2010-11-24 01:06:37 UTC
*** Bug 345875 has been marked as a duplicate of this bug. ***
Comment 25 Agostino Sarubbo gentoo-dev 2011-06-03 22:00:47 UTC
not add arch team by yourself
Comment 26 Damien Hammer 2011-06-03 22:03:49 UTC
I had this error occur too. I am running gentoo on ~amd64 and when every time I emerged xorg-server it would have this same error but for file cvc-cvc.o. Once I disabled ccache to build the package the error stopped and the package emerged successfully. Since I disabled ccache for good, I never have this issue and I can gaurentee this bug is present on my arch, amd64, with ACCEPT_KEYWORDS=~amd64. Any admin may contact me if they need any more details about this issue from me but the initial problem has been solved by disabling ccache.
Comment 27 Samuli Suominen (RETIRED) gentoo-dev 2012-02-05 14:52:26 UTC
*** Bug 402123 has been marked as a duplicate of this bug. ***