lvm2-2.02.139-dynamic-static-ldflags.patch 2.8 KB

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