Source-Changes-HG archive

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

[src/trunk]: src/share/mk mk: Add support for conditional compilation of part...



details:   https://anonhg.NetBSD.org/src/rev/47366857e3cb
branches:  trunk
changeset: 1024731:47366857e3cb
user:      nia <nia%NetBSD.org@localhost>
date:      Mon Nov 01 10:05:18 2021 +0000

description:
mk: Add support for conditional compilation of parts of the tree with
partial RELRO when MKRELRO=full is set.

Currently the X server needs to be compiled with only partial RELRO
due to the way certain (but not all - it seems wsfb works with full
RELRO) graphics driver modules are loaded.

diffstat:

 external/mit/xorg/server/drivers/Makefile.xf86-driver       |  4 +++-
 external/mit/xorg/server/xorg-server.old/Makefile.Xserver   |  5 ++++-
 external/mit/xorg/server/xorg-server.old/Makefile.serverlib |  4 +++-
 external/mit/xorg/server/xorg-server.old/Makefile.servermod |  4 +++-
 external/mit/xorg/server/xorg-server/Makefile.Xserver       |  5 ++++-
 external/mit/xorg/server/xorg-server/Makefile.serverlib     |  4 +++-
 external/mit/xorg/server/xorg-server/Makefile.servermod     |  4 +++-
 share/mk/bsd.README                                         |  5 ++++-
 share/mk/bsd.sys.mk                                         |  5 +++--
 9 files changed, 30 insertions(+), 10 deletions(-)

diffs (135 lines):

diff -r 641529721997 -r 47366857e3cb external/mit/xorg/server/drivers/Makefile.xf86-driver
--- a/external/mit/xorg/server/drivers/Makefile.xf86-driver     Mon Nov 01 08:53:40 2021 +0000
+++ b/external/mit/xorg/server/drivers/Makefile.xf86-driver     Mon Nov 01 10:05:18 2021 +0000
@@ -1,8 +1,10 @@
-#      $NetBSD: Makefile.xf86-driver,v 1.28 2021/05/31 21:45:41 joerg Exp $
+#      $NetBSD: Makefile.xf86-driver,v 1.29 2021/11/01 10:05:18 nia Exp $
 
 LIBISMODULE=   yes
 SHLIB_MAJOR=   ${PACKAGE_MAJOR}
 
+NOFULLRELRO=   yes
+
 .include <bsd.own.mk>
 .include <bsd.x11.mk>
 
diff -r 641529721997 -r 47366857e3cb external/mit/xorg/server/xorg-server.old/Makefile.Xserver
--- a/external/mit/xorg/server/xorg-server.old/Makefile.Xserver Mon Nov 01 08:53:40 2021 +0000
+++ b/external/mit/xorg/server/xorg-server.old/Makefile.Xserver Mon Nov 01 10:05:18 2021 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile.Xserver,v 1.2 2019/03/08 10:00:06 mrg Exp $
+#      $NetBSD: Makefile.Xserver,v 1.3 2021/11/01 10:05:19 nia Exp $
 
 .for _SL in \
        mi \
@@ -73,6 +73,9 @@
 LDADD.XORG_CORE=       ${LDADD.dix} ${LDADD.config}
 DPADD.XORG_CORE=       ${DPADD.dix} ${DPADD.config}
 
+# X servers cannot load certain modules when built with BIND_NOW
+NOFULLRELRO=   yes
+
 # X servers need all symbols exported
 LDFLAGS+=      -Wl,--export-dynamic
 
diff -r 641529721997 -r 47366857e3cb external/mit/xorg/server/xorg-server.old/Makefile.serverlib
--- a/external/mit/xorg/server/xorg-server.old/Makefile.serverlib       Mon Nov 01 08:53:40 2021 +0000
+++ b/external/mit/xorg/server/xorg-server.old/Makefile.serverlib       Mon Nov 01 10:05:18 2021 +0000
@@ -1,4 +1,6 @@
-#      $NetBSD: Makefile.serverlib,v 1.4 2021/05/03 08:44:05 nakayama Exp $
+#      $NetBSD: Makefile.serverlib,v 1.5 2021/11/01 10:05:19 nia Exp $
+
+NOFULLRELRO=   yes
 
 .include <bsd.own.mk>          # for NETBSDSRCDIR and mk.conf processing
 
diff -r 641529721997 -r 47366857e3cb external/mit/xorg/server/xorg-server.old/Makefile.servermod
--- a/external/mit/xorg/server/xorg-server.old/Makefile.servermod       Mon Nov 01 08:53:40 2021 +0000
+++ b/external/mit/xorg/server/xorg-server.old/Makefile.servermod       Mon Nov 01 10:05:18 2021 +0000
@@ -1,4 +1,6 @@
-#      $NetBSD: Makefile.servermod,v 1.4 2021/05/03 08:44:05 nakayama Exp $
+#      $NetBSD: Makefile.servermod,v 1.5 2021/11/01 10:05:19 nia Exp $
+
+NOFULLRELRO=   yes
 
 .include <bsd.own.mk>  # For /etc/mk.conf processing
 
