summaryrefslogtreecommitdiff
path: root/community/libfaketime/libfaketime-0.9.1-fix-as-needed.patch
diff options
context:
space:
mode:
Diffstat (limited to 'community/libfaketime/libfaketime-0.9.1-fix-as-needed.patch')
-rw-r--r--community/libfaketime/libfaketime-0.9.1-fix-as-needed.patch39
1 files changed, 39 insertions, 0 deletions
diff --git a/community/libfaketime/libfaketime-0.9.1-fix-as-needed.patch b/community/libfaketime/libfaketime-0.9.1-fix-as-needed.patch
new file mode 100644
index 000000000..870349145
--- /dev/null
+++ b/community/libfaketime/libfaketime-0.9.1-fix-as-needed.patch
@@ -0,0 +1,39 @@
+From f0ee2ee1e0a2fa5f11614a55ab8543380faa9695 Mon Sep 17 00:00:00 2001
+From: Lukas Fleischer <info@cryptocrack.de>
+Date: Sun, 22 Jan 2012 21:47:52 +0100
+Subject: [PATCH] Fix linking with "-Wl,--as-needed"
+
+Reorder linker flags in order to ensure proper linking when using
+"--Wl,--as-needed". Read http://www.gentoo.org/proj/en/qa/asneeded.xml,
+especially "Importance of linking order" for details:
+
+ Basically, what the linker does is look for the symbols missing in a
+ given file (either an object file, a static archive or a library)
+ only in the files coming after it. When using the normal linking,
+ without --as-needed, this is not a problem, although there might be
+ some internal drawbacks on the linking stage, the files are linked
+ together without considering ordering. But with the flag, the
+ libraries that aren't used for resolving symbols are discarded and
+ thus not linked.
+
+Signed-off-by: Lukas Fleischer <info@cryptocrack.de>
+---
+ src/Makefile | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/src/Makefile b/src/Makefile
+index 9118815..d4a04b5 100644
+--- a/src/Makefile
++++ b/src/Makefile
+@@ -69,7 +69,7 @@ ${OBJ}: faketime.c
+ ${CC} -o $@ -c ${CFLAGS} ${EXTRA_FLAGS} $<
+
+ lib%.so.${SONAME}: %.o
+- ${CC} -o $@ -Wl,-soname,$@ ${LDFLAGS} $<
++ ${CC} -o $@ -Wl,-soname,$@ $< ${LDFLAGS}
+
+ clean:
+ @rm -f ${OBJ} ${LIBS}
+--
+1.7.8.4
+