0001-configure.ac-add-disable-pie-option.patch 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. From cb20e19028a8996de9305502ba5e5da3bd1181bf Mon Sep 17 00:00:00 2001
  2. From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  3. Date: Tue, 2 Apr 2019 09:19:36 +0200
  4. Subject: [PATCH] configure.ac: add --disable-pie option
  5. PIE is not necessarily supported on all architectures, so add an option
  6. to allow the user to disable the PIE.
  7. This fixes the build on the m68k architecture:
  8. - http://autobuild.buildroot.org/results/25985bbc160e3d62b23c4c613b2a81f3711621e3
  9. Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  10. [Upstream status: merged]
  11. ---
  12. Makefile.am | 2 +-
  13. configure.ac | 12 ++++++++++++
  14. 2 files changed, 13 insertions(+), 1 deletion(-)
  15. diff --git a/Makefile.am b/Makefile.am
  16. index 638198d..332bd67 100644
  17. --- a/Makefile.am
  18. +++ b/Makefile.am
  19. @@ -1,5 +1,5 @@
  20. ACLOCAL_AMFLAGS = -I m4
  21. -AM_LDFLAGS = -pie
  22. +AM_LDFLAGS = @PIE_LDFLAGS@
  23. doc_DATA = \
  24. README.mailserver \
  25. diff --git a/configure.ac b/configure.ac
  26. index 095ff86..5af4235 100644
  27. --- a/configure.ac
  28. +++ b/configure.ac
  29. @@ -55,6 +55,18 @@ AS_IF([test "x${prefix}" = "xNONE"], [
  30. AC_DEFINE_UNQUOTED(PACKAGE_LOCALE_DIR, "${prefix}/share/locale", [Locale-specific data directory])
  31. ])
  32. +# ================
  33. +# Check for ldflags
  34. +# ================
  35. +AC_ARG_ENABLE([pie],
  36. + [AS_HELP_STRING([--disable-pie], [Disable Position Independent Executable])],
  37. + [enable_pie="$enableval"],
  38. + [enable_pie=yes]
  39. +)
  40. +AS_IF([test x"$enable_pie" != "xno"], [
  41. + PIE_LDFLAGS="-pie"
  42. +])
  43. +AC_SUBST([PIE_LDFLAGS])
  44. # ================
  45. # Check for cflags
  46. --
  47. 2.14.1