Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Linking with --as-needed fails #4

Closed
xmw opened this Issue · 0 comments

2 participants

@xmw
xmw commented

Please fix the gcc linker invokation in Makefile, place $(LIBS) behind -o $@, otherwise linking with -Wl,--as-needed (which is used on most distros nowadays) fails.

Error:
x86_64-pc-linux-gnu-gcc -Wl,--hash-style=gnu -Wl,-O1 -Wl,--as-needed -pthread -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lpangocairo-1.0 -lcairo -lpango-1.0 -lfreetype -lfontconfig -lgdk_pixbuf_xlib-2.0 -lgdk_pixbuf-2.0 -lm -lgobject-2.0 -lgmodule-2.0 -lpng14 -lgthread-2.0 -lrt -lglib-2.0 -lX11 -L/usr/X11R6/lib -lXmu panel.o misc.o bg.o eggtraymanager.o eggmarshalers.o fixedtip.o main.o gdk-helper.o -o trayer-srg
panel.o: In function handle_error':
/var/tmp/portage/x11-misc/trayer-srg-1.1.2/work/trayer-srg-1.1.2/panel.c:409: undefined reference to
XGetErrorText'
panel.o: In function panel_set_wm_strut':
/var/tmp/portage/x11-misc/trayer-srg-1.1.2/work/trayer-srg-1.1.2/panel.c:66: undefined reference to
gtk_object_get_type'
/var/tmp/portage/x11-misc/trayer-srg-1.1.2/work/trayer-srg-1.1.2/panel.c:66: undefined reference to g_type_check_instance_cast'
/var/tmp/portage/x11-misc/trayer-srg-1.1.2/work/trayer-srg-1.1.2/panel.c:99: undefined reference to
XChangeProperty'
/var/tmp/portage/x11-misc/trayer-srg-1.1.2/work/trayer-srg-1.1.2/panel.c:102: undefined reference to XChangeProperty'
panel.o: In function
panel_size_alloc':
/var/tmp/portage/x11-misc/trayer-srg-1.1.2/work/trayer-srg-1.1.2/panel.c:189: undefined reference to gtk_window_get_type'
/var/tmp/portage/x11-misc/trayer-srg-1.1.2/work/trayer-srg-1.1.2/panel.c:189: undefined reference to
g_type_check_instance_cast'
/var/tmp/portage/x11-misc/trayer-srg-1.1.2/work/trayer-srg-1.1.2/panel.c:189: undefined reference to gtk_window_move'
panel.o: In function
panel_destroy_event':
/var/tmp/portage/x11-misc/trayer-srg-1.1.2/work/trayer-srg-1.1.2/panel.c:150: undefined reference to `gtk_main_quit'
(a ton of similar "undefined reference"s)

Fix

http://git.overlays.gentoo.org/gitweb/?p=dev/xmw.git;a=blob;f=x11-misc/trayer-srg/files/trayer-srg-1.1.2-as-needed.patch;h=851b21f0eabecf83e3c87deeb3eab06c0e0755bd;hb=99bce18f66447dd744e3842af278c9d7b7a5dc39

--- trayer-srg-1.1.2/Makefile
+++ trayer-srg-1.1.2/Makefile
@@ -19,7 +19,7 @@

TARGET = trayer
$(TARGET): $(OBJ)

  • $(CC) $(LDFLAGS) $(LIBS) $(OBJ) -o $@
  • $(CC) $(LDFLAGS) $(OBJ) -o $@ $(LIBS) ifeq (,$(DEVEL)) strip $@ endif

Arch linux ( http://aur.archlinux.org/packages.php?ID=36049 ) clears the LDFLAGs, which is just wrong, imho.

@sargon sargon was assigned
@sargon sargon closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.