Source-Changes-HG archive

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

[src/trunk]: src/external/gpl3/gcc/usr.bin/backend make this actually work:



details:   https://anonhg.NetBSD.org/src/rev/7e77e4495959
branches:  trunk
changeset: 359319:7e77e4495959
user:      mrg <mrg%NetBSD.org@localhost>
date:      Wed Feb 07 02:33:05 2018 +0000

description:
make this actually work:
- use ${G_OBJS} directly, it avoids issues with .c vs .cc files.
- add a method to not rm -rf .ab for inspection.
- fix and add missing depends for many things.
- use -Wno-error for mips and arm insn-recog.c, due to eg:
    insn-recog.c:10304:7: error: this decimal constant is unsigned only in ISO C90 [-Werror]
    mips.md:3474:11: error: this decimal constant is unsigned only in ISO C90 [-Werror]

diffstat:

 external/gpl3/gcc/usr.bin/backend/Makefile |  57 +++++++++++++++++------------
 1 files changed, 33 insertions(+), 24 deletions(-)

diffs (163 lines):

diff -r f6f1b4b920c6 -r 7e77e4495959 external/gpl3/gcc/usr.bin/backend/Makefile
--- a/external/gpl3/gcc/usr.bin/backend/Makefile        Wed Feb 07 02:32:39 2018 +0000
+++ b/external/gpl3/gcc/usr.bin/backend/Makefile        Wed Feb 07 02:33:05 2018 +0000
@@ -1,10 +1,13 @@
-#      $NetBSD: Makefile,v 1.41 2018/02/04 10:16:07 mrg Exp $
+#      $NetBSD: Makefile,v 1.42 2018/02/07 02:33:05 mrg Exp $
 
 LIBISPRIVATE=  yes
 
 LIB=           backend
 
-SRCS=          ${G_OBJS:.o=.c} ${G_out_file:T} regsub.c
+SRCS=          ${G_OBJS} ${G_out_file:T} regsub.c
+
+# XXX: something misses these.
+CLEANDIRFILES+=        ${G_OBJS:.o=.d}
 
 # Make sure we use the pre-generated C files
 .l.c:
@@ -29,16 +32,6 @@
 
 HOST_LIBIBERTYOBJ!=    cd ${.CURDIR}/../host-libiberty && ${PRINTOBJDIR}
 
-# XXX ${G_OBJS:.o=.c} is invalid in GCC 5.3, but work around for now
-BUILDSYMLINKS+=        ${GNUHOSTDIST}/gcc/wide-int-print.cc wide-int-print.c
-BUILDSYMLINKS+=        ${GNUHOSTDIST}/gcc/wide-int.cc wide-int.c
-
-.if ${MACHINE_CPU} == "sh3"
-BUILDSYMLINKS+= ${GNUHOSTDIST}/gcc/config/sh/sh-mem.cc sh-mem.c
-BUILDSYMLINKS+= ${GNUHOSTDIST}/gcc/config/sh/sh_treg_combine.cc sh_treg_combine.c
-BUILDSYMLINKS+= ${GNUHOSTDIST}/gcc/config/sh/sh_optimize_sett_clrt.cc sh_optimize_sett_clrt.c
-.endif
-
 .include <bsd.lib.mk>
 
 # Force using C++ for this
@@ -211,6 +204,10 @@
 CLEANFILES+=   auto-build.h
 HOST_CFLAGS+= -I${.OBJDIR}
 HOST_CXXFLAGS+= -I${.OBJDIR}
+
+# Set this to "true" to leave .ab around
+HOST_AB_CLEAN?=        rm -rf .ab
+
 auto-build.h: gmp.h Makefile
        ${_MKTARGET_CREATE}
        rm -rf .ab && \
@@ -228,8 +225,7 @@
                        --host=`${HOST_SH} ${GNUHOSTDIST}/config.guess` \
                        --target=${MACHINE_GNU_PLATFORM} && \
                mv auto-host.h ../auto-build.h) && \
-       true
-       #rm -rf .ab
+       ${HOST_AB_CLEAN}
 
 pass-instances.def: passes.def gen-pass-instances.awk
        ${_MKTARGET_CREATE}
@@ -243,12 +239,12 @@
 #
 
 build-rtl.c: rtl.c \
-  ${G_RTL_H} real.h ${G_GCC_H} ${G_GGC_H} errors.h
+  ${G_RTL_H} real.h ${G_GCC_H} ${G_RTL_BASE_H} ${G_GGC_H} errors.h
        ${_MKTARGET_CREATE}
        rm -f build-rtl.c
        ${TOOL_SED} -e 's/<config[.]h/hconfig.h/' \
                ${GNUHOSTDIST}/gcc/rtl.c >${.TARGET}
-build-rtl.lo: ${HH}
+build-rtl.lo: ${HH} insn-constants.h
 CLEANFILES+=   build-rtl.c
 
 build-print-rtl.c: print-rtl.c \
@@ -310,6 +306,8 @@
 build-vec.lo: ${HH_NORTL}
 CLEANFILES+=   build-vec.c
 