diff -r 641529721997 -r 47366857e3cb external/mit/xorg/server/xorg-server/Makefile.Xserver
--- a/external/mit/xorg/server/xorg-server/Makefile.Xserver     Mon Nov 01 08:53:40 2021 +0000
+++ b/external/mit/xorg/server/xorg-server/Makefile.Xserver     Mon Nov 01 10:05:18 2021 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile.Xserver,v 1.22 2019/01/18 23:05:30 mrg Exp $
+#      $NetBSD: Makefile.Xserver,v 1.23 2021/11/01 10:05:19 nia Exp $
 
 .for _SL in \
        mi \
@@ -63,6 +63,9 @@
 LDADD.XORG_CORE=       ${LDADD.dix} ${LDADD.config}
 DPADD.XORG_CORE=       ${DPADD.dix} ${DPADD.config}
 
+# X servers cannot load certain modules when built with BIND_NOW
+NOFULLRELRO=   yes
+
 # X servers need all symbols exported
 LDFLAGS+=      -Wl,--export-dynamic
 
diff -r 641529721997 -r 47366857e3cb external/mit/xorg/server/xorg-server/Makefile.serverlib
--- a/external/mit/xorg/server/xorg-server/Makefile.serverlib   Mon Nov 01 08:53:40 2021 +0000
+++ b/external/mit/xorg/server/xorg-server/Makefile.serverlib   Mon Nov 01 10:05:18 2021 +0000
@@ -1,4 +1,6 @@
-#      $NetBSD: Makefile.serverlib,v 1.13 2021/04/12 03:57:06 mrg Exp $
+#      $NetBSD: Makefile.serverlib,v 1.14 2021/11/01 10:05:19 nia Exp $
+
+NOFULLRELRO=   yes
 
 .include <bsd.own.mk>          # for NETBSDSRCDIR and mk.conf processing
 
diff -r 641529721997 -r 47366857e3cb external/mit/xorg/server/xorg-server/Makefile.servermod
--- a/external/mit/xorg/server/xorg-server/Makefile.servermod   Mon Nov 01 08:53:40 2021 +0000
+++ b/external/mit/xorg/server/xorg-server/Makefile.servermod   Mon Nov 01 10:05:18 2021 +0000
@@ -1,4 +1,6 @@
-#      $NetBSD: Makefile.servermod,v 1.6 2021/04/12 03:57:06 mrg Exp $
+#      $NetBSD: Makefile.servermod,v 1.7 2021/11/01 10:05:19 nia Exp $
+
+NOFULLRELRO=   yes
 
 .include <bsd.own.mk>  # For /etc/mk.conf processing
 
diff -r 641529721997 -r 47366857e3cb share/mk/bsd.README
--- a/share/mk/bsd.README       Mon Nov 01 08:53:40 2021 +0000
+++ b/share/mk/bsd.README       Mon Nov 01 10:05:18 2021 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: bsd.README,v 1.421 2021/10/27 03:06:59 ryo Exp $
+#      $NetBSD: bsd.README,v 1.422 2021/11/01 10:05:19 nia Exp $
 #      @(#)bsd.README  8.2 (Berkeley) 4/2/94
 
 This is the README file for the make "include" files for the NetBSD
@@ -438,6 +438,9 @@
                also force immediate symbol binding.
                Default: no
 
+NOFULLRELRO    Don't compile with immediate symbol binding during build.
+               It is set internally for standalone programs.
+
 MKREPRO         If "yes", create reproducible builds. This enables
                different switches to make two builds from the same source tree
                result in the same build results.
diff -r 641529721997 -r 47366857e3cb share/mk/bsd.sys.mk
--- a/share/mk/bsd.sys.mk       Mon Nov 01 08:53:40 2021 +0000
+++ b/share/mk/bsd.sys.mk       Mon Nov 01 10:05:18 2021 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: bsd.sys.mk,v 1.307 2021/09/11 21:30:46 andvar Exp $
+#      $NetBSD: bsd.sys.mk,v 1.308 2021/11/01 10:05:19 nia Exp $
 #
 # Build definitions used for NetBSD source tree builds.
 
@@ -140,7 +140,8 @@
 .if ${MKRELRO:Uno} != "no"
 LDFLAGS+=      -Wl,-z,relro
 .endif
-.if ${MKRELRO:Uno} == "full"
+
+.if ${MKRELRO:Uno} == "full" && ${NOFULLRELRO:Uno} == "no"
 LDFLAGS+=      -Wl,-z,now
 .endif
 



Home | Main Index | Thread Index | Old Index