link-order.diff 1.82 KB
Newer Older
1 2 3
Author: Andreas Beckmann <anbe@debian.org>
Description: link libraries after object files
 to allow proper dependency resolution
4
 drop now superfluous --no-as-needed flag
5
 fail on unresolved symbols
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26

--- a/src/Makefile
+++ b/src/Makefile
@@ -49,7 +49,7 @@ ifndef GTK2_CFLAGS
 endif
 
 ifndef GTK2_LDFLAGS
-  GTK2_LDFLAGS         := -Wl,--no-as-needed $(shell $(PKG_CONFIG) --libs gtk+-2.0)
+  GTK2_LDFLAGS         := $(shell $(PKG_CONFIG) --libs gtk+-2.0)
 endif
 
 ifndef GTK3_AVAILABLE
@@ -62,7 +62,7 @@ ifeq (1,$(GTK3_AVAILABLE))
   endif
 
   ifndef GTK3_LDFLAGS
-    GTK3_LDFLAGS         := -Wl,--no-as-needed $(shell $(PKG_CONFIG) --libs gtk+-3.0)
+    GTK3_LDFLAGS         := $(shell $(PKG_CONFIG) --libs gtk+-3.0)
   endif
 else
   GTK3_CFLAGS ?=
Andreas Beckmann's avatar
Andreas Beckmann committed
27
@@ -293,19 +293,19 @@ $(NVIDIA_SETTINGS).unstripped: $(OBJS) $
Andreas Beckmann's avatar
Andreas Beckmann committed
28
 $(eval $(call DEBUG_INFO_RULES, $(GTK2LIB)))
Andreas Beckmann's avatar
Andreas Beckmann committed
29
 $(GTK2LIB).unstripped: $(GTK2_OBJS) $(XCP_OBJS) $(IMAGE_OBJS) $(VERSION_MK)
30
 	$(call quiet_cmd,LINK) -shared $(CFLAGS) $(LDFLAGS) $(BIN_LDFLAGS) \
Andreas Beckmann's avatar
Andreas Beckmann committed
31 32
-	    $(XNVCTRL_ARCHIVE) $(LIBS) $(GTK2_LIBS) \
-	    -Wl,--unresolved-symbols=ignore-all -o $@ \
33
+	    -o $@ \
34
 	    -Wl,-soname -Wl,$(GTK2LIB_SONAME) \
Andreas Beckmann's avatar
Andreas Beckmann committed
35 36
-	    $(GTK2_OBJS) $(IMAGE_OBJS) $(XCP_OBJS)
+	    $(GTK2_OBJS) $(IMAGE_OBJS) $(XCP_OBJS) \
Andreas Beckmann's avatar
Andreas Beckmann committed
37
+	    $(XNVCTRL_ARCHIVE) $(LIBS) $(GTK2_LIBS)
38 39
 
 ifdef BUILD_GTK3LIB
Andreas Beckmann's avatar
Andreas Beckmann committed
40
 $(eval $(call DEBUG_INFO_RULES, $(GTK3LIB)))
Andreas Beckmann's avatar
Andreas Beckmann committed
41
 $(GTK3LIB).unstripped: $(GTK3_OBJS) $(XCP_OBJS) $(IMAGE_OBJS) $(VERSION_MK)
42
 	$(call quiet_cmd,LINK) -shared $(CFLAGS) $(LDFLAGS)  $(BIN_LDFLAGS) \
Andreas Beckmann's avatar
Andreas Beckmann committed
43 44
-	    $(XNVCTRL_ARCHIVE) $(LIBS) $(GTK3_LIBS) \
-	    -Wl,--unresolved-symbols=ignore-all -o $@ \
45
+	    -o $@ \
46
 	    -Wl,-soname -Wl,$(GTK3LIB_SONAME) \
Andreas Beckmann's avatar
Andreas Beckmann committed
47 48
-	    $(GTK3_OBJS) $(XCP_OBJS) $(IMAGE_OBJS)
+	    $(GTK3_OBJS) $(XCP_OBJS) $(IMAGE_OBJS) \
Andreas Beckmann's avatar
Andreas Beckmann committed
49
+	    $(XNVCTRL_ARCHIVE) $(LIBS) $(GTK3_LIBS)
50 51
 endif
 
Andreas Beckmann's avatar
Andreas Beckmann committed
52
 # define the rule to build each object file