0002-wscript-fix-build-without-stack-protector.patch 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. From 0a3ce09c14eb9c7e36aa30a4dafe40e56676d678 Mon Sep 17 00:00:00 2001
  2. From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  3. Date: Fri, 24 Feb 2023 11:33:32 +0100
  4. Subject: [PATCH] wscript: fix build without stack-protector
  5. -fstack-protector-all can depends on ssp library availability (e.g. on musl) so
  6. move the test from cc_test_flags to ld_hardening_flags, this will avoid the
  7. following build failure:
  8. Checking for library ssp : not found
  9. Checking for library ssp_nonshared : not found
  10. Checking if C compiler supports -fstack-protector-all : yes
  11. [...]
  12. The configuration failed
  13. (complete log in /home/autobuild/autobuild/instance-2/output-1/build/ntpsec-1_2_2/build/config.log)
  14. Fixes:
  15. - http://autobuild.buildroot.org/results/f38abc6b7f8464836231192cfe078a5b27319a8a
  16. Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  17. [Upstream status: https://github.com/ntpsec/ntpsec/pull/6]
  18. ---
  19. wscript | 2 +-
  20. 1 file changed, 1 insertion(+), 1 deletion(-)
  21. diff --git a/wscript b/wscript
  22. index be396b33b..f301809fc 100644
  23. --- a/wscript
  24. +++ b/wscript
  25. @@ -298,7 +298,6 @@ def configure(ctx):
  26. ctx.env.LDFLAGS += ["-lssp_nonshared"]
  27. cc_test_flags = [
  28. - ('f_stack_protector_all', '-fstack-protector-all'),
  29. ('PIC', '-fPIC'),
  30. ('PIE', '-pie -fPIE'),
  31. # this quiets most of macOS warnings on -fpie
  32. @@ -332,6 +331,7 @@ def configure(ctx):
  33. # Check which linker flags are supported
  34. ld_hardening_flags = [
  35. + ('f_stack_protector_all', '-fstack-protector-all'),
  36. ("z_now", "-Wl,-z,now"), # no deferred symbol resolution
  37. ]
  38. --
  39. 2.39.1