As originally reported in bug #183604, strip --strip-unneeded /usr/lib/fpc/2.0.4/units/*/rtl/syscall.o strips necessary info. I have no idea whose bug this is, but 13:31 < SpanKY> truedfx: file a bug ... if strip is stripping too much, it's a bug in binutils that needs to be fixed Here you go :) I don't know if it helps, but: $ nm syscall.o 0000000000000000 D THREADVARLIST_SYSCALL $ strip --strip-unneeded syscall.o $ nm syscall.o nm: syscall.o: no symbols $ emerge --info Portage 2.1.3_rc6 (default-linux/amd64/2006.1/no-multilib, gcc-4.1.2, glibc-2.5-r3, 2.6.21-gentoo-r3 x86_64) ================================================================= System uname: 2.6.21-gentoo-r3 x86_64 AMD Athlon(tm) 64 X2 Dual Core Processor 4200+ Gentoo Base System release 2.0.0_alpha3 Timestamp of tree: Fri, 29 Jun 2007 19:00:01 +0000 dev-lang/python: 2.4.4-r4 dev-python/pycrypto: 2.0.1-r5 sys-apps/sandbox: 1.2.18.1 sys-devel/autoconf: 2.13, 2.61 sys-devel/automake: 1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10 sys-devel/binutils: 2.17 sys-devel/gcc-config: 1.4.0 sys-devel/libtool: 1.5.24 virtual/os-headers: 2.6.21 ACCEPT_KEYWORDS="amd64 ~amd64" AUTOCLEAN="yes" CBUILD="x86_64-pc-linux-gnu" CFLAGS="-march=athlon64 -O2 -pipe" CHOST="x86_64-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/X11/xkb /usr/share/config" CONFIG_PROTECT_MASK="/etc/env.d /etc/gconf /etc/revdep-rebuild /etc/terminfo /etc/texmf/web2c" CXXFLAGS="-march=athlon64 -O2 -pipe" DISTDIR="/usr/portage/distfiles" EMERGE_DEFAULT_OPTS="--with-bdeps=y" FEATURES="assume-digests autopatch collision-protect cvs distlocks metadata-transfer multilib-strict notitles parallel-fetch sandbox sfperms sign strict unmerge-orphans" GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo" LANG="en_GB.UTF-8" LDFLAGS="-Xlinker --as-needed" LINGUAS="*" MAKEOPTS="-j2" PKGDIR="/usr/portage/packages" PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --filter=H_**/files/digest-*" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/var/cvs/gentoo-x86 /etc/portage/overlay" SYNC="rsync://rsync.gentoo.org/gentoo-portage" USE="X a52 accessibility akode alsa amd64 bidi bindist bitmap-fonts boost bzip2 cjk cli clucene cracklib crypt cvs dbus dri dvd dvdnav dvdread ffmpeg filepicker flac ftp gif gmp gtk iconv immqt inotify ipv6 isdnlog jpeg kde kdeenablefinal kdehiddenvisibility libg++ mbox midi mozdevelop mudflap ncurses nls nocxx nptl nptlonly nsplugin ogg opengl pascal perl png ppds pppd qt3 readline reflection rtc sdl session spl sql ssl tcpd tetex threads truetype truetype-fonts type1-fonts unicode v4l v4l2 vorbis xcomposite xorg zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mulaw multi null plug rate route share shm softvol" ELIBC="glibc" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="*" USERLAND="GNU" VIDEO_CARDS="nv vesa" Unset: CTARGET, INSTALL_MASK, LC_ALL, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
And binutils 2.16.1-r3 behaves the same way as 2.17.
this can also be seen with yasm/nasm when the ELF objects dont include DWARF debugging information ...
this has been fixed upstream ... i guess i'll put out a 2.17-r1 as who knows when 2.18 will be done
*** Bug 186695 has been marked as a duplicate of this bug. ***
This was never or only briefly fixed properly. When RESTRICT=strip is removed from fpc/lazarus, bug #183604 happens still.
the original test case works fine for me (look at upstream URL) so if that passes for you as well, then you'll have to refresh how to reproduce. it's been way too long for me to remember. no idea what provides "syscall.o" ...
Ouch, sorry, it's actually a somewhat different case also triggered in fpc where stripping is also too aggressive. I never noticed the difference before, or I would've let you know about this sooner... Here's the C equivalent: $ cat test1.c int i; $ cat test2.c extern int i; int main(void) { return i; } $ gcc -c test1.c test2.c $ nm test1.o test2.o test1.o: 00000004 C i test2.o: U i 00000000 T main $ strip --strip-unneeded test1.o test2.o $ nm test1.o test2.o test1.o: nm: test1.o: no symbols test2.o: U i 00000000 T main $ gcc test1.o test2.o -o test test2.o: In function `main': (.text+0xf): undefined reference to `i' collect2: ld returned 1 exit status
the `nm` output is irrelevant ... nm shows debugging symbols, not all symbols. that's why you'll want to stick with readelf ... seems like the next bug is that strip will drop COM objects (uninitialized/bss) $ cat test.c int i; int j = 1; $ gcc -c test.c $ readelf -s test.o | grep OBJ 7: 0000000000000000 4 OBJECT GLOBAL DEFAULT 2 j 8: 0000000000000004 4 OBJECT GLOBAL DEFAULT COM i $ strip --strip-unneeded test.o $ readelf -s test.o | grep OBJ 7: 0000000000000000 4 OBJECT GLOBAL DEFAULT 2 j $ ...
old bug: http://sourceware.org/bugzilla/show_bug.cgi?id=4716 new bug: http://sourceware.org/bugzilla/show_bug.cgi?id=9933
upstream has committed a patch for the issue. i dont suppose you can retest fpc to see if it fixes things ? you can simply put it into /etc/portage/patches/sys-devel/binutils/ and the ebuild will automatically apply it ...
The build of lazarus finishes successfully with the patch applied, so it seems there are no other remaining issues.
added strip fix to 2.19.1-r1 ... i'd like to get this stabilized soonish, so that's why i'm not doing another 2.18 -r# http://sources.gentoo.org/gentoo/src/patchsets/binutils/2.19.1/10_all_binutils-2.18-strip-common.patch?r1=1.1&r2=1.2