[PATCH] Fix static build

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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: signature.asc
Description: This is a digitally signed message part.

_______________________________________________
linux-lvm mailing list
linux-lvm@redhat.com
https://www.redhat.com/mailman/listinfo/linux-lvm
read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/

[Index of Archives]     [Gluster Users]     [Kernel Development]     [Linux Clusters]     [Device Mapper]     [Security]     [Bugtraq]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]

  Powered by Linux