git: 7e3e70ce214d - main - libicp: Link with -z noexecstack for ld.bfd.

From: John Baldwin <jhb_at_FreeBSD.org>
Date: Tue, 22 Nov 2022 16:37:49 UTC
The branch main has been updated by jhb:

URL: https://cgit.FreeBSD.org/src/commit/?id=7e3e70ce214d042e202828b0665904840928a002

commit 7e3e70ce214d042e202828b0665904840928a002
Author:     John Baldwin <jhb@FreeBSD.org>
AuthorDate: 2022-11-22 16:37:12 +0000
Commit:     John Baldwin <jhb@FreeBSD.org>
CommitDate: 2022-11-22 16:37:12 +0000

    libicp: Link with -z noexecstack for ld.bfd.
    
    The assembly source files do not contain GNU-stack annotations, so
    ld.bfd defaults to using an executable stack.
---
 cddl/lib/libicp/Makefile        | 2 ++
 cddl/lib/libicp_rescue/Makefile | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/cddl/lib/libicp/Makefile b/cddl/lib/libicp/Makefile
index 4fc17916d1df..d00a47f2529a 100644
--- a/cddl/lib/libicp/Makefile
+++ b/cddl/lib/libicp/Makefile
@@ -116,4 +116,6 @@ CFLAGS.b3_ppc64le_sse2.S = -DLOCORE
 CFLAGS.b3_ppc64le_sse41.S = -DLOCORE
 
 
+LDFLAGS.bfd+= -Wl,-znoexecstack
+
 .include <bsd.lib.mk>
diff --git a/cddl/lib/libicp_rescue/Makefile b/cddl/lib/libicp_rescue/Makefile
index 1237b1b05edf..6c6c3998f85c 100644
--- a/cddl/lib/libicp_rescue/Makefile
+++ b/cddl/lib/libicp_rescue/Makefile
@@ -109,4 +109,6 @@ CFLAGS.b3_ppc64le_sse2.S = -DLOCORE
 CFLAGS.b3_ppc64le_sse41.S = -DLOCORE
 
 
+LDFLAGS.bfd+= -Wl,-znoexecstack
+
 .include <bsd.lib.mk>