Module Name:    src
Committed By:   mrg
Date:           Tue Jun 18 04:07:18 UTC 2024

Modified Files:
        src/external/gpl3/gcc/usr.bin: Makefile
        src/external/gpl3/gcc/usr.bin/backend: Makefile
        src/external/gpl3/gcc/usr.bin/host-libiberty: Makefile
        src/external/gpl3/gcc/usr.bin/include: Makefile
Added Files:
        src/external/gpl3/gcc/usr.bin: rs6000-inc.mk

Log Message:
fix the rs6000 vs GCC 12 includes problems.

we need a host-tool to generate one of the installed include files,
so restructure the includes build to descend into "host-libiberty"
with a "includes" target, and make "includes" target here depend
upon libiberty.a, so it will be built before "include" subdir tries
to use it to build rs6000-gen-builtins.

put the generator code for rs6000-gen-builtins into "rs6000-inc.mk".

no longer exclude rs6000-vecdefines.h in "include" subdir, and do
not try to install it from "backend" subdir anymore.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/external/gpl3/gcc/usr.bin/Makefile
cvs rdiff -u -r0 -r1.1 src/external/gpl3/gcc/usr.bin/rs6000-inc.mk
cvs rdiff -u -r1.73 -r1.74 src/external/gpl3/gcc/usr.bin/backend/Makefile
cvs rdiff -u -r1.4 -r1.5 \
    src/external/gpl3/gcc/usr.bin/host-libiberty/Makefile
cvs rdiff -u -r1.15 -r1.16 src/external/gpl3/gcc/usr.bin/include/Makefile

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/gcc/usr.bin/Makefile
diff -u src/external/gpl3/gcc/usr.bin/Makefile:1.15 src/external/gpl3/gcc/usr.bin/Makefile:1.16
--- src/external/gpl3/gcc/usr.bin/Makefile:1.15	Sun Feb 25 00:28:02 2024
+++ src/external/gpl3/gcc/usr.bin/Makefile	Tue Jun 18 04:07:18 2024
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.15 2024/02/25 00:28:02 mrg Exp $
+#	$NetBSD: Makefile,v 1.16 2024/06/18 04:07:18 mrg Exp $
 
 NOOBJ=# defined
 
@@ -8,11 +8,12 @@ GCC_MACHINE_ARCH=${MACHINE_ARCH:S/earmv5
 
 .if ${MKGCC} != "no" && exists(${.CURDIR}/gcc/arch/${GCC_MACHINE_ARCH}/defs.mk)
 
-.if ${MKGCCCMDS} != "no" || make(includes)
+# host-libiberty is used by include on rs6000.
+SUBDIR+=	host-libiberty .WAIT
 
 # We keep libcpp here since it depends upon frontend.
-SUBDIR+=	host-libiberty .WAIT \
-		host-libcpp .WAIT \
+.if ${MKGCCCMDS} != "no" || make(includes)
+SUBDIR+=	host-libcpp .WAIT \
 		../../../mit/isl/lib/libisl \
 		backend .WAIT \
 		frontend .WAIT \
@@ -24,6 +25,10 @@ SUBDIR+=	host-libiberty .WAIT \
 
 SUBDIR+=	include
 
+# Make sure that we do host-liberty before include, rs6000 has a generator
+# for an installed a header and the generator needs host-libiberty.
+include-include: include-host-libiberty
+
 .include <bsd.subdir.mk>
 
 .else

Index: src/external/gpl3/gcc/usr.bin/backend/Makefile
diff -u src/external/gpl3/gcc/usr.bin/backend/Makefile:1.73 src/external/gpl3/gcc/usr.bin/backend/Makefile:1.74
--- src/external/gpl3/gcc/usr.bin/backend/Makefile:1.73	Tue Jun 11 03:06:48 2024
+++ src/external/gpl3/gcc/usr.bin/backend/Makefile	Tue Jun 18 04:07:18 2024
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.73 2024/06/11 03:06:48 mrg Exp $
+#	$NetBSD: Makefile,v 1.74 2024/06/18 04:07:18 mrg Exp $
 
 HOSTPROG_CXX=	1
 LIBISPRIVATE=	yes
@@ -35,12 +35,6 @@ HOST_CXXFLAGS+=	-std=gnu++11
 
 HOST_LIBIBERTYOBJ!=	cd ${.CURDIR}/../host-libiberty && ${PRINTOBJDIR}
 
-# XXX This is generated here, not in ../include.
-.if ${GCC_MACHINE_ARCH} == "powerpc" || ${GCC_MACHINE_ARCH} == "powerpc64"
-INCS+=	rs6000-vecdefines.h
-INCSDIR=${GCC_INCSDIR}
-.endif
-
 .include <bsd.lib.mk>
 
 # Force using C++ for this
@@ -439,24 +433,7 @@ CLEANFILES+=	aarch-builtin-iterators.h
 
 .if ${GCC_MACHINE_ARCH} == "powerpc" || ${GCC_MACHINE_ARCH} == "powerpc64" # {
 
-rs6000-gen-builtins.lo: ${HH} ${DIST}/gcc/config/rs6000/rs6000-gen-builtins.cc
-rbtree.lo: ${HH} ${DIST}/gcc/config/rs6000/rbtree.cc
-rs6000-gen-builtins: rs6000-gen-builtins.lo rbtree.lo
-	${_MKTARGET_LINK}
-	${HOST_LINK.cc} -o ${.TARGET} ${.ALLSRC} ${NBCOMPATLIB} ${HOSTLIBIBERTY} ${LDFLAGS.${.TARGET}}
-rs6000-builtins.cc: rs6000-gen-builtins \
-		    ${DIST}/gcc/config/rs6000/rs6000-builtins.def \
-		    ${DIST}/gcc/config/rs6000/rs6000-overload.def
-	${_MKTARGET_CREATE}
-	./rs6000-gen-builtins \
-		    ${DIST}/gcc/config/rs6000/rs6000-builtins.def \
-		    ${DIST}/gcc/config/rs6000/rs6000-overload.def \
-                rs6000-builtins.h rs6000-builtins.cc rs6000-vecdefines.h
-rs6000-builtins.h rs6000-vecdefines.h: rs6000-builtins.cc
-
-CLEANFILES+=	rs6000-builtins.h rs6000-builtins.cc rs6000-vecdefines.h
-CLEANFILES+=	rs6000-gen-builtins rbtree.lo rs6000-gen-builtins.lo
-
+.include "../rs6000-inc.mk"
 gtype-desc.h: rs6000-builtins.h
 
 .endif # }

Index: src/external/gpl3/gcc/usr.bin/host-libiberty/Makefile
diff -u src/external/gpl3/gcc/usr.bin/host-libiberty/Makefile:1.4 src/external/gpl3/gcc/usr.bin/host-libiberty/Makefile:1.5
--- src/external/gpl3/gcc/usr.bin/host-libiberty/Makefile:1.4	Sat Sep 18 01:47:08 2021
+++ src/external/gpl3/gcc/usr.bin/host-libiberty/Makefile	Tue Jun 18 04:07:18 2024
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.4 2021/09/18 01:47:08 christos Exp $
+#	$NetBSD: Makefile,v 1.5 2024/06/18 04:07:18 mrg Exp $
 
 libiberty/libiberty.a:
 	[ ! -d libiberty ] && mkdir libiberty || true
@@ -15,6 +15,6 @@ libiberty/libiberty.a:
 cleandir:
 	-rm -rf libiberty
 
-depend dependall all: libiberty/libiberty.a
+includes depend dependall all: libiberty/libiberty.a
 
 .include <bsd.prog.mk>

Index: src/external/gpl3/gcc/usr.bin/include/Makefile
diff -u src/external/gpl3/gcc/usr.bin/include/Makefile:1.15 src/external/gpl3/gcc/usr.bin/include/Makefile:1.16
--- src/external/gpl3/gcc/usr.bin/include/Makefile:1.15	Thu Jun  6 05:41:28 2024
+++ src/external/gpl3/gcc/usr.bin/include/Makefile	Tue Jun 18 04:07:18 2024
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.15 2024/06/06 05:41:28 mrg Exp $
+#	$NetBSD: Makefile,v 1.16 2024/06/18 04:07:18 mrg Exp $
 
 .include <bsd.init.mk>
 
@@ -8,9 +8,9 @@ SUBDIR=	sanitizer
 .include "${.CURDIR}/arch/${GCC_MACHINE_ARCH}.mk"
 .endif
 
-# XXX rs6000-vecdefines.h is generated in usr.bin/backend.  we can
-# try to install this from there later perhaps?
-INCS= ${G_EXTRA_HEADERS:T:Nrs6000-vecdefines.h}
+INCS= ${G_EXTRA_HEADERS:T}
+
+.include "../rs6000-inc.mk"
 
 # Part of the standard headers, the rest of which we replace.
 INCS+=	stdatomic.h

Added files:

Index: src/external/gpl3/gcc/usr.bin/rs6000-inc.mk
diff -u /dev/null src/external/gpl3/gcc/usr.bin/rs6000-inc.mk:1.1
--- /dev/null	Tue Jun 18 04:07:18 2024
+++ src/external/gpl3/gcc/usr.bin/rs6000-inc.mk	Tue Jun 18 04:07:18 2024
@@ -0,0 +1,26 @@
+#	$NetBSD: rs6000-inc.mk,v 1.1 2024/06/18 04:07:18 mrg Exp $
+
+# makefile snippet to build the rs6000-vecdefs files, used by include and
+# usr.bin.
+
+.if ${GCC_MACHINE_ARCH} == "powerpc" || ${GCC_MACHINE_ARCH} == "powerpc64" # {
+
+rs6000-gen-builtins.lo: ${HH} ${DIST}/gcc/config/rs6000/rs6000-gen-builtins.cc
+rbtree.lo: ${HH} ${DIST}/gcc/config/rs6000/rbtree.cc
+rs6000-gen-builtins: rs6000-gen-builtins.lo rbtree.lo
+	${_MKTARGET_LINK}
+	${HOST_LINK.cc} -o ${.TARGET} ${.ALLSRC} ${NBCOMPATLIB} ${HOSTLIBIBERTY} ${LDFLAGS.${.TARGET}}
+rs6000-builtins.cc: rs6000-gen-builtins \
+		    ${DIST}/gcc/config/rs6000/rs6000-builtins.def \
+		    ${DIST}/gcc/config/rs6000/rs6000-overload.def
+	${_MKTARGET_CREATE}
+	./rs6000-gen-builtins \
+		    ${DIST}/gcc/config/rs6000/rs6000-builtins.def \
+		    ${DIST}/gcc/config/rs6000/rs6000-overload.def \
+                rs6000-builtins.h rs6000-builtins.cc rs6000-vecdefines.h
+rs6000-builtins.h rs6000-vecdefines.h: rs6000-builtins.cc
+
+CLEANFILES+=	rs6000-builtins.h rs6000-builtins.cc rs6000-vecdefines.h
+CLEANFILES+=	rs6000-gen-builtins rbtree.lo rs6000-gen-builtins.lo
+
+.endif # }

Reply via email to