From 221dac0087ec47c24c00074a6c66479cae9c227b Mon Sep 17 00:00:00 2001 From: Robert Clausecker Date: Wed, 19 Apr 2023 14:00:49 +0200 Subject: [PATCH] security/cryptlib: fix build on armv6/armv7 The clang option -fsanitize=safe-stack is not supported on armv6/armv7. Patch the option detection script to not enable it there. Approved by: portmgr (build fix blanket) --- security/cryptlib/files/patch-tools_ccopts.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/security/cryptlib/files/patch-tools_ccopts.sh b/security/cryptlib/files/patch-tools_ccopts.sh index f0c1781caf8f5..ba77cf411fb55 100644 --- a/security/cryptlib/files/patch-tools_ccopts.sh +++ b/security/cryptlib/files/patch-tools_ccopts.sh @@ -1,5 +1,14 @@ --- tools/ccopts.sh.orig 2021-10-21 02:27:26 UTC +++ tools/ccopts.sh +@@ -675,7 +675,7 @@ hasSafeStackLibs() + + if [ $ISCLANG -gt 0 ] && [ $ISSPECIAL -eq 0 ] ; then + if [ $COMPILER_VER -ge 47 ] ; then +- if [ "$OSNAME" = "Darwin" ] || [ "$OSNAME" = "OpenBSD" ] ; then ++ if [ "$OSNAME" = "Darwin" ] || [ "$OSNAME" = "OpenBSD" ] || [ "$OSNAME" = "FreeBSD" -a "$ARCH" = "arm" ] ; then + # The versions of clang shipped with OS X or OpenBSD don't + # support -fsanitize=safe-stack even as late as clang 12, so + # there's not much that we can do. @@ -892,31 +892,6 @@ fi # a big deal. As a convenient side-effect, this also enables the use of # ASLR where it's supported.