+build-genattrtab.o: ${G_GGC_H}
+
 #
 # The normal insn-foo generators
 #
@@ -333,7 +331,7 @@
 .for f in attr attr-common attrtab automata codes conditions config emit \
          extract flags opinit output peep preds recog mddump condmd \
          target-def cfn-macros
-gen${f}.lo: ${HH} gen${f}.c
+gen${f}.lo: ${HH} gen${f}.c ${G_RTL_BASE_H}
 gen${f}: gen${f}.lo ${GENPROG_RTL_DEPENDS} 
        ${_MKTARGET_LINK}
        ${HOST_LINK.cc} -o ${.TARGET} ${.ALLSRC} ${NBCOMPATLIB} ${HOSTLIBIBERTY} ${LDFLAGS.${.TARGET}}
@@ -341,15 +339,15 @@
 .endfor
 
 .for f in mddeps constants enums
-gen${f}.lo: ${HH} gen${f}.c
-gen${f}: gen${f}.lo ${GENPROG_READER_DEPENDS} 
+gen${f}.lo: ${HH} gen${f}.c ${G_RTL_BASE_H}
+gen${f}: gen${f}.lo ${GENPROG_READER_DEPENDS}
        ${_MKTARGET_LINK}
        ${HOST_LINK.cc} -o ${.TARGET} ${.ALLSRC} ${NBCOMPATLIB} ${HOSTLIBIBERTY} ${LDFLAGS.${.TARGET}}
 CLEANFILES+=   gen${f} gen${f}.lo
 .endfor
 
 .for f in check checksum
-gen${f}.lo: ${HH} gen${f}.c
+gen${f}.lo: ${HH} gen${f}.c ${G_RTL_BASE_H}
 gen${f}: gen${f}.lo
        ${_MKTARGET_LINK}
        ${HOST_LINK.cc} -o ${.TARGET} ${.ALLSRC} ${NBCOMPATLIB} ${HOSTLIBIBERTY} ${LDFLAGS.${.TARGET}}
@@ -421,7 +419,7 @@
 
 # build params.list for params.h.
 params.h: params.list
-DPSRCS+= params.h
+${SRCS}: params.list
 params-list.h: params.def
 params.list: params-list.h
        ${CPP} ${.ALLSRC} | sed 's/^#.*//;/^$$/d' > params.list.tmp && \
@@ -450,10 +448,10 @@
 #
 genextract.lo: insn-config.h
 gencondmd.lo: tm_p.h tm-constrs.h
-read-rtl.lo gencodes.lo genattrtab.lo genautomata.lo: insn-constants.h
-genattr-common.lo gensupport.lo genconditions.lo: insn-constants.h
+read-rtl.lo gencodes.lo genattrtab.lo genautomata.lo: insn-constants.h gtype-desc.h
+genattr-common.lo gensupport.lo genconditions.lo gentarget-def.lo: insn-constants.h
 genattr.lo genflags.lo genemit.lo genconfig.lo gencheck.lo: insn-constants.h gtype-desc.h
-genopinit.lo genrecog.lo genpreds.lo genoutput.lo genpeep.lo: insn-constants.h
+genopinit.lo genrecog.lo genpreds.lo genoutput.lo genpeep.lo: insn-constants.h 
 build-ggc-none.lo: gtype-desc.h
 ggc-none.o: gtype-desc.h
 
@@ -474,6 +472,8 @@
 gcov-io.h: gcov-iov.h
 df-scan.d df-scan.o: target-hooks-def.h
 read-md.d read-md.o read-md.lo: auto-build.h
+hash-table.d hash-table.o hash-table.lo: auto-build.h gtype-desc.h
+gencfn-macros.d gencfn-macros.o gencfn-macros.lo: gtype-desc.h
 cgraphunit.d cgraphunit.o: pass-instances.def
 
 # XXX make all hooks generated for now.
@@ -487,12 +487,21 @@
 .if ${MACHINE_CPU} == "arm"
 arm.d arm.o: insn-constants.h tm_p.h insn-opinit.h target-hooks-def.h
 arm-builtins.d arm-builtins.o: insn-opinit.h
+# XXX insn-recog.c:10304:7: error: this decimal constant is unsigned only in ISO C90 [-Werror]
+COPTS.insn-recog.c+=-Wno-error
+.endif
+
+.if ${MACHINE_CPU} == "mips"
+# XXX mips.md:3474:11: error: this decimal constant is unsigned only in ISO C90 [-Werror]
+COPTS.insn-recog.c+=-Wno-error
 .endif
 
 .if ${GCC_MACHINE_ARCH} == "i386" || ${GCC_MACHINE_ARCH} == "x86_64"
 i386.d i386.o: tm-constrs.h
 .endif
 
+${G_out_file:T:.c=.o}: insn-target-def.h
+
 .if ${GCC_MACHINE_ARCH} == "vax"
 CPPFLAGS+=-I${.CURDIR}/../../lib/libgcc/libgcov/arch/${GCC_MACHINE_ARCH}
 COPTS.builtins.c+=-O0



Home | Main Index | Thread Index | Old Index