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.

69 lines
2.6 KiB

  1. # --- SDE-COPYRIGHT-NOTE-BEGIN ---
  2. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  3. #
  4. # Filename: package/.../musl/pkg/gcc/0008-Disable-ssp-on-nostdlib-nodefaultlibs-and-ffreestand.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 23fd86ff34670873dd294bd87b93f45c3624903a Mon Sep 17 00:00:00 2001
  17. From: Ariadne Conill <ariadne@dereferenced.org>
  18. Date: Fri, 21 Aug 2020 06:49:40 +0000
  19. Subject: [PATCH 08/30] Disable ssp on -nostdlib, -nodefaultlibs and
  20. -ffreestanding Change the buffer size.
  21. ---
  22. gcc/gcc.c | 8 +++++++-
  23. gcc/params.opt | 2 +-
  24. 2 files changed, 8 insertions(+), 2 deletions(-)
  25. diff --git a/gcc/gcc.c b/gcc/gcc.c
  26. index 7aec9d3a016..daeb4d0c8ea 100644
  27. --- a/gcc/gcc.c
  28. +++ b/gcc/gcc.c
  29. @@ -886,6 +886,12 @@ proper position among the other output files. */
  30. #define LINK_GCC_C_SEQUENCE_SPEC "%G %{!nolibc:%L %G}"
  31. #endif
  32. +#ifdef ENABLE_DEFAULT_SSP
  33. +#define NO_SSP_SPEC "%{nostdlib|nodefaultlibs|ffreestanding:-fno-stack-protector} "
  34. +#else
  35. +#define NO_SSP_SPEC ""
  36. +#endif
  37. +
  38. #ifndef LINK_SSP_SPEC
  39. #ifdef TARGET_LIBC_PROVIDES_SSP
  40. #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
  41. @@ -1170,7 +1176,7 @@ static const char *cc1_options =
  42. %{-version:--version}\
  43. %{-help=*:--help=%*}\
  44. %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %b.s}}}\
  45. - %{fsyntax-only:-o %j} %{-param*}\
  46. + %{fsyntax-only:-o %j} %{-param*} " NO_SSP_SPEC "\
  47. %{coverage:-fprofile-arcs -ftest-coverage}\
  48. %{fprofile-arcs|fprofile-generate*|coverage:\
  49. %{!fprofile-update=single:\
  50. diff --git a/gcc/params.opt b/gcc/params.opt
  51. index 4aec480798b..eaecfab37ad 100644
  52. --- a/gcc/params.opt
  53. +++ b/gcc/params.opt
  54. @@ -853,7 +853,7 @@ Common Joined UInteger Var(param_ssa_name_def_chain_limit) Init(512) Param Optim
  55. The maximum number of SSA_NAME assignments to follow in determining a value.
  56. -param=ssp-buffer-size=
  57. -Common Joined UInteger Var(param_ssp_buffer_size) Init(8) IntegerRange(1, 65536) Param Optimization
  58. +Common Joined UInteger Var(param_ssp_buffer_size) Init(4) IntegerRange(1, 65536) Param Optimization
  59. The lower bound for a buffer to be considered for stack smashing protection.
  60. -param=stack-clash-protection-guard-size=
  61. --
  62. 2.27.0