lvm2-2.02.129-dynamic-static-ldflags.patch 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. --- LVM2.2.02.129/configure.in
  2. +++ LVM2.2.02.129/configure.in
  3. @@ -31,6 +31,7 @@
  4. linux*)
  5. CLDFLAGS="$CLDFLAGS -Wl,--version-script,.export.sym"
  6. ELDFLAGS="-Wl,--export-dynamic"
  7. + STATIC_LDFLAGS="-Wl,--no-export-dynamic"
  8. # FIXME Generate list and use --dynamic-list=.dlopen.sym
  9. CLDWHOLEARCHIVE="-Wl,-whole-archive"
  10. CLDNOWHOLEARCHIVE="-Wl,-no-whole-archive"
  11. @@ -2008,6 +2009,7 @@
  12. AC_SUBST(SELINUX_PC)
  13. AC_SUBST(SNAPSHOTS)
  14. AC_SUBST(STATICDIR)
  15. +AC_SUBST(STATIC_LDFLAGS)
  16. AC_SUBST(STATIC_LINK)
  17. AC_SUBST(TESTING)
  18. AC_SUBST(TESTSUITE_DATA)
  19. --- LVM2.2.02.129/daemons/dmeventd/Makefile.in
  20. +++ LVM2.2.02.129/daemons/dmeventd/Makefile.in
  21. @@ -66,7 +66,7 @@
  22. $(DL_LIBS) $(LVMLIBS) $(LIBS) -rdynamic
  23. dmeventd.static: $(LIB_STATIC) dmeventd.o $(interfacebuilddir)/libdevmapper.a
  24. - $(CC) $(CFLAGS) $(LDFLAGS) $(ELDFLAGS) -static -L. -L$(interfacebuilddir) -o $@ \
  25. + $(CC) $(CFLAGS) $(LDFLAGS) $(ELDFLAGS) $(STATIC_LDFLAGS) -static -L. -L$(interfacebuilddir) -o $@ \
  26. dmeventd.o $(DL_LIBS) $(LVMLIBS) $(LIBS) $(STATIC_LIBS)
  27. ifeq ("@PKGCONFIG@", "yes")
  28. --- LVM2.2.02.129/make.tmpl.in
  29. +++ LVM2.2.02.129/make.tmpl.in
  30. @@ -48,6 +48,7 @@
  31. # FIXME set this only where it's needed, not globally?
  32. CFLAGS ?= @COPTIMISE_FLAG@ @CFLAGS@
  33. LDFLAGS ?= @COPTIMISE_FLAG@ @LDFLAGS@
  34. +STATIC_LDFLAGS += @STATIC_LDFLAGS@
  35. CLDFLAGS += @CLDFLAGS@
  36. ELDFLAGS += @ELDFLAGS@
  37. LDDEPS += @LDDEPS@
  38. --- LVM2.2.02.129/tools/Makefile.in
  39. +++ LVM2.2.02.129/tools/Makefile.in
  40. @@ -129,7 +129,7 @@
  41. -o $@ dmsetup.o -ldevmapper $(LIBS)
  42. dmsetup.static: dmsetup.o $(interfacebuilddir)/libdevmapper.a
  43. - $(CC) $(CFLAGS) $(LDFLAGS) -static -L$(interfacebuilddir) \
  44. + $(CC) $(CFLAGS) $(LDFLAGS) $(STATIC_LDFLAGS) -static -L$(interfacebuilddir) \
  45. -o $@ dmsetup.o -ldevmapper $(STATIC_LIBS) $(LIBS)
  46. all: device-mapper
  47. @@ -146,7 +146,7 @@
  48. endif
  49. lvm.static: $(OBJECTS) lvm-static.o $(top_builddir)/lib/liblvm-internal.a $(interfacebuilddir)/libdevmapper.a
  50. - $(CC) $(CFLAGS) $(LDFLAGS) -static -L$(interfacebuilddir) -o $@ \
  51. + $(CC) $(CFLAGS) $(LDFLAGS) $(STATIC_LDFLAGS) -static -L$(interfacebuilddir) -o $@ \
  52. $(OBJECTS) lvm-static.o $(LVMLIBS) $(STATIC_LIBS) $(LIBS)
  53. liblvm2cmd.a: $(top_builddir)/lib/liblvm-internal.a $(OBJECTS) lvmcmdlib.o lvm2cmd.o