linux-lvm.redhat.com archive mirror
 help / color / mirror / Atom feed
* [linux-lvm] [PATCH] Fix static build
@ 2011-08-28 13:44 Thomas Koeller
  0 siblings, 0 replies; only message in thread
From: Thomas Koeller @ 2011-08-28 13:44 UTC (permalink / raw)
  To: linux-lvm

[-- Attachment #1: Type: text/plain, Size: 1231 bytes --]

I tried a statically-linked build of LVM2.2.02.86 on Linux 3.0 x86_64
using glibc 2.14, binutils 2.21.1, gcc 4.6.1. The linking step failed
because of "-Wl,--export-dynamic" being present in LDFLAGS. This
patch fixes it:

--- LVM2.2.02.86-orig/configure.in	2011-04-28 18:54:33.000000000 +0200
+++ LVM2.2.02.86/configure.in	2011-08-28 15:18:14.000000000 +0200
@@ -34,7 +34,7 @@ case "$host_os" in
 		CLDWHOLEARCHIVE="-Wl,-whole-archive"
 		CLDNOWHOLEARCHIVE="-Wl,-no-whole-archive"
 		LDDEPS="$LDDEPS .export.sym"
-		LDFLAGS="$LDFLAGS -Wl,--export-dynamic"
+		DYNAMIC_LDFLAGS="-Wl,--export-dynamic"
 		LIB_SUFFIX=so
 		DEVMAPPER=yes
 		ODIRECT=yes
@@ -49,6 +49,7 @@ case "$host_os" in
 		CLDFLAGS="$CLDFLAGS"
 		CLDWHOLEARCHIVE="-all_load"
 		CLDNOWHOLEARCHIVE=
+		DYNAMIC_LDFLAGS=
 		LIB_SUFFIX=dylib
 		DEVMAPPER=yes
 		ODIRECT=no
@@ -153,6 +154,10 @@ AC_ARG_ENABLE(static_link,
 	      STATIC_LINK=$enableval, STATIC_LINK=no)
 AC_MSG_RESULT($STATIC_LINK)

+if test "$STATIC_LINK" != "yes"; then
+	LDFLAGS="$LDFLAGS $DYNAMIC_LDFLAGS"
+fi
+
 ################################################################################
 dnl -- Prefix is /usr by default, the exec_prefix default is setup later
 AC_PREFIX_DEFAULT(/usr)


Thomas

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 490 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2011-08-28 13:45 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-08-28 13:44 [linux-lvm] [PATCH] Fix static build Thomas Koeller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).