pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/mk/compiler mk: work around binutils 2.39 problem with...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/99567ef20a7a
branches:  trunk
changeset: 390836:99567ef20a7a
user:      wiz <wiz%pkgsrc.org@localhost>
date:      Sat Dec 31 08:35:37 2022 +0000

description:
mk: work around binutils 2.39 problem with relro on NetBSD

diffstat:

 mk/compiler/clang.mk |  10 ++++++++--
 mk/compiler/gcc.mk   |   8 +++++++-
 2 files changed, 15 insertions(+), 3 deletions(-)

diffs (53 lines):

diff -r dad085aff245 -r 99567ef20a7a mk/compiler/clang.mk
--- a/mk/compiler/clang.mk      Sat Dec 31 06:02:44 2022 +0000
+++ b/mk/compiler/clang.mk      Sat Dec 31 08:35:37 2022 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: clang.mk,v 1.37 2022/07/07 17:19:55 jperkin Exp $
+# $NetBSD: clang.mk,v 1.38 2022/12/31 08:35:37 wiz Exp $
 #
 # This is the compiler definition for the clang compiler.
 #
@@ -41,7 +41,7 @@
 
 .if exists(${CCPATH})
 CC_VERSION_STRING!=    ${CCPATH} -v 2>&1
-CC_VERSION!=           ${CCPATH} --version 2>&1 | ${SED} -n "s/^.* version /clang-/p" 
+CC_VERSION!=           ${CCPATH} --version 2>&1 | ${SED} -n "s/^.* version /clang-/p"
 .else
 CC_VERSION_STRING?=    ${CC_VERSION}
 CC_VERSION?=           clang
@@ -62,6 +62,12 @@
 .else
 _RELRO_LDFLAGS=                -Wl,-zrelro
 .endif
+# XXX Workaround for https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1014301
+# Set manually the maxpagesize to 4096 which is ok for now since NetBSD only
+# supports relro by default on x86 and aarch64
+.if ${OPSYS} == "NetBSD" && ${OPSYS_VERSION} > 109901
+_RELRO_LDFLAGS+=       -Wl,-z,max-page-size=4096
+.endif
 
 # The user can choose the level of stack smashing protection.
 .if ${PKGSRC_USE_SSP} == "all"
diff -r dad085aff245 -r 99567ef20a7a mk/compiler/gcc.mk
--- a/mk/compiler/gcc.mk        Sat Dec 31 06:02:44 2022 +0000
+++ b/mk/compiler/gcc.mk        Sat Dec 31 08:35:37 2022 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: gcc.mk,v 1.247 2022/11/23 15:44:11 jperkin Exp $
+# $NetBSD: gcc.mk,v 1.248 2022/12/31 08:35:37 wiz Exp $
 #
 # This is the compiler definition for the GNU Compiler Collection.
 #
@@ -444,6 +444,12 @@
 .else
 _RELRO_LDFLAGS=                -Wl,-zrelro
 .endif
+# XXX Workaround for https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1014301
+# Set manually the maxpagesize to 4096 which is ok for now since NetBSD only
+# supports relro by default on x86 and aarch64
+.if ${OPSYS} == "NetBSD" && ${OPSYS_VERSION} > 109901
+_RELRO_LDFLAGS+=       -Wl,-z,max-page-size=4096
+.endif
 
 .if !empty(_RELRO_LDFLAGS) && !empty(MACHINE_PLATFORM:MNetBSD-*-*mips*)
 _RELRO_LDFLAGS+=       -Wl,-z,common-page-size=0x10000



Home | Main Index | Thread Index | Old Index