! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
dict plugin fails to build with '--as-needed' linker flag
Status:
CLOSED: FIXED
Product:
Xfce4-dict
Component:
General

Comments

Description Joshua Rich 2008-07-16 10:30:34 CEST
User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9) Gecko/2008062822 (Gentoo) Firefox/3.0
Build Identifier: 

As of revision 5104, the dict plugin fails to build with the --as-needed LDFLAG set.  The error that occurs is as follows:

mkdir .libs
i686-pc-linux-gnu-gcc -I.. -I../lib -D_REENTRANT -I/usr/include/xfce4 -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/cairo -I/usr/include/freetype2 -I/usr/include/directfb -I/usr/include/libpng12 -I/usr/include/pixman-1 -I/usr/include/atk-1.0 -D_REENTRANT -I/usr/include/xfce4/ -I/usr/include/xfce4 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/pango-1.0 -I/usr/include/cairo -I/usr/include/freetype2 -I/usr/include/directfb -I/usr/include/libpng12 -I/usr/include/pixman-1 -I/usr/include/atk-1.0 -DPACKAGE_LOCALE_DIR=\"/usr/share/locale\" -pthread -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -march=athlon-xp -O2 -pipe -fomit-frame-pointer -Wl,-O1 -Wl,--hash-style=gnu -Wl,--sort-common -Wl,--as-needed -o xfce4-dict-plugin xfce4_dict_plugin-xfce4-dict-plugin.o -pthread  /usr/lib/libxfce4panel.so -L/usr/lib /usr/lib/libxfcegui4.so /usr/lib/libstartup-notification-1.so /usr/lib/libSM.so /usr/lib/libICE.so /usr/lib/libgtk-x11-2.0.so /usr/lib/libxfce4util.so /usr/lib/libgdk-x11-2.0.so /usr/lib/libatk-1.0.so /usr/lib/libgdk_pixbuf-2.0.so /usr/lib/libpangocairo-1.0.so /usr/lib/libpangoft2-1.0.so /usr/lib/libpango-1.0.so /usr/lib/libcairo.so /usr/lib/libfontconfig.so /usr/lib/libfreetype.so /usr/lib/libxml2.so /usr/lib/libdirectfb.so /usr/lib/libfusion.so /usr/lib/libdirect.so /usr/lib/libglitz-glx.so /usr/lib/libglitz.so /usr/lib/libGL.so /usr/lib/libXext.so /usr/lib/libpng12.so -lz /usr/lib/libXrender.so /usr/lib/libX11.so /usr/lib/libXau.so /usr/lib/libXdmcp.so /usr/lib/libpixman-1.so -lm /usr/lib/libgobject-2.0.so /usr/lib/libgmodule-2.0.so -ldl /usr/lib/libgthread-2.0.so -lpthread -lrt /usr/lib/libglib-2.0.so ../lib/libdict.a  
../lib/libdict.a(libdict_a-common.o): In function `dict_search_word':
common.c:(.text+0xb1c): undefined reference to `xfce_err'
../lib/libdict.a(libdict_a-dictd.o): In function `dict_dictd_get_list':
dictd.c:(.text+0xc5d): undefined reference to `xfce_err'
dictd.c:(.text+0xc90): undefined reference to `xfce_err'
dictd.c:(.text+0xcc0): undefined reference to `xfce_err'
../lib/libdict.a(libdict_a-gui.o): In function `dict_gui_about_dialog':
gui.c:(.text+0xf9): undefined reference to `xfce_about_info_new'
gui.c:(.text+0x133): undefined reference to `xfce_about_info_add_credit'
gui.c:(.text+0x143): undefined reference to `xfce_about_info_set_homepage'
gui.c:(.text+0x185): undefined reference to `xfce_about_dialog_new_with_values'
gui.c:(.text+0x20c): undefined reference to `xfce_about_info_free'
../lib/libdict.a(libdict_a-prefs.o): In function `dict_prefs_dialog_show':
prefs.c:(.text+0x1ca): undefined reference to `xfce_titled_dialog_new_with_buttons'
../lib/libdict.a(libdict_a-prefs.o): In function `dict_prefs_dialog_response':
prefs.c:(.text+0x2380): undefined reference to `xfce_err'
collect2: ld returned 1 exit status
make[2]: *** [xfce4-dict-plugin] Error 1
rm xfce4-dict-plugin.desktop.in
make[2]: Leaving directory `/var/tmp/portage/xfce-extra/xfce4-dict-9999/work/xfce4-dict-9999/panel-plugin'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/var/tmp/portage/xfce-extra/xfce4-dict-9999/work/xfce4-dict-9999'
make: *** [all] Error 2

Removing the --as-needed LDFLAG results in a successful build.


Reproducible: Always

Steps to Reproduce:
1. Set --as-needed in LDFLAGS (export LDFLAGS="-Wl,--as-needed").
2. Checkout latest dict plugin from svn (r5104)
3. ./configure && make && make install

Actual Results:  
Build fails with error as detailed above.

Expected Results:  
dict plugin should compile with --as-needed linker flag.

I have the following compiler/linker environment variables set:

LDFLAGS="-Wl,-O1 -Wl,--hash-style=gnu -Wl,--sort-common -Wl,--as-needed"
CFLAGS="-march=athlon-xp -O2 -pipe -fomit-frame-pointer"
MAKEOPTS="-j2 -l 2.0"

gcc version 4.1.2
binutils version 2.18

Please let me know if I can provide any additional information.

Thanks and regards,

Joshua Rich
Comment 1 Joshua Rich 2008-07-16 10:33:44 CEST
The following configure command-line option was used:

./configure --enable-maintainer-mode --prefix=/usr --host=i686-pc-linux-gnu --libdir=/usr/lib --mandir=/usr/share/man --infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc --localstatedir=/var/lib --disable-dependency-tracking
Comment 2 Enrico Tröger editbugs 2008-07-17 09:10:40 CEST
Thanks for reporting.
Should be fixed in r5123. Please test it.
Comment 3 Joshua Rich 2008-07-17 10:24:40 CEST
Hi Enrico,

I just did an svn update and all compiled, installed and working now.  Thanks for the quick response and fix!

Regards,

Joshua
Comment 4 Enrico Tröger editbugs 2008-07-17 14:01:52 CEST
No problem :D.

Bug #4235

Reported by:
Joshua Rich
Reported on: 2008-07-16
Last modified on: 2009-07-15

People

Assignee:
Enrico Tröger
CC List:
0 users

Version

Version:
unspecified

Attachments

Additional information