pkgsrc-Changes archive

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

CVS commit: pkgsrc/mk



Module Name:    pkgsrc
Committed By:   nia
Date:           Tue Nov  2 08:14:59 UTC 2021

Modified Files:
        pkgsrc/mk: bsd.prefs.mk
        pkgsrc/mk/compiler: clang.mk gcc.mk

Log Message:
mk: Make it possible for a package to fall back to partial RELRO.

This helps certain X.Org modules.


To generate a diff of this commit:
cvs rdiff -u -r1.409 -r1.410 pkgsrc/mk/bsd.prefs.mk
cvs rdiff -u -r1.28 -r1.29 pkgsrc/mk/compiler/clang.mk
cvs rdiff -u -r1.229 -r1.230 pkgsrc/mk/compiler/gcc.mk

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/mk/bsd.prefs.mk
diff -u pkgsrc/mk/bsd.prefs.mk:1.409 pkgsrc/mk/bsd.prefs.mk:1.410
--- pkgsrc/mk/bsd.prefs.mk:1.409        Fri Jul  2 12:03:24 2021
+++ pkgsrc/mk/bsd.prefs.mk      Tue Nov  2 08:14:58 2021
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.prefs.mk,v 1.409 2021/07/02 12:03:24 nia Exp $
+# $NetBSD: bsd.prefs.mk,v 1.410 2021/11/02 08:14:58 nia Exp $
 #
 # This file includes the mk.conf file, which contains the user settings.
 #
@@ -749,7 +749,7 @@ _PKGSRC_USE_FORTIFY=        yes
 #
 _PKGSRC_USE_RELRO=     no
 .if ${PKGSRC_USE_RELRO:tl} != "no" && \
-    ${RELRO_SUPPORTED:Uyes:tl} == "yes" && \
+    ${RELRO_SUPPORTED:Uyes:tl} != "no" && \
     ${_OPSYS_SUPPORTS_RELRO:Uno} == "yes"
 _PKGSRC_USE_RELRO=     yes
 .endif

Index: pkgsrc/mk/compiler/clang.mk
diff -u pkgsrc/mk/compiler/clang.mk:1.28 pkgsrc/mk/compiler/clang.mk:1.29
--- pkgsrc/mk/compiler/clang.mk:1.28    Mon Oct  4 14:21:21 2021
+++ pkgsrc/mk/compiler/clang.mk Tue Nov  2 08:14:58 2021
@@ -1,4 +1,4 @@
-# $NetBSD: clang.mk,v 1.28 2021/10/04 14:21:21 nia Exp $
+# $NetBSD: clang.mk,v 1.29 2021/11/02 08:14:58 nia Exp $
 #
 # This is the compiler definition for the clang compiler.
 #
@@ -55,11 +55,12 @@ _COMPILER_RPATH_FLAG=       ${_COMPILER_LD_FLA
 
 _CTF_CFLAGS=           -gdwarf-2
 
-# The user can choose the level of RELRO.
-.if ${PKGSRC_USE_RELRO} == "partial"
-_RELRO_LDFLAGS=                -Wl,-zrelro
-.else
+# The user or package can choose the level of RELRO.
+.if ${PKGSRC_USE_RELRO} != "partial" && \
+    ${RELRO_SUPPORTED:Uyes:tl} != "partial"
 _RELRO_LDFLAGS=                -Wl,-zrelro -Wl,-znow
+.else
+_RELRO_LDFLAGS=                -Wl,-zrelro
 .endif
 
 # The user can choose the level of stack smashing protection.

Index: pkgsrc/mk/compiler/gcc.mk
diff -u pkgsrc/mk/compiler/gcc.mk:1.229 pkgsrc/mk/compiler/gcc.mk:1.230
--- pkgsrc/mk/compiler/gcc.mk:1.229     Fri Oct  8 16:35:57 2021
+++ pkgsrc/mk/compiler/gcc.mk   Tue Nov  2 08:14:58 2021
@@ -1,4 +1,4 @@
-# $NetBSD: gcc.mk,v 1.229 2021/10/08 16:35:57 nia Exp $
+# $NetBSD: gcc.mk,v 1.230 2021/11/02 08:14:58 nia Exp $
 #
 # This is the compiler definition for the GNU Compiler Collection.
 #
@@ -385,11 +385,12 @@ _GCC_CFLAGS+=             ${_FORTIFY_CFLAGS}
 CWRAPPERS_APPEND.cc+=  ${_FORTIFY_CFLAGS}
 .endif
 
-# The user can choose the level of RELRO.
-.if ${PKGSRC_USE_RELRO} == "partial"
-_RELRO_LDFLAGS=                -Wl,-zrelro
-.else
+# The user or package can choose the level of RELRO.
+.if ${PKGSRC_USE_RELRO} != "partial" && \
+    ${RELRO_SUPPORTED:Uyes:tl} != "partial"
 _RELRO_LDFLAGS=                -Wl,-zrelro -Wl,-znow
+.else
+_RELRO_LDFLAGS=                -Wl,-zrelro
 .endif
 
 _STACK_CHECK_CFLAGS=   -fstack-check



Home | Main Index | Thread Index | Old Index