git: 221dac0087ec - main - security/cryptlib: fix build on armv6/armv7

From: Robert Clausecker <fuz_at_FreeBSD.org>
Date: Thu, 20 Apr 2023 13:35:43 UTC
The branch main has been updated by fuz:

URL: https://cgit.FreeBSD.org/ports/commit/?id=221dac0087ec47c24c00074a6c66479cae9c227b

commit 221dac0087ec47c24c00074a6c66479cae9c227b
Author:     Robert Clausecker <fuz@FreeBSD.org>
AuthorDate: 2023-04-19 12:00:49 +0000
Commit:     Robert Clausecker <fuz@FreeBSD.org>
CommitDate: 2023-04-20 11:49:22 +0000

    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 f0c1781caf8f..ba77cf411fb5 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.