emerge starts, it starts to compile gwhere and then fails with error: collect2: ld returned 1 exit status I have attached the console output as 'Additional Information' Reproducible: Always Steps to Reproduce: 1. emerge =x11-misc/gwhere-0.2.1 Actual Results: emerge fails Expected Results: emerge should succeed :) CONSOLE OUTPUT: ... /bin/sh ../../../libtool --mode=link gcc -march=athlon64 -O2 -ftracer -pipe -DGTK_ENABLE_BROKEN -Wall -o libgwplugindescriptionfile_id_diz.la -rpath /usr/share/gwhere/plugins/descr 'glib-config --cflags gmodule' -fPIC -version-info 1:0:0 file_id_diz.lo ../../../src/tools/libgwtools.a -lz *** Warning: Linking the shared library libgwplugindescriptiondescript_ion.la against the *** static library ../../../src/tools/libgwtools.a is not portable! rm -fr .libs/libgwplugindescriptiondescript_ion.la .libs/libgwplugindescriptiondescript_ion.* .libs/libgwplugindescriptiondescript_ion.* gcc -shared descript_ion.lo ../../../src/tools/libgwtools.a -lz -Wl,-soname -Wl,libgwplugindescriptiondescript_ion.so.1 -o .libs/libgwplugindescriptiondescript_ion.so.1.0.0 /usr/lib/gcc/x86_64-pc-linux-gnu/3.4.4/../../../../x86_64-pc-linux-gnu/bin/ld: ../../../src/tools/libgwtools.a(gwstring.o): relocation R_X86_64_32S against `a local symbol' can not be used when making a shared object; recompile with -fPIC ../../../src/tools/libgwtools.a: could not read symbols: Bad value collect2: ld returned 1 exit status make[4]: *** [libgwplugindescriptiondescript_ion.la] Error 1 make[4]: *** Waiting for unfinished jobs.... *** Warning: Linking the shared library libgwplugindescriptionfile_id_diz.la against the *** static library ../../../src/tools/libgwtools.a is not portable! rm -fr .libs/libgwplugindescriptionfile_id_diz.la .libs/libgwplugindescriptionfile_id_diz.* .libs/libgwplugindescriptionfile_id_diz.* gcc -shared file_id_diz.lo ../../../src/tools/libgwtools.a -lz -Wl,-soname -Wl,libgwplugindescriptionfile_id_diz.so.1 -o .libs/libgwplugindescriptionfile_id_diz.so.1.0.0 /usr/lib/gcc/x86_64-pc-linux-gnu/3.4.4/../../../../x86_64-pc-linux-gnu/bin/ld: ../../../src/tools/libgwtools.a(gwstring.o): relocation R_X86_64_32S against `a local symbol' can not be used when making a shared object; recompile with -fPIC ../../../src/tools/libgwtools.a: could not read symbols: Bad value collect2: ld returned 1 exit status make[4]: *** [libgwplugindescriptionfile_id_diz.la] Error 1 make[4]: Leaving directory `/var/tmp/portage/gwhere-0.2.1/work/gwhere-0.2.1/src/plugins/descr' make[3]: *** [all-recursive] Error 1 make[3]: Leaving directory `/var/tmp/portage/gwhere-0.2.1/work/gwhere-0.2.1/src/plugins' make[2]: *** [all-recursive] Error 1 make[2]: Leaving directory `/var/tmp/portage/gwhere-0.2.1/work/gwhere-0.2.1/src'make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/var/tmp/portage/gwhere-0.2.1/work/gwhere-0.2.1' make: *** [all-recursive-am] Error 2 !!! ERROR: x11-misc/gwhere-0.2.1 failed. !!! Function src_compile, Line 22, Exitcode 2 !!! emake failed !!! If you need support, post the topmost build error, NOT this status message. EMERGE INFO Portage 2.0.51.22-r2 (default-linux/amd64/2005.1, gcc-3.4.4, glibc-2.3.5-r1, 2.6.12-gentoo-r9 x86_64) ================================================================= System uname: 2.6.12-gentoo-r9 x86_64 AMD Athlon(tm) 64 Processor 3000+ Gentoo Base System version 1.6.13 dev-lang/python: 2.3.5 sys-apps/sandbox: 1.2.12 sys-devel/autoconf: 2.13, 2.59-r6 sys-devel/automake: 1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6 sys-devel/binutils: 2.15.92.0.2-r10 sys-devel/libtool: 1.5.18-r1 virtual/os-headers: 2.6.11-r2 ACCEPT_KEYWORDS="amd64" AUTOCLEAN="yes" CBUILD="x86_64-pc-linux-gnu" CFLAGS="-march=athlon64 -O2 -ftracer -pipe" CHOST="x86_64-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3.4/env /usr/kde/3.4/share/config /usr/kde/3.4/shutdown /usr/kde/3/share/config /usr/lib/X11/xkb /usr/lib64/mozilla/defaults/pref /usr/share/config /var/qmail/control" CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d" CXXFLAGS="-march=athlon64 -O2 -ftracer -pipe" DISTDIR="/usr/portage/distfiles" FEATURES="autoconfig distlocks sandbox sfperms strict" GENTOO_MIRRORS="http://gentoo.inode.at http://gentoo.ynet.sk/pub" LC_ALL="en_US.UTF-8" MAKEOPTS="-j2" PKGDIR="/usr/portage/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/usr/local/portage" SYNC="rsync://rsync.gentoo.org/gentoo-portage" USE="amd64 X a52 aac acpi alsa anthy apm avi berkdb bitmap-fonts canna cdr cjk crypt cups curl dts dvd dvdr dvdread encode ffmpeg flac foomaticdb gd gdbm gif gnome gpm gstreamer gtk gtk2 guile hal icq imlib immqt-bc ipv6 java jpeg junit libcaca libwww lzo lzw lzw-tiff mad matroska mikmod mozilla mp3 mpeg ncurses nls nptl ogg oggvorbis opengl pam pdflib perl png python quicktime readline samba sdl slang ssl tcpd theora tiff timidity truetype truetype-fonts type1-fonts unicode usb userlocales vorbis xml xml2 xpm xprint xv xvid zlib userland_GNU kernel_linux elibc_glibc" Unset: ASFLAGS, CTARGET, LANG, LDFLAGS, LINGUAS
having a closer look at the output, i saw this is not a -fPIC issue: ... /usr/share/gwhere/plugins/descr 'glib-config --cflags gmodule' -fPIC ... in ${S}/src/plugins/descr/Makefile.in glib-config is called with '' instead of $()
I tried to compile gwhere myself but it failed too. Then I found http://www.mail-archive.com/gwhere-discussion@nongnu.org/msg00005.html and tried: CFLAGS="-Wall -fPIC" CXXFLAGS="-Wall -fPIC" emerge -u gwhere It passed the previous failpoint and failed on ... make[4]: Leaving directory `/var/tmp/portage/gwhere-0.2.1/work/gwhere-0.2.1/src/plugins/catalog' make[3]: Leaving directory `/var/tmp/portage/gwhere-0.2.1/work/gwhere-0.2.1/src/plugins' make[3]: Entering directory `/var/tmp/portage/gwhere-0.2.1/work/gwhere-0.2.1/src' gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../intl -I../src/res -I../src/tools -I../src/db -I../src/data -I../src/gui -DXTHREADS -D_REENTRANT -DXUSE_MTSAFE_API -I/usr/include/gtk-2.0 -I/usr/lib64/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/pango-1.0 -I/usr/include/freetype2 -I/usr/include/freetype2/config -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -DOS_LINUX -Wall -fPIC -DGTK_ENABLE_BROKEN -c main.c gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../intl -I../src/res -I../src/tools -I../src/db -I../src/data -I../src/gui -DXTHREADS -D_REENTRANT -DXUSE_MTSAFE_API -I/usr/include/gtk-2.0 -I/usr/lib64/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/pango-1.0 -I/usr/include/freetype2 -I/usr/include/freetype2/config -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -DOS_LINUX -Wall -fPIC -DGTK_ENABLE_BROKEN -c gwsupport.c main.c: In function `main': main.c:62: warning: implicit declaration of function `setlocale' main.c:62: error: `LC_ALL' undeclared (first use in this function) main.c:62: error: (Each undeclared identifier is reported only once main.c:62: error: for each function it appears in.) make[3]: *** [main.o] Error 1 make[3]: *** Waiting for unfinished jobs.... make[3]: *** Waiting for unfinished jobs.... make[3]: Leaving directory `/var/tmp/portage/gwhere-0.2.1/work/gwhere-0.2.1/src' make[2]: *** [all-recursive] Error 1 make[2]: Leaving directory `/var/tmp/portage/gwhere-0.2.1/work/gwhere-0.2.1/src' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/var/tmp/portage/gwhere-0.2.1/work/gwhere-0.2.1' make: *** [all-recursive-am] Error 2 !!! ERROR: x11-misc/gwhere-0.2.1 failed. !!! Function src_compile, Line 22, Exitcode 2 !!! emake failed !!! If you need support, post the topmost build error, NOT this status message. The same happened when I tried to compile it from sources - I guess I'll send author a mail, it looks like a bug in the sources. Or I'll try to fix it myself :)
I finally got it compiled: CFLAGS="-fPIC -Wall" ./configure --enable-gtk20 edit /src/main.c and add '#include <locale.h>' at line 27 make But this build is highly unstable, segfaults frequently, and is unable to open its own catalog file (failing with "There is no available catalog plugin").
x11-misc/gwhere-0.2.1 compiled for me fine. Looks like this is AMD64-specific. Martin Vysny: adding -fPIC solves the compilation error?
> adding -fPIC solves the compilation error? It seems so, but only when you make it by hand - CFLAGS="-Wall -fPIC" CXXFLAGS="-Wall -fPIC" emerge -u gwhere resolves the compilation error but fails on another error.
Created attachment 69228 [details, diff] gwhere-0.2.1.ebuild.patch Attached is a patch for gwhere-0.2.1.ebuild. Could You test if this solves the issue. This patch also changes USE as per bug 106560.
I had the exact same compile failure as the original poster (I'm also on amd64), and the patch solved the problem here. I've yet to experience any other problems with it.
Patch works fine... but is it the perfect solution? Now AMD64 users will have the binary compiled with -fPIC. Surely it would be better to remove the if use amd64 -> append-flags -fPIC and edit the makefiles so that only the libraries are built with fPIC? And to make this the same for all arches? Feel free to shoot me down, I don't really know what I'm talking about ;-) Jim
Created attachment 69556 [details] gwhere-0.2.1-r1.ebuild
Created attachment 69557 [details, diff] gwhere-0.2.1-locale.h.patch Please test this. It removes GTK1 support wrt bug 106560. Also: in first comment there is -fPIC, so I don't see the need to force it for all binaries.
Created attachment 69638 [details, diff] gwhere-0.2.1-amd64.patch AMD64 fixes.
Comment on attachment 69556 [details] gwhere-0.2.1-r1.ebuild Grmph... should not obsolete this one.
Fixed in CVS.