The following ld error occurs when building klibc with -Wl,... flags in LDFLAGS: >>> Emerging (1 of 1) dev-libs/klibc-1.2.1-r1 to / ... >>> Compiling source in /var/tmp/portage/klibc-1.2.1-r1/work/klibc-1.2.1 ... ... KLIBCLD klibc/syscalls/syscalls.o ld: unrecognized option '-Wl,-O1' ld: use the --help option for usage information make[3]: *** [klibc/syscalls/syscalls.o] Error 1 make[2]: *** [klibc/syscalls] Error 2 make[1]: *** [all] Error 2 make: *** [klibc] Error 2 emerge --info Portage 2.1_rc3 (default-linux/ppc/ppc32/2006.0/G4, gcc-4.1.1, glibc-2.3.6-r4, 2.6.15-gentoo-r1 ppc) ================================================================= System uname: 2.6.15-gentoo-r1 ppc 7400, altivec supported Gentoo Base System version 1.12.0 dev-lang/python: 2.4.3-r1 dev-python/pycrypto: 2.0.1-r5 dev-util/ccache: [Not Present] dev-util/confcache: [Not Present] sys-apps/sandbox: 1.2.18.1 sys-devel/autoconf: 2.13, 2.59-r7 sys-devel/automake: 1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2 sys-devel/binutils: 2.16.1-r2 sys-devel/libtool: 1.5.22 virtual/os-headers: 2.6.11-r4 ACCEPT_KEYWORDS="ppc ~ppc" AUTOCLEAN="yes" CBUILD="powerpc-unknown-linux-gnu" CFLAGS="-O2 -pipe -mcpu=G4 -maltivec -mabi=altivec" CHOST="powerpc-unknown-linux-gnu" CONFIG_PROTECT="/etc /usr/kde/3.4/env /usr/kde/3.4/share/config /usr/kde/3.4/shutdown /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/gconf /etc/revdep-rebuild /etc/terminfo /etc/env.d" CXXFLAGS="-O2 -pipe -mcpu=G4 -maltivec -mabi=altivec" DISTDIR="/usr/portage/distfiles" FEATURES="autoconfig distlocks metadata-transfer sandbox sfperms strict" GENTOO_MIRRORS="http://mirror.pacific.net.au/gentoo http://gentoo.osuosl.org http://www.ibiblio.org/pub/Linux/distributions/gentoo" LANG="en_US.UTF-8" LDFLAGS="-Wl,-O1 -Wl,--sort-common" 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'" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" SYNC="rsync://rsync.au.gentoo.org/gentoo-portage" USE="ppc X aac alsa altivec apache2 apm berkdb cdr cli crypt dbus dri encode fbcon ffmpeg gdbm gif gpm gstreamer gtk2 hal imlib ipv6 jpeg kde libg++ libwww mad matroska mmap mono mp3 mpeg msn ncurses nls nptl nptlonly offensive ogg opengl pam pcre pdf pdflib perl pic png python qt quicktime readline reflection ruby session spl ssl svg tcpd theora tiff truetype truetype-fonts udev unicode usb vorbis wifi xml xmms xorg xv xvid zlib elibc_glibc input_devices_keyboard input_devices_mouse kernel_linux userland_GNU video_cards_r128 video_cards_rage128 video_cards_ati" Unset: CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, LINGUAS, MAKEOPTS, PORTAGE_RSYNC_EXTRA_OPTS, PORTDIR_OVERLAY
Created attachment 88242 [details, diff] Patch for klibc-1.2.1-r1.ebuild which fixes LDFLAGS-related breakage ...and here's a proposed patch to the ebuild which adds LDFLAGS="$(raw-ldflags)" to the build and install command lines (which fixes the problem), although I have no idea whether this is the Right Thing to do. Best, Ron
Is this only on ppc ? Because it works fine with LDFLAGS="-Wl,-O1" on amd64 and x86.
I can't say for sure, Martin, as I no longer have the PPC machine to test. Can anyone else confirm whether this still happens on PPC?
This seems fixed w/ klibc-1.5, I just compiled it on a ppc32 box, and it didn't complain about any LDFLAGS (which I had defined via environment).