I tried to emerge scribus, last upgrade, and I found: /bin/sh ../../../libtool --silent --tag=CXX --mode=link x86_64-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 -O2 -Wl,--as-needed -march=nocona -O2 -pipe -ftree-vectorize -ftree-vectorizer-verbose=1 -Wformat-security -Wmissing-format-attribute -fno-exceptions -fno-check-new -fno-common -Wno-non-virtual-dtor -lfreetype -lz -module -o libscribusshortwords.la -rpath /usr/lib64/scribus/plugins -version-info 0:0:0 vlnadialog.lo parse.lo shortwords.lo configuration.lo swprefsgui.lo -lnsl /usr/lib/gcc/x86_64-pc-linux-gnu/4.1.2/../../../../x86_64-pc-linux-gnu/bin/ld: .libs/vlnadialog.o: relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC .libs/vlnadialog.o: could not read symbols: Bad value collect2: ld returned 1 exit status make[4]: *** [libscribusshortwords.la] Error 1 make[4]: Leaving directory `/var/tmp/portage/app-office/scribus-1.3.3.9/work/scribus-1.3.3.9/scribus/plugins/short-words' make[3]: *** [all-recursive] Error 1 make[3]: Leaving directory `/var/tmp/portage/app-office/scribus-1.3.3.9/work/scribus-1.3.3.9/scribus/plugins' make[2]: *** [all-recursive] Error 1 make[2]: Leaving directory `/var/tmp/portage/app-office/scribus-1.3.3.9/work/scribus-1.3.3.9/scribus' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/var/tmp/portage/app-office/scribus-1.3.3.9/work/scribus-1.3.3.9' make: *** [all] Error 2 Reproducible: Always $ emerge --info Portage 2.1.2.2 (default-linux/amd64/2007.0/desktop, gcc-4.1.2, glibc-2.5-r2, 2.6.21-gentoo x86_64) ================================================================= System uname: 2.6.21-gentoo x86_64 Intel(R) Core(TM)2 CPU T7200 @ 2.00GHz Gentoo Base System release 1.12.9 Timestamp of tree: Thu, 17 May 2007 06:30:01 +0000 dev-java/java-config: 1.3.7, 2.0.32 dev-lang/python: 2.4.4-r4 dev-python/pycrypto: 2.0.1-r5 sys-apps/sandbox: 1.2.17 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.16.1-r3 sys-devel/gcc-config: 1.3.16 sys-devel/libtool: 1.5.22 virtual/os-headers: 2.6.21 ACCEPT_KEYWORDS="amd64" AUTOCLEAN="yes" CBUILD="x86_64-pc-linux-gnu" CFLAGS="-Wl,--as-needed -march=nocona -O2 -pipe -ftree-vectorize -ftree-vectorizer-verbose=1" 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 /var/bind" CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/gconf /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/splash /etc/terminfo /etc/texmf/web2c" CXXFLAGS="-Wl,--as-needed -march=nocona -O2 -pipe -ftree-vectorize -ftree-vectorizer-verbose=1" DISTDIR="/usr/portage/distfiles" FEATURES="distlocks metadata-transfer sandbox sfperms strict" GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo" LANG="es_ES.UTF-8" LINGUAS="es es_ES en" MAKEOPTS="" 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="/usr/local/portage /usr/local/layman/voip" SYNC="rsync://rsync.gentoo.org/gentoo-portage" USE="X aac acl acpi aiglx alsa amd64 apache2 arts avahi avi bash-completion berkdb bitmap-fonts bluetooth bonjour cairo cdr cli cracklib crypt cups curl dbus dlloader dri dvd dvdr dvdread eds emboss encode esd evdev evo fam firefox fortran galago gdbm gif gnome gpm gstreamer gtk gtk2 hal iconv icu iproute2 ipv6 isdnlog java jpeg kde kdehiddenvisibility kerberos lcms ldap libg++ logrotate lucene mad midi mikmod mmx mono mouse mp3 mpeg ncurses nls nptl nptlonly nsplugin obex ogg opengl oss pam pcre pdf pdflib perl png ppds pppd python qt3 qt3support qt4 quicktime readline reflection sdl session spell spl sse sse2 ssl svg tcpd theora threads tiff truetype truetype-fonts type1-fonts udev unicode v4l v4l2 vorbis xinerama xml xorg xrandr xv xvid zlib" ALSA_CARDS="hda-intel" 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" DVB_CARDS="usb-wt220u" ELIBC="glibc" INPUT_DEVICES="synaptics mouse evdev keyboard" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="es es_ES en" USERLAND="GNU" VIDEO_CARDS="vesa i810 intel" Unset: CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, LDFLAGS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Still happens in the plugins subdir with 1.3.4: /bin/sh ../../../libtool --silent --tag=CXX --mode=link x86_64-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 -O2 -Wl,--as-needed -march=nocona -O2 -pipe -ftree-vectorize -ftree-vectorizer-verbose=1 -Wformat-security -Wmissing-format-attribute -fno-exceptions -fno-check-new -fno-common -Wno-non-virtual-dtor -lfreetype -lz -module -o libscribusshortwords.la -rpath /usr/lib64/scribus/plugins -version-info 0:0:0 vlnadialog.lo parse.lo shortwords.lo configuration.lo swprefsgui.lo -lnsl /usr/lib/gcc/x86_64-pc-linux-gnu/4.1.2/../../../../x86_64-pc-linux-gnu/bin/ld: .libs/vlnadialog.o: relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC .libs/vlnadialog.o: could not read symbols: Bad value collect2: ld returned 1 exit status make[4]: *** [libscribusshortwords.la] Error 1 Note that -fPIC should be added for .so files in amd64 and possibly other architectures (PPC, ...)
Hmm, I can't reproduce this (amd64). Could you attach a complete build log and the config.log? I'm not a gcc expert but could it have something to do with the non standard C(XX)FLAGS?
> CFLAGS="-Wl,--as-needed -march=nocona -O2 -pipe -ftree-vectorize > -ftree-vectorizer-verbose=1" [...] > CXXFLAGS="-Wl,--as-needed -march=nocona -O2 -pipe -ftree-vectorize > -ftree-vectorizer-verbose=1" Please try again with something sane, like CFLAGS="-march=nocona -O2". Same for CXXFLAGS. It's probably an --as-needed bug[1]. [1] http://www.gentoo.org/proj/en/qa/asneeded.xml
I worked around the problem by adding -fPIC to the LTCOMPILE definition in Makefile.in of the directories where .so were built (namely plugins/*), and it emerged and works with tree-vectorization and --as-needed linking. My guess, if it really compiles in settings without -fPIC in CFLAGS, is that some configure test fails because of the warnings raised during compile by the -Wl,--as-needed and/or -ftree-vectorizer-verbose=1 options. The compilation of scribus is too heavy to re-test, specially for the benefit of people that considers my CFLAGS "insane". I might consider retesting in the next upgrade, if it still fails. For the moment I got: $ ldd -u -r /usr/bin/scribus $ what I wanted.
closing invalid, we don't support cflags beyond -O2 and some selected ones (pipe, fomit-frame-pointer, nothing else I guess).