When trying to build TC version 5.0 or 5.0a, the build fails with "i686-pc-linux-gnu/bin/ld: unrecognized option '--hash-style=sysv'" Reproducible: Always Steps to Reproduce: 1.Try to build TrueCrypt 5.0 or 5.0a 2. 3. Actual Results: Failure. Relevant output lines: Linking truecrypt i686-pc-linux-gnu-g++ -o truecrypt -Wl,--gc-sections -Wl,--hash-style=sysv Application.o CommandLineInterface.o FavoriteVolume.o FatalErrorHandler.o GraphicUserInterface.o LanguageStrings.o Hotkey.o StringFormatter.o TextUserInterface.o UserInterface.o UserPreferences.o VolumeHistory.o Xml.o Unix/Main.o Forms/AboutDialog.o Forms/ChangePasswordDialog.o Forms/DeviceSelectionDialog.o Forms/EncryptionOptionsWizardPage.o Forms/FavoriteVolumesDialog.o Forms/Forms.o Forms/InfoWizardPage.o Forms/KeyfilesDialog.o Forms/KeyfilesPanel.o Forms/LegalNoticesDialog.o Forms/MainFrame.o Forms/MountOptionsDialog.o Forms/PreferencesDialog.o Forms/ProgressWizardPage.o Forms/SelectDirectoryWizardPage.o Forms/SingleChoiceWizardPage.o Forms/VolumePasswordPanel.o Forms/VolumePropertiesDialog.o Forms/VolumeCreationIntroWizardPage.o Forms/VolumeCreationProgressWizardPage.o Forms/VolumeCreationWizard.o Forms/VolumeFormatOptionsWizardPage.o Forms/VolumeLocationWizardPage.o Forms/VolumePasswordWizardPage.o Forms/VolumeSizeWizardPage.o Forms/WizardFrame.o Resources.o /var/tmp/portage/app-crypt/truecrypt-5.0a/work/truecrypt-5.0a-source/Core/Core.a /var/tmp/portage/app-crypt/truecrypt-5.0a/work/truecrypt-5.0a-source/Driver/Fuse/Driver.a /var/tmp/portage/app-crypt/truecrypt-5.0a/work/truecrypt-5.0a-source/Volume/Volume.a /var/tmp/portage/app-crypt/truecrypt-5.0a/work/truecrypt-5.0a-source/Platform/Platform.a -pthread -lfuse -lrt -ldl -pthread -L/usr/X11R6/lib -lwx_gtk2u_adv-2.8 -lwx_gtk2u_core-2.8 -lwx_baseu-2.8 /usr/lib/gcc/i686-pc-linux-gnu/4.1.2/../../../../i686-pc-linux-gnu/bin/ld: unrecognized option '--hash-style=sysv' /usr/lib/gcc/i686-pc-linux-gnu/4.1.2/../../../../i686-pc-linux-gnu/bin/ld: use the --help option for usage information collect2: ld returned 1 exit status make[1]: *** [truecrypt] Error 1 make[1]: Leaving directory `/var/tmp/portage/app-crypt/truecrypt-5.0a/work/truecrypt-5.0a-source/Main' make: *** [all] Error 2 Expected Results: TrueCrypt builds. emerge --info: Portage 2.1.4.4 (default-linux/x86/2007.0/desktop, gcc-4.1.2, glibc-2.6.1-r0, 2.6.23-gentoo-r3 i686) ================================================================= System uname: 2.6.23-gentoo-r3 i686 Intel(R) Pentium(R) 4 CPU 3.40GHz Timestamp of tree: Thu, 14 Feb 2008 13:30:01 +0000 ccache version 2.4 [enabled] app-shells/bash: 3.2_p17-r1 dev-java/java-config: 1.3.7, 2.1.4 dev-lang/python: 2.4.4-r6 dev-python/pycrypto: 2.0.1-r6 dev-util/ccache: 2.4-r7 sys-apps/baselayout: 1.12.10-r5 sys-apps/sandbox: 1.2.18.1-r2 sys-devel/autoconf: 2.13, 2.61-r1 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.18-r1 sys-devel/gcc-config: 1.4.0-r4 sys-devel/libtool: 1.5.24 virtual/os-headers: 2.6.23-r3 ACCEPT_KEYWORDS="x86" CBUILD="i686-pc-linux-gnu" CFLAGS="-march=pentium4 -O2 -pipe" CHOST="i686-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/config" CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/terminfo /etc/texmf/web2c /etc/udev/rules.d" CXXFLAGS="-O2 -mcpu=i686 -pipe" DISTDIR="/usr/portage/distfiles" FEATURES="ccache distlocks metadata-transfer sandbox sfperms strict unmerge-orphans userfetch" GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo" LANG="en_US.UTF-8" LC_ALL="en_US.UTF-8" LINGUAS="en en_US" MAKEOPTS="-j2" PKGDIR="/usr/portage/packages" PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/usr/local/portage" USE="16bit 4kstacks 7zip X Xaw3d a52 aac aalib acl acpi ada addbookmarks adns aiglx aim alias alisp alsa amr ao aotuv apache2 asf asm audiofile autoipd autoreplace avahi bash-completion bcmath bcp berkdb bidi bitmap-fonts bjam bluetooth bogofilter bonjour bonobo bookmarks branding browserplugin bzip2 bzlib cairo calendar cardbus ccache cdda cddb cdio cdparanoia cdr cdrom cgi chm clearcase cli codecs commercial connectionstatus console contactnotes contentcache corba cpudetection cracklib cran crypt css ctype cups curl curlwrappers cvs d daap dbus dga dio disassembler divx divx4linux djvu dmi dnd dri dts dvb dvd dvdr dvdread effects elf emacs emboss enca encode esd exif expat exscalibar extensions extrafilters fam fame fastcgi fat fb ffmpeg fftw firefox flac fltk font-server fontconfig foomaticdb force-cgi-redirect fortran fpx freetype ftp fuse gadu galago gd gdbm gg ggi gif gimpprint glib glitz glsa glut gmail gmedia gmp gnome gnome-print gphoto2 gpm graphviz groupwise gs gsm gstreamer gtk gtkhtml h323 hal hash haskell hbci hdri highlight history howl-compat hpn httpd iconv icq icu id3 idn ieee1394 imagemagick imap imlib inkjar inode inquisitio ipf-transparent ipod ipv6 irc isdnlog jabber jack jack-tmpfs java javascript jbig jce jikes jit joystick jpeg jpeg2k kde kdeenablefinal kdrive kerberos keyring kqemu krb4 ladspa lame largeterminal lash latex lcms ldap lesstif libcaca libnotify libsamplerate live lm_sensors logitech-mouse logrotate lua lzo lzw mad maildir math matroska mbox md5sum mdnsresponder-compat meanwhile memlimit mhash midi mikmod mime mjpeg mmap mmx mmxext mng mod mono motif mozbranding mozdevelop mozilla mozsvg mozxmlterm mp3 mp4 mp4live mpeg mpeg2 mpi mplayer msn multiuser musepack musicbrainz mysql mysqli nas ncurses neXt nethack netjack network network-cron new-login nfs nls nntp nowlistening nptl nptlonly nsplugin ntlm numeric nvidia nxclient offensive ofx ogg ole on-the-fly-crypt openal openexr opengl openmp oscar oss paludis pam pam_timestamp pascal paste64 pch pcntl pcre pdf pdo-external perforce perl php physfs player plotutils plugin png pnp portaudio posix postfix postscript povray ppds pppd prediction profile pyste python qa qemu-fast qq qt3 qt3support qt4 quicktime quotes rar rdesktop readline real realmedia reflection reiserfs remote resolvconf restrict rpm rrdtool rss rtsp ruby rubytests samba sametime sasl scanner screen screenshot sdl sdl-image sdl-sound sdlaudio sensord session sharedext sharedmem shorten shout silc simplexml skey skins slp smime sms smux sndfile snmp soap sockets socks5 sound soundex speedo speex spell spl sql sqlite sqlite3 srt sse sse2 ssl startup-notification statistics stencil-buffer stream subversion svg svga sysfs sysvipc tcl tcltk tcpd tetex texteffect theora threads tidy tiff tk tokenizer toolbar tools transcode translator truetype truetype-fonts type1 type1-fonts unicode usb utempter utf8 utils v4l v4l2 vcd vhosts vidix vim vim-pager vim-syntax vim-with-x visualization vlm vorbis webdav webpresence wifi win32codecs winpopup wmf wmp wxgtk1 wxwindows x264 x86 xanim xattr xcb xchatnogtk xchattext xcomposite xface xforms xine xinerama xkb xml xmlreader xmlrpc xmlwriter xmp xorg xosd xpm xprint xscreensaver xsl xv xvid xvmc yahoo yv12 zephyr zeroconf zip zlib zsh-completion" ALSA_CARDS="intel8x0 usb-audio echo3g" 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" APACHE2_MODULES="actions alias auth_basic auth_digest authn_anon authn_dbd authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock dbd deflate dir disk_cache env expires ext_filter file_cache filter headers ident imagemap include info log_config logio mem_cache mime mime_magic negotiation proxy proxy_ajp proxy_balancer proxy_connect proxy_http rewrite setenvif so speling status unique_id userdir usertrack vhost_alias" CAMERAS="canon directory" ELIBC="glibc" INPUT_DEVICES="keyboard mouse evdev joystick" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en en_US" USERLAND="GNU" VIDEO_CARDS="ati radeon vesa fbdev" Unset: CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LDFLAGS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
post the output of `ld --version` and `ld --help`
ld --version: GNU ld version 2.16.1 Copyright 2005 Free Software Foundation, Inc. This program is free software; you may redistribute it under the terms of the GNU General Public License. This program has absolutely no warranty. ld --help: Usage: ld [options] file... Options: -a KEYWORD Shared library control for HP/UX compatibility -A ARCH, --architecture ARCH Set architecture -b TARGET, --format TARGET Specify target for following input files -c FILE, --mri-script FILE Read MRI format linker script -d, -dc, -dp Force common symbols to be defined -e ADDRESS, --entry ADDRESS Set start address -E, --export-dynamic Export all dynamic symbols -EB Link big-endian objects -EL Link little-endian objects -f SHLIB, --auxiliary SHLIB Auxiliary filter for shared object symbol table -F SHLIB, --filter SHLIB Filter for shared object symbol table -g Ignored -G SIZE, --gpsize SIZE Small data size (if no size, same as --shared) -h FILENAME, -soname FILENAME Set internal name of shared library -I PROGRAM, --dynamic-linker PROGRAM Set PROGRAM as the dynamic linker to use -l LIBNAME, --library LIBNAME Search for library LIBNAME -L DIRECTORY, --library-path DIRECTORY Add DIRECTORY to library search path --sysroot=<DIRECTORY> Override the default sysroot location -m EMULATION Set emulation -M, --print-map Print map file on standard output -n, --nmagic Do not page align data -N, --omagic Do not page align data, do not make text readonly --no-omagic Page align data, make text readonly -o FILE, --output FILE Set output file name -O Optimize output file -Qy Ignored for SVR4 compatibility -q, --emit-relocs Generate relocations in final output -r, -i, --relocatable Generate relocatable output -R FILE, --just-symbols FILE Just link symbols (if directory, same as --rpath) -s, --strip-all Strip all symbols -S, --strip-debug Strip debugging symbols --strip-discarded Strip symbols in discarded sections --no-strip-discarded Do not strip symbols in discarded sections -t, --trace Trace file opens -T FILE, --script FILE Read linker script -u SYMBOL, --undefined SYMBOL Start with undefined reference to SYMBOL --unique [=SECTION] Don't merge input [SECTION | orphan] sections -Ur Build global constructor/destructor tables -v, --version Print version information -V Print version and emulation information -x, --discard-all Discard all local symbols -X, --discard-locals Discard temporary local symbols (default) --discard-none Don't discard any local symbols -y SYMBOL, --trace-symbol SYMBOL Trace mentions of SYMBOL -Y PATH Default search path for Solaris compatibility -(, --start-group Start a group -), --end-group End a group --accept-unknown-input-arch Accept input files whose architecture cannot be determined --no-accept-unknown-input-arch Reject input files whose architecture is unknown --add-needed Set DT_NEEDED tags for DT_NEEDED entries in following dynamic libs --no-add-needed Do not set DT_NEEDED tags for DT_NEEDED entries in following dynamic libs --as-needed Only set DT_NEEDED for following dynamic libs if used --no-as-needed Always set DT_NEEDED for following dynamic libs -assert KEYWORD Ignored for SunOS compatibility -Bdynamic, -dy, -call_shared Link against shared libraries -Bstatic, -dn, -non_shared, -static Do not link against shared libraries -Bsymbolic Bind global references locally --check-sections Check section addresses for overlaps (default) --no-check-sections Do not check section addresses for overlaps --cref Output cross reference table --defsym SYMBOL=EXPRESSION Define a symbol --demangle [=STYLE] Demangle symbol names [using STYLE] --embedded-relocs Generate embedded relocs --fatal-warnings Treat warnings as errors -fini SYMBOL Call SYMBOL at unload-time --force-exe-suffix Force generation of file with .exe suffix --gc-sections Remove unused sections (on some targets) --no-gc-sections Don't remove unused sections (default) --hash-size=<NUMBER> Set default hash table size close to <NUMBER> --help Print option help -init SYMBOL Call SYMBOL at load-time -Map FILE Write a map file --no-define-common Do not define Common storage --no-demangle Do not demangle symbol names --no-keep-memory Use less memory and more disk I/O --no-undefined Do not allow unresolved references in object files --allow-shlib-undefined Allow unresolved references in shared libaries --no-allow-shlib-undefined Do not allow unresolved references in shared libs --allow-multiple-definition Allow multiple definitions --no-undefined-version Disallow undefined version --default-symver Create default symbol version --default-imported-symver Create default symbol version for imported symbols --no-warn-mismatch Don't warn about mismatched input files --no-whole-archive Turn off --whole-archive --noinhibit-exec Create an output file even if errors occur -nostdlib Only use library directories specified on the command line --oformat TARGET Specify target of output file -qmagic Ignored for Linux compatibility --reduce-memory-overheads Reduce memory overheads, possibly taking much longer --relax Relax branches on certain targets --retain-symbols-file FILE Keep only symbols listed in FILE -rpath PATH Set runtime shared library search path -rpath-link PATH Set link time shared library search path -shared, -Bshareable Create a shared library -pie, --pic-executable Create a position independent executable --sort-common Sort common symbols by size --sort-section name|alignment Sort sections by name or maximum alignment --spare-dynamic-tags COUNT How many tags to reserve in .dynamic section --split-by-file [=SIZE] Split output sections every SIZE octets --split-by-reloc [=COUNT] Split output sections every COUNT relocs --stats Print memory usage statistics --target-help Display target specific options --task-link SYMBOL Do task level linking --traditional-format Use same format as native linker --section-start SECTION=ADDRESS Set address of named section -Tbss ADDRESS Set address of .bss section -Tdata ADDRESS Set address of .data section -Ttext ADDRESS Set address of .text section --unresolved-symbols=<method> How to handle unresolved symbols. <method> is: ignore-all, report-all, ignore-in-object-files, ignore-in-shared-libs --verbose Output lots of information during link --version-script FILE Read version information script --version-exports-section SYMBOL Take export symbols list from .exports, using SYMBOL as the version. --warn-common Warn about duplicate common symbols --warn-constructors Warn if global constructors/destructors are seen --warn-multiple-gp Warn if the multiple GP values are used --warn-once Warn only once per undefined symbol --warn-section-align Warn if start of section changes due to alignment --warn-shared-textrel Warn if shared object has DT_TEXTREL --warn-unresolved-symbols Report unresolved symbols as warnings --error-unresolved-symbols Report unresolved symbols as errors --whole-archive Include all objects from following archives --wrap SYMBOL Use wrapper functions for SYMBOL ld: supported targets: elf32-i386 a.out-i386-linux efi-app-ia32 elf64-x86-64 elf64-little elf64-big elf32-little elf32-big srec symbolsrec tekhex binary ihex trad-core ld: supported emulations: elf_i386 i386linux elf_x86_64 ld: emulation specific options: elf_i386: -Bgroup Selects group name lookup rules for DSO --disable-new-dtags Disable new dynamic tags --enable-new-dtags Enable new dynamic tags --eh-frame-hdr Create .eh_frame_hdr section -z combreloc Merge dynamic relocs into one section and sort -z defs Report unresolved symbols in object files. -z execstack Mark executable as requiring executable stack -z execheap Mark executable as requiring executable heap -z initfirst Mark DSO to be initialized first at runtime -z interpose Mark object to interpose all DSOs but executable -z lazy Mark object lazy runtime binding (default) -z loadfltr Mark object requiring immediate process -z muldefs Allow multiple definitions -z nocombreloc Don't merge dynamic relocs into one section -z nocopyreloc Don't create copy relocs -z nodefaultlib Mark object not to use default search paths -z nodelete Mark DSO non-deletable at runtime -z nodlopen Mark DSO not available to dlopen -z nodump Mark DSO not available to dldump -z noexecstack Mark executable as not requiring executable stack -z noexecheap Mark executable as not requiring executable heap -z norelro Don't create RELRO program header -z now Mark object non-lazy runtime binding -z origin Mark object requiring immediate $ORIGIN processing at runtime -z relro Create RELRO program header -z KEYWORD Ignored for Solaris compatibility elf_x86_64: -Bgroup Selects group name lookup rules for DSO --disable-new-dtags Disable new dynamic tags --enable-new-dtags Enable new dynamic tags --eh-frame-hdr Create .eh_frame_hdr section -z combreloc Merge dynamic relocs into one section and sort -z defs Report unresolved symbols in object files. -z execstack Mark executable as requiring executable stack -z execheap Mark executable as requiring executable heap -z initfirst Mark DSO to be initialized first at runtime -z interpose Mark object to interpose all DSOs but executable -z lazy Mark object lazy runtime binding (default) -z loadfltr Mark object requiring immediate process -z muldefs Allow multiple definitions -z nocombreloc Don't merge dynamic relocs into one section -z nocopyreloc Don't create copy relocs -z nodefaultlib Mark object not to use default search paths -z nodelete Mark DSO non-deletable at runtime -z nodlopen Mark DSO not available to dlopen -z nodump Mark DSO not available to dldump -z noexecstack Mark executable as not requiring executable stack -z noexecheap Mark executable as not requiring executable heap -z norelro Don't create RELRO program header -z now Mark object non-lazy runtime binding -z origin Mark object requiring immediate $ORIGIN processing at runtime -z relro Create RELRO program header -z KEYWORD Ignored for Solaris compatibility Report bugs to <URL:http://www.sourceware.org/bugzilla/>
> GNU ld version 2.16.1 Clearly won't work; use binutils-config to switch to a supported binutils version.
Um...how? playground ~ # eselect binutils list Installed binutils for target i686-pc-linux-gnu [1] 2.18 * playground ~ # Saying it "clearly won't work" doesn't mean anything to me. There's nothing "clear" about it from my non-guru perspective.
For good measure: playground ~ # binutils-config -l [1] i686-pc-linux-gnu-2.18 * playground ~ # binutils-config -c i686-pc-linux-gnu-2.18 playground ~ #
Okay, after doing some digging, despite what eselect binutils and binutils-config is telling me, everything is symlinked wrong in /usr/i686-pc-linux-gnu/bin (pasted below...note that ldscripts target does not exist). How might this have happened, how do I fix it (do I manually re-do each of these symlinks or something else, and are there any others on the system I should be changing too), and how might I fix any brokenness that might be on my system as a result? playground i686-pc-linux-gnu # ls -al bin total 0 drwxr-xr-x 2 root root 424 2007-03-02 16:57 . drwxr-xr-x 6 root root 152 2006-02-13 23:24 .. lrwxrwxrwx 1 root root 52 2007-03-02 16:57 addr2line -> /usr/i686-pc-linux-gnu/binutils-bin/2.16.1/addr2line lrwxrwxrwx 1 root root 45 2007-03-02 16:57 ar -> /usr/i686-pc-linux-gnu/binutils-bin/2.16.1/ar lrwxrwxrwx 1 root root 45 2007-03-02 16:57 as -> /usr/i686-pc-linux-gnu/binutils-bin/2.16.1/as lrwxrwxrwx 1 root root 50 2007-03-02 16:57 c++filt -> /usr/i686-pc-linux-gnu/binutils-bin/2.16.1/c++filt lrwxrwxrwx 1 root root 48 2007-03-02 16:57 gprof -> /usr/i686-pc-linux-gnu/binutils-bin/2.16.1/gprof lrwxrwxrwx 1 root root 45 2007-03-02 16:57 ld -> /usr/i686-pc-linux-gnu/binutils-bin/2.16.1/ld lrwxrwxrwx 1 root root 52 2007-03-02 16:57 ldscripts -> /usr/lib/binutils/i686-pc-linux-gnu/2.16.1/ldscripts lrwxrwxrwx 1 root root 45 2007-03-02 16:57 nm -> /usr/i686-pc-linux-gnu/binutils-bin/2.16.1/nm lrwxrwxrwx 1 root root 50 2007-03-02 16:57 objcopy -> /usr/i686-pc-linux-gnu/binutils-bin/2.16.1/objcopy lrwxrwxrwx 1 root root 50 2007-03-02 16:57 objdump -> /usr/i686-pc-linux-gnu/binutils-bin/2.16.1/objdump lrwxrwxrwx 1 root root 49 2007-03-02 16:57 ranlib -> /usr/i686-pc-linux-gnu/binutils-bin/2.16.1/ranlib lrwxrwxrwx 1 root root 50 2007-03-02 16:57 readelf -> /usr/i686-pc-linux-gnu/binutils-bin/2.16.1/readelf lrwxrwxrwx 1 root root 47 2007-03-02 16:57 size -> /usr/i686-pc-linux-gnu/binutils-bin/2.16.1/size lrwxrwxrwx 1 root root 50 2007-03-02 16:57 strings -> /usr/i686-pc-linux-gnu/binutils-bin/2.16.1/strings lrwxrwxrwx 1 root root 48 2007-03-02 16:57 strip -> /usr/i686-pc-linux-gnu/binutils-bin/2.16.1/strip
Running binutils-config again to specify 2.18 (despite it saying I was already using 2.18) seems to have fixed the symlinks. Feel free to close, but hopefully you can answer my question about whether there's anything else I need to do to my system to make it sane as a result of whatever went wrong.
There's nothing we'd fix here; use binutils-config.