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.

55 lines
2.1 KiB

  1. # --- SDE-COPYRIGHT-NOTE-BEGIN ---
  2. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  3. #
  4. # Filename: package/.../musl/pkg/gcc/0003-Turn-on-Wl-z-relro-z-now-by-default.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 a35a55940c3402f8ebb510ec7d8bc67e85051277 Mon Sep 17 00:00:00 2001
  17. From: Ariadne Conill <ariadne@dereferenced.org>
  18. Date: Fri, 21 Aug 2020 06:45:49 +0000
  19. Subject: [PATCH 03/30] Turn on -Wl,-z,relro,-z,now by default.
  20. ---
  21. gcc/doc/invoke.texi | 3 +++
  22. gcc/gcc.c | 1 +
  23. 2 files changed, 4 insertions(+)
  24. diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
  25. index dfed8fd25a8..ca56d52cb05 100644
  26. --- a/gcc/doc/invoke.texi
  27. +++ b/gcc/doc/invoke.texi
  28. @@ -14638,6 +14638,9 @@ For example, @option{-Wl,-Map,output.map} passes @option{-Map output.map} to the
  29. linker. When using the GNU linker, you can also get the same effect with
  30. @option{-Wl,-Map=output.map}.
  31. +NOTE: In Alpine Linux, for LDFLAGS, the option
  32. +@option{-Wl,-z,relro,now} is used. To disable, use @option{-Wl,-z,norelro}.
  33. +
  34. @item -u @var{symbol}
  35. @opindex u
  36. Pretend the symbol @var{symbol} is undefined, to force linking of
  37. diff --git a/gcc/gcc.c b/gcc/gcc.c
  38. index b2200c5185a..625c9ab7902 100644
  39. --- a/gcc/gcc.c
  40. +++ b/gcc/gcc.c
  41. @@ -1039,6 +1039,7 @@ proper position among the other output files. */
  42. "%{flto|flto=*:%<fcompare-debug*} \
  43. %{flto} %{fno-lto} %{flto=*} %l " LINK_PIE_SPEC \
  44. "%{fuse-ld=*:-fuse-ld=%*} " LINK_COMPRESS_DEBUG_SPEC \
  45. + "-z relro -z now " \
  46. "%X %{o*} %{e*} %{N} %{n} %{r}\
  47. %{s} %{t} %{u*} %{z} %{Z} %{!nostdlib:%{!r:%{!nostartfiles:%S}}} \
  48. %{Wno-poison-system-directories:--no-poison-system-directories} \
  49. --
  50. 2.27.0