summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2015-07-07 13:19:13 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2015-07-07 13:19:13 -0400
commit50e7fd784434f8efcc1598ce47b33608d078e9d4 (patch)
tree8f870af4093dbbf9f26b1a1bbd6d6516b860c0a3
parent8bb4e28404ac8c320e7a0fe31e29312920ed05fe (diff)
On linux, pass --as-needed to linker to avoid linking with unused shared libraries including libyaml.
-rw-r--r--debian/changelog2
-rw-r--r--git-annex.cabal5
2 files changed, 7 insertions, 0 deletions
diff --git a/debian/changelog b/debian/changelog
index 81fd27b25..c4b253949 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -18,6 +18,8 @@ git-annex (5.20150618) UNRELEASED; urgency=medium
running code and other things.
* Support git's undocumented core.sharedRepository=2 value, which
is equivilant to "world".
+ * On linux, pass --as-needed to linker to avoid linking with unused
+ shared libraries including libyaml.
-- Joey Hess <id@joeyh.name> Thu, 02 Jul 2015 12:31:14 -0400
diff --git a/git-annex.cabal b/git-annex.cabal
index cd8347161..a53eecabb 100644
--- a/git-annex.cabal
+++ b/git-annex.cabal
@@ -133,6 +133,11 @@ Executable git-annex
-- Some things don't work with the non-threaded RTS.
GHC-Options: -threaded
+ -- Avoid linking with unused dynamic libaries.
+ -- (Only tested on Linux).
+ if os(Linux)
+ GHC-Options: -optl-Wl,--as-needed
+
if flag(network-uri)
Build-Depends: network-uri (>= 2.6), network (>= 2.6)
else