0003-lib-Makefile.am-remove-static-from-LDFLAGS.patch 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. From e8ba4d6fd11ce795d9ed7b7a2c0ee0f6bf50f352 Mon Sep 17 00:00:00 2001
  2. From: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
  3. Date: Sat, 23 Jul 2022 18:20:00 +0200
  4. Subject: [PATCH] lib*/Makefile.am: remove -static from LDFLAGS
  5. The libbloom, libcork and libipset libraries are "convenience
  6. libraries" in libtool speak, and their code ends up being used in a
  7. shared library, so building them with -static does not work as it
  8. causes the code to be built without fPIC.
  9. https://www.gnu.org/software/libtool/manual/html_node/Static-libraries.html
  10. explains:
  11. """
  12. If you omit both -rpath and -static, libtool will create a convenience
  13. library that can be used to create other libtool libraries, even
  14. shared ones. Just like in the static case, the library behaves as an
  15. alias to a set of object files and dependency libraries, but in this
  16. case the object files are suitable for inclusion in shared libraries.
  17. """
  18. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
  19. ---
  20. libbloom/Makefile.am | 2 --
  21. libcork/Makefile.am | 2 --
  22. libipset/Makefile.am | 2 --
  23. 3 files changed, 6 deletions(-)
  24. diff --git a/libbloom/Makefile.am b/libbloom/Makefile.am
  25. index 17c0761..6b2eddd 100644
  26. --- a/libbloom/Makefile.am
  27. +++ b/libbloom/Makefile.am
  28. @@ -2,5 +2,3 @@ noinst_LTLIBRARIES = libbloom.la
  29. libbloom_la_SOURCES = bloom.c murmur2/MurmurHash2.c
  30. libbloom_la_CFLAGS = -I$(top_srcdir)/libbloom -I$(top_srcdir)/libbloom/murmur2
  31. -
  32. -libbloom_la_LDFLAGS = -static
  33. diff --git a/libcork/Makefile.am b/libcork/Makefile.am
  34. index 82ce062..e466a68 100644
  35. --- a/libcork/Makefile.am
  36. +++ b/libcork/Makefile.am
  37. @@ -17,5 +17,3 @@ endif
  38. libcork_la_SOURCES = $(cli_src) $(core_src) $(ds_src) $(pthreads_src) $(posix_src)
  39. libcork_la_CFLAGS = -I$(top_srcdir)/libcork/include -DCORK_API=CORK_LOCAL
  40. -
  41. -libcork_la_LDFLAGS = -static
  42. diff --git a/libipset/Makefile.am b/libipset/Makefile.am
  43. index 3edfde6..bee8493 100644
  44. --- a/libipset/Makefile.am
  45. +++ b/libipset/Makefile.am
  46. @@ -23,5 +23,3 @@ set_src = src/libipset/set/allocation.c \
  47. libipset_la_SOURCES = src/libipset/general.c ${bdd_src} ${map_src} ${set_src}
  48. libipset_la_CFLAGS = -I$(top_srcdir)/libipset/include -I$(top_srcdir)/libcork/include
  49. -
  50. -libipset_la_LDFLAGS = -static
  51. --
  52. 2.37.1