hardening-defaults.patch 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. commit 76e7d81ba1c1beb98e43a376e6dcb2839e22d254
  2. Author: q66 <q66@chimera-linux.org>
  3. Date: Sat Mar 4 23:47:13 2023 +0000
  4. remove hardening flags that are a part of our toolchain
  5. This is so we can control it better.
  6. diff --git a/build/moz.configure/toolchain.configure b/build/moz.configure/toolchain.configure
  7. index 826ae54..1a7a054 100755
  8. --- a/build/moz.configure/toolchain.configure
  9. +++ b/build/moz.configure/toolchain.configure
  10. @@ -2156,32 +2156,6 @@ def security_hardening_cflags(
  11. # ----------------------------------------------------------
  12. # If hardening is explicitly enabled, or not explicitly disabled
  13. if hardening_flag.origin == "default" or hardening_flag:
  14. - # FORTIFY_SOURCE ------------------------------------
  15. - # Require optimization for FORTIFY_SOURCE. See Bug 1417452
  16. - # Also, undefine it before defining it just in case a distro adds it, see Bug 1418398
  17. - if compiler_is_gccish and optimize and not asan:
  18. - flags.append("-U_FORTIFY_SOURCE")
  19. - flags.append("-D_FORTIFY_SOURCE=2")
  20. - if mingw_clang:
  21. - # mingw-clang needs to link in ssp which is not done by default
  22. - ldflags.append("-lssp")
  23. -
  24. - # fstack-protector ------------------------------------
  25. - # Enable only if hardening is not disabled and ASAN is
  26. - # not on as ASAN will catch the crashes for us
  27. - if compiler_is_gccish and not asan:
  28. - flags.append("-fstack-protector-strong")
  29. - ldflags.append("-fstack-protector-strong")
  30. -
  31. - if (
  32. - c_compiler.type == "clang"
  33. - and c_compiler.version >= "11.0.1"
  34. - and target.os not in ("WINNT", "OSX")
  35. - and target.cpu in ("x86", "x86_64", "ppc64", "s390x")
  36. - ):
  37. - flags.append("-fstack-clash-protection")
  38. - ldflags.append("-fstack-clash-protection")
  39. -
  40. # ftrivial-auto-var-init ------------------------------
  41. # Initialize local variables with a 0xAA pattern in clang builds.
  42. # Linux32 fails some xpcshell tests with -ftrivial-auto-var-init