OpenSDE Packages Database (without history before r20070)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

91 lines
2.7 KiB

  1. # --- SDE-COPYRIGHT-NOTE-BEGIN ---
  2. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  3. #
  4. # Filename: package/.../musl/pkg/gcc/0014-nopie.patch
  5. # Copyright (C) 2020 The OpenSDE Project
  6. #
  7. # More information can be found in the files COPYING and README.
  8. #
  9. # This patch file is dual-licensed. It is available under the license the
  10. # patched project is licensed under, as long as it is an OpenSource license
  11. # as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
  12. # of the GNU General Public License as published by the Free Software
  13. # Foundation; either version 2 of the License, or (at your option) any later
  14. # version.
  15. # --- SDE-COPYRIGHT-NOTE-END ---
  16. From f64f853eae3b390adbbc9b74a336d93918e6dca4 Mon Sep 17 00:00:00 2001
  17. From: Szabolcs Nagy <nsz@port70.net>
  18. Date: Sat, 7 Nov 2015 02:08:05 +0000
  19. Subject: [PATCH 14/30] nopie
  20. ---
  21. gcc/configure | 27 +++++++++++++++++++++++++++
  22. gcc/configure.ac | 13 +++++++++++++
  23. 2 files changed, 40 insertions(+)
  24. diff --git a/gcc/configure b/gcc/configure
  25. index 90e3be864f8..951a093b459 100755
  26. --- a/gcc/configure
  27. +++ b/gcc/configure
  28. @@ -30774,6 +30774,33 @@ fi
  29. $as_echo "$gcc_cv_no_pie" >&6; }
  30. if test "$gcc_cv_no_pie" = "yes"; then
  31. NO_PIE_FLAG="-no-pie"
  32. +else
  33. + # Check if -nopie works.
  34. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -nopie option" >&5
  35. +$as_echo_n "checking for -nopie option... " >&6; }
  36. +if test "${gcc_cv_nopie+set}" = set; then :
  37. + $as_echo_n "(cached) " >&6
  38. +else
  39. + saved_LDFLAGS="$LDFLAGS"
  40. + LDFLAGS="$LDFLAGS -nopie"
  41. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext
  42. +/* end confdefs.h. */
  43. +int main(void) {return 0;}
  44. +_ACEOF
  45. +if ac_fn_cxx_try_link "$LINENO"; then :
  46. + gcc_cv_nopie=yes
  47. +else
  48. + gcc_cv_nopie=no
  49. +fi
  50. +rm -f core conftest.err conftest.$ac_objext \
  51. + conftest$ac_exeext conftest.$ac_ext
  52. + LDFLAGS="$saved_LDFLAGS"
  53. +fi
  54. +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_nopie" >&5
  55. +$as_echo "$gcc_cv_nopie" >&6; }
  56. + if test "$gcc_cv_nopie" = "yes"; then
  57. + NO_PIE_FLAG="-nopie"
  58. + fi
  59. fi
  60. diff --git a/gcc/configure.ac b/gcc/configure.ac
  61. index f42006e5476..fe392298016 100644
  62. --- a/gcc/configure.ac
  63. +++ b/gcc/configure.ac
  64. @@ -6858,6 +6858,19 @@ AC_CACHE_CHECK([for -no-pie option],
  65. LDFLAGS="$saved_LDFLAGS"])
  66. if test "$gcc_cv_no_pie" = "yes"; then
  67. NO_PIE_FLAG="-no-pie"
  68. +else
  69. + # Check if -nopie works.
  70. + AC_CACHE_CHECK([for -nopie option],
  71. + [gcc_cv_nopie],
  72. + [saved_LDFLAGS="$LDFLAGS"
  73. + LDFLAGS="$LDFLAGS -nopie"
  74. + AC_LINK_IFELSE([int main(void) {return 0;}],
  75. + [gcc_cv_nopie=yes],
  76. + [gcc_cv_nopie=no])
  77. + LDFLAGS="$saved_LDFLAGS"])
  78. + if test "$gcc_cv_nopie" = "yes"; then
  79. + NO_PIE_FLAG="-nopie"
  80. + fi
  81. fi
  82. AC_SUBST([NO_PIE_FLAG])
  83. --
  84. 2.27.0