Module Name:    src
Committed By:   martin
Date:           Tue Feb 14 15:47:02 UTC 2023

Modified Files:
        src/external/gpl3/gdb [netbsd-10]: Makefile.inc
        src/external/gpl3/gdb.old [netbsd-10]: Makefile.inc
        src/external/mit/xorg/lib/gallium [netbsd-10]: Makefile
        src/external/mit/xorg/lib/gallium.old [netbsd-10]: Makefile
        src/share/mk [netbsd-10]: bsd.lib.mk

Log Message:
Pull up following revision(s) (requested by mrg in ticket #81):

        external/gpl3/gdb.old/Makefile.inc: revision 1.12
        share/mk/bsd.lib.mk: revision 1.390
        external/gpl3/gdb/Makefile.inc: revision 1.13
        external/mit/xorg/lib/gallium.old/Makefile: revision 1.5
        external/mit/xorg/lib/gallium/Makefile: revision 1.49

fix code attempting to skip adding "-g" if "-g*" already is used.

in bsd.lib.mk there's a check for "MKDEBUG != no" that will add
-g to CFLAGS (maybe) and to CSHLIBFLAGS (always), given that it
isn't in CFLAGS already.. except the conditional is "||" instead
of "&&" and since the MKDEBUG/NODEBUG checks pass, the CFLAGS
check isn't even performed.

additionally, check CXXFLAGS as well as CFLAGS.

this fixes the attempt to use "-g1" in the llvmrt build, which
fails because the compile lines end up being "... -g1 .. -g ..",
(the "-g" comes from the CSHLIBFLAGS variable in that case.)
this reduces the size of llvm-enabled gallium debug by ~1.5GiB
on amd64.

apply -g1 to the gallium sources as well.  saves another couple of 100MB.

apply -g1 to the gdb build as well.
reduces the size of gdb.debug and gdbtui.debug by 100MB each on amd64,
and about 70MB total in the debug set.  (across all builds, this may
be in the order of 3-4GB in releasedir output.)


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.12.6.1 src/external/gpl3/gdb/Makefile.inc
cvs rdiff -u -r1.11 -r1.11.6.1 src/external/gpl3/gdb.old/Makefile.inc
cvs rdiff -u -r1.48 -r1.48.2.1 src/external/mit/xorg/lib/gallium/Makefile
cvs rdiff -u -r1.4 -r1.4.2.1 src/external/mit/xorg/lib/gallium.old/Makefile
cvs rdiff -u -r1.389 -r1.389.2.1 src/share/mk/bsd.lib.mk

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

Modified files:

Index: src/external/gpl3/gdb/Makefile.inc
diff -u src/external/gpl3/gdb/Makefile.inc:1.12 src/external/gpl3/gdb/Makefile.inc:1.12.6.1
--- src/external/gpl3/gdb/Makefile.inc:1.12	Tue Apr 13 01:11:05 2021
+++ src/external/gpl3/gdb/Makefile.inc	Tue Feb 14 15:47:01 2023
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.inc,v 1.12 2021/04/13 01:11:05 mrg Exp $
+# $NetBSD: Makefile.inc,v 1.12.6.1 2023/02/14 15:47:01 martin Exp $
 
 USE_LIBEDIT=no
 USE_TUI=yes
@@ -17,3 +17,8 @@ CWARNFLAGS.clang+=	-Wno-unused-value -Wn
 COPTS+=			-fcommon
 
 DIST:=		${.PARSEDIR}/dist
+
+# Reduce debugging for these extremely large objects.
+.if ${MKDEBUG:Uno} != "no"
+CXXFLAGS+=      -g1
+.endif

Index: src/external/gpl3/gdb.old/Makefile.inc
diff -u src/external/gpl3/gdb.old/Makefile.inc:1.11 src/external/gpl3/gdb.old/Makefile.inc:1.11.6.1
--- src/external/gpl3/gdb.old/Makefile.inc:1.11	Mon Sep 14 00:39:47 2020
+++ src/external/gpl3/gdb.old/Makefile.inc	Tue Feb 14 15:47:01 2023
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.inc,v 1.11 2020/09/14 00:39:47 christos Exp $
+# $NetBSD: Makefile.inc,v 1.11.6.1 2023/02/14 15:47:01 martin Exp $
 
 USE_LIBEDIT=no
 USE_TUI=yes
@@ -15,3 +15,8 @@ CWARNFLAGS.clang+=	-Wno-unused-value -Wn
 			-Wno-string-plus-int
 
 DIST:=		${.PARSEDIR}/dist
+
+# Reduce debugging for these extremely large objects.
+.if ${MKDEBUG:Uno} != "no"
+CXXFLAGS+=      -g1
+.endif

Index: src/external/mit/xorg/lib/gallium/Makefile
diff -u src/external/mit/xorg/lib/gallium/Makefile:1.48 src/external/mit/xorg/lib/gallium/Makefile:1.48.2.1
--- src/external/mit/xorg/lib/gallium/Makefile:1.48	Sun Jul 11 20:52:06 2021
+++ src/external/mit/xorg/lib/gallium/Makefile	Tue Feb 14 15:47:01 2023
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.48 2021/07/11 20:52:06 mrg Exp $
+# $NetBSD: Makefile,v 1.48.2.1 2023/02/14 15:47:01 martin Exp $
 
 # Link the gallium mega driver.
 
@@ -28,6 +28,12 @@ CPPFLAGS+=	-I${DESTDIR}${X11INCDIR}/libd
 CFLAGS+=	-pthread
 LDFLAGS+=	-pthread
 
+# Reduce debugging for these extremely large objects.
+.if ${MKDEBUG:Uno} != "no"
+CXXFLAGS+=	-g1
+CFLAGS+=	-g1
+.endif
+
 GALLIUM_SUBDIRS= \
 	auxiliary \
 	auxiliary/cso_cache \

Index: src/external/mit/xorg/lib/gallium.old/Makefile
diff -u src/external/mit/xorg/lib/gallium.old/Makefile:1.4 src/external/mit/xorg/lib/gallium.old/Makefile:1.4.2.1
--- src/external/mit/xorg/lib/gallium.old/Makefile:1.4	Thu Sep 29 18:58:04 2022
+++ src/external/mit/xorg/lib/gallium.old/Makefile	Tue Feb 14 15:47:01 2023
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.4 2022/09/29 18:58:04 rjs Exp $
+# $NetBSD: Makefile,v 1.4.2.1 2023/02/14 15:47:01 martin Exp $
 
 # Transparent struct/union broken
 NOLINT=yes
@@ -31,6 +31,12 @@ CPPFLAGS+=	-I${DESTDIR}${X11INCDIR}/libd
 CFLAGS+=	-pthread
 LDFLAGS+=	-pthread
 
+# Reduce debugging for these extremely large objects.
+.if ${MKDEBUG:Uno} != "no"
+CXXFLAGS+=	-g1
+CFLAGS+=	-g1
+.endif
+
 GALLIUM_SUBDIRS= \
 	auxiliary \
 	auxiliary/cso_cache \

Index: src/share/mk/bsd.lib.mk
diff -u src/share/mk/bsd.lib.mk:1.389 src/share/mk/bsd.lib.mk:1.389.2.1
--- src/share/mk/bsd.lib.mk:1.389	Tue Mar 29 22:48:04 2022
+++ src/share/mk/bsd.lib.mk	Tue Feb 14 15:47:01 2023
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.lib.mk,v 1.389 2022/03/29 22:48:04 christos Exp $
+#	$NetBSD: bsd.lib.mk,v 1.389.2.1 2023/02/14 15:47:01 martin Exp $
 #	@(#)bsd.lib.mk	8.3 (Berkeley) 4/22/94
 
 .include <bsd.init.mk>
@@ -169,8 +169,10 @@ MKSHLIBOBJS= yes
 MKSHLIBOBJS= no
 .endif
 
-.if (${MKDEBUG:Uno} != "no" && !defined(NODEBUG)) || \
-    (defined(CFLAGS) && !empty(CFLAGS:M*-g*))
+# Avoid adding "-g" if we already have a "-g*" option.
+.if (${MKDEBUG:Uno} != "no" && !defined(NODEBUG)) && \
+    (!defined(CFLAGS) || empty(CFLAGS:M-g*)) && \
+    (!defined(CXXFLAGS) || empty(CXXFLAGS:M-g*))
 # We only add -g to the shared library objects
 # because we don't currently split .a archives.
 CSHLIBFLAGS+=	-g

Reply via email to