Source-Changes-HG archive

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

[src/trunk]: src/tools/gcc pass down earm* not earmv5* to mknative-gcc.



details:   https://anonhg.NetBSD.org/src/rev/6ddc9c785d73
branches:  trunk
changeset: 938299:6ddc9c785d73
user:      mrg <mrg%NetBSD.org@localhost>
date:      Sun Sep 06 02:24:38 2020 +0000

description:
pass down earm* not earmv5* to mknative-gcc.

diffstat:

 tools/gcc/Makefile         |   15 +++--
 tools/gcc/mknative-gcc     |  115 ++++++++++++++++++++++----------------------
 tools/gcc/mknative-gcc.old |  107 +++++++++++++++++++++--------------------
 3 files changed, 120 insertions(+), 117 deletions(-)

diffs (truncated from 697 to 300 lines):

diff -r 6ac3bc811955 -r 6ddc9c785d73 tools/gcc/Makefile
--- a/tools/gcc/Makefile        Sun Sep 06 02:18:53 2020 +0000
+++ b/tools/gcc/Makefile        Sun Sep 06 02:24:38 2020 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.99 2020/09/05 10:58:08 mrg Exp $
+#      $NetBSD: Makefile,v 1.100 2020/09/06 02:24:38 mrg Exp $
 
 .include <bsd.hostinit.mk>
 
@@ -95,7 +95,6 @@
 
 MKNATIVE_CONFIG_TARGET_LIBS+=  configure-target-libgcc
 MKNATIVE_CONFIG_TARGET_LIBS+=  configure-target-libgomp
-MKNATIVE_TARGET=       gcc
 
 MKNATIVE_CONFIG_TARGET_LIBS+= \
        configure-target-libstdc++-v3 \
@@ -142,25 +141,27 @@
 # in case the version being used is not.
 NEWCONFIGDIR?= ${.CURDIR}/../..
 
+GCC_MACHINE_ARCH=      ${MACHINE_ARCH:S/earmv5/earm/}
+
 bootstrap-libgcc: .configure_done
        @echo 'Creating files needed for libgcc by a native bootstrap build.'
        (cd ${.OBJDIR}/build && ${BUILD_COMMAND} configure-target-libgcc)
-       @MAKE=${BUILD_MAKE:Q} ${HOST_SH} ${MKNATIVE} lib${MKNATIVE_TARGET}-bootstrap \
+       @MAKE=${BUILD_MAKE:Q} ${HOST_SH} ${MKNATIVE} libgcc-bootstrap \
                ${.OBJDIR}/build ${NEWCONFIGDIR} ${NETBSDSRCDIR} \
-               ${MACHINE_GNU_PLATFORM} ${DESTDIR} ${TOOLDIR}
+               ${MACHINE_GNU_PLATFORM} ${GCC_MACHINE_ARCH} ${DESTDIR} ${TOOLDIR}
 
 bootstrap-libstdc++: .configure_done
        @echo 'Creating files needed for libstdc++ by a native bootstrap build.'
        (cd ${.OBJDIR}/build && ${BUILD_COMMAND} configure-target-libstdc++-v3)
        @MAKE=${BUILD_MAKE:Q} ${HOST_SH} ${MKNATIVE} libstdc++-bootstrap \
                ${.OBJDIR}/build ${NEWCONFIGDIR} ${NETBSDSRCDIR} \
-               ${MACHINE_GNU_PLATFORM} ${DESTDIR} ${TOOLDIR}
+               ${MACHINE_GNU_PLATFORM} ${GCC_MACHINE_ARCH} ${DESTDIR} ${TOOLDIR}
 
 native-gcc: .native/.configure_done
        @echo 'Extracting GNU GCC configury for a native toolchain.'
-       @MAKE=${BUILD_MAKE:Q} ${HOST_SH} ${MKNATIVE} ${MKNATIVE_TARGET} \
+       @MAKE=${BUILD_MAKE:Q} ${HOST_SH} ${MKNATIVE} gcc \
                ${.OBJDIR}/.native ${NEWCONFIGDIR} ${NETBSDSRCDIR} \
-               ${MACHINE_GNU_PLATFORM} ${DESTDIR} ${TOOLDIR}
+               ${MACHINE_GNU_PLATFORM} ${GCC_MACHINE_ARCH} ${DESTDIR} ${TOOLDIR}
 
 NATIVE_CONFIGURE_ARGS= ${COMMON_CONFIGURE_ARGS}
 MPC=           ${NETBSDSRCDIR}/external/lgpl3/mpc
diff -r 6ac3bc811955 -r 6ddc9c785d73 tools/gcc/mknative-gcc
--- a/tools/gcc/mknative-gcc    Sun Sep 06 02:18:53 2020 +0000
+++ b/tools/gcc/mknative-gcc    Sun Sep 06 02:24:38 2020 +0000
@@ -1,5 +1,5 @@
 #!/bin/sh
-#      $NetBSD: mknative-gcc,v 1.108 2020/09/05 10:58:08 mrg Exp $
+#      $NetBSD: mknative-gcc,v 1.109 2020/09/06 02:24:38 mrg Exp $
 #
 # Shell script for generating all the constants needed for a native
 # platform build of gcc.
@@ -12,8 +12,9 @@
 _TOP=$3
 _SRC=$4
 _PLATFORM=$5
-_DESTDIR=$6
-_TOOLDIR=$7
+_MACHINE_ARCH=$6
+_DESTDIR=$7
+_TOOLDIR=$8
 _VPATH=`grep VPATH ${_TMPDIR}/Makefile | sed 's,^.*=[  ]*,,'`
 _GNU_DIST=`cd ${_VPATH}; pwd`
 
@@ -47,10 +48,10 @@
 ##### lib/libg2c #####
 
 get_libg2c () {
-       mkdir -p $_OUTDIR/lib/libg2c3/arch/$MACHINE_ARCH
+       mkdir -p $_OUTDIR/lib/libg2c3/arch/$_MACHINE_ARCH
 
-       write_c $_OUTDIRBASE/lib/libg2c3/arch/$MACHINE_ARCH/config.h <$_TMPDIR/$_PLATFORM/libf2c/libU77/config.h
-       write_c $_OUTDIRBASE/lib/libg2c3/arch/$MACHINE_ARCH/g2c.h <$_TMPDIR/$_PLATFORM/libf2c/g2c.h
+       write_c $_OUTDIRBASE/lib/libg2c3/arch/$_MACHINE_ARCH/config.h <$_TMPDIR/$_PLATFORM/libf2c/libU77/config.h
+       write_c $_OUTDIRBASE/lib/libg2c3/arch/$_MACHINE_ARCH/g2c.h <$_TMPDIR/$_PLATFORM/libf2c/g2c.h
 
        {
                getvars $_PLATFORM/libf2c/Makefile \
@@ -61,7 +62,7 @@
                        ALL_CFLAGS OBJS | sed 's,=,+=,'
                getvars $_PLATFORM/libf2c/libU77/Makefile \
                        ALL_CFLAGS OBJS | sed 's,=,+=,'
-       } | write_mk $_OUTDIRBASE/lib/libg2c3/arch/$MACHINE_ARCH/defs.mk
+       } | write_mk $_OUTDIRBASE/lib/libg2c3/arch/$_MACHINE_ARCH/defs.mk
 }
 
 ##### lib/libgcc #####
@@ -74,7 +75,7 @@
        # XXX we should probably grab everything Just In Case for
        # the future.
 
-       mkdir -p $_OUTDIR/lib/lib$_subdir/arch/$MACHINE_ARCH
+       mkdir -p $_OUTDIR/lib/lib$_subdir/arch/$_MACHINE_ARCH
        cd $_TMPDIR/$_PLATFORM/libgcc
        {
                getvars $_PLATFORM/libgcc/Makefile \
@@ -90,7 +91,7 @@
                getvars gcc/Makefile \
                        NOEXCEPTION_FLAGS EXTRA_HEADERS
        }       | sanitise_includes \
-               | write_mk $_OUTDIRBASE/lib/lib$_subdir/arch/$MACHINE_ARCH/defs.mk
+               | write_mk $_OUTDIRBASE/lib/lib$_subdir/arch/$_MACHINE_ARCH/defs.mk
 
        cd $_TMPDIR/$_PLATFORM/libgcc
        {
@@ -99,18 +100,18 @@
                        unwind_header md_unwind_header \
                        sfp_machine_header thread_header
        }       | sanitise_includes \
-               | write_mk $_OUTDIRBASE/lib/lib$_subdir/arch/$MACHINE_ARCH/gthr-defs.mk
+               | write_mk $_OUTDIRBASE/lib/lib$_subdir/arch/$_MACHINE_ARCH/gthr-defs.mk
 
-       if [ "${MACHINE_ARCH}" = "m68000" ]
+       if [ "${_MACHINE_ARCH}" = "m68000" ]
        then
-               ex <<__EOF__ $_OUTDIR/lib/lib$_subdir/arch/$MACHINE_ARCH/defs.mk
+               ex <<__EOF__ $_OUTDIR/lib/lib$_subdir/arch/$_MACHINE_ARCH/defs.mk
 /G_LIBGCC2_CFLAGS/ s/-fPIC//
 wq
 __EOF__
        fi
 
        for f in auto-target.h; do
-               write_c $_OUTDIRBASE/lib/lib$_subdir/arch/$MACHINE_ARCH/$f \
+               write_c $_OUTDIRBASE/lib/lib$_subdir/arch/$_MACHINE_ARCH/$f \
                    <$_TMPDIR/$_PLATFORM/libgcc/$f
        done
 }
@@ -121,7 +122,7 @@
        _subdir="$1"
        _mf="$2"
 
-       mkdir -p $_OUTDIR/lib/lib$_subdir/libgcov/arch/$MACHINE_ARCH
+       mkdir -p $_OUTDIR/lib/lib$_subdir/libgcov/arch/$_MACHINE_ARCH
 
        {
                getvars $_mf \
@@ -129,9 +130,9 @@
                        LIBGCOV_PROFILER \
                        LIBGCOV_INTERFACE \
                        LIBGCOV_DRIVER
-       } | write_mk $_OUTDIRBASE/lib/lib$_subdir/libgcov/arch/$MACHINE_ARCH/defs.mk
+       } | write_mk $_OUTDIRBASE/lib/lib$_subdir/libgcov/arch/$_MACHINE_ARCH/defs.mk
 
-       write_c $_OUTDIRBASE/lib/lib$_subdir/libgcov/arch/$MACHINE_ARCH/gcov-iov.h \
+       write_c $_OUTDIRBASE/lib/lib$_subdir/libgcov/arch/$_MACHINE_ARCH/gcov-iov.h \
           <$_TMPDIR/gcc/gcov-iov.h
 
 }
@@ -141,13 +142,13 @@
 get_gcc_libiberty () {
        _subdir="$1"
        _libibertydir="lib/libiberty"
-       mkdir -p $_OUTDIR/$_libibertydir/arch/$MACHINE_ARCH
+       mkdir -p $_OUTDIR/$_libibertydir/arch/$_MACHINE_ARCH
 
        getvars libiberty/Makefile \
                ALLOCA EXTRA_OFILES LIBOBJS REQUIRED_OFILES \
                | write_mk $_OUTDIRBASE/$_libibertydir/defs.mk
 
-       write_c $_OUTDIRBASE/$_libibertydir/arch/$MACHINE_ARCH/config.h \
+       write_c $_OUTDIRBASE/$_libibertydir/arch/$_MACHINE_ARCH/config.h \
                <$_TMPDIR/libiberty/config.h
 }
 
@@ -156,8 +157,8 @@
 get_libdecnumber () {
        _subdir="$1"
 
-       mkdir -p $_OUTDIR/usr.bin/$_subdir/arch/$MACHINE_ARCH
-       write_c $_OUTDIRBASE/usr.bin/$_subdir/arch/$MACHINE_ARCH/config.h \
+       mkdir -p $_OUTDIR/usr.bin/$_subdir/arch/$_MACHINE_ARCH
+       write_c $_OUTDIRBASE/usr.bin/$_subdir/arch/$_MACHINE_ARCH/config.h \
                <$_TMPDIR/libdecnumber/config.h
 }
 
@@ -166,19 +167,19 @@
 get_libgomp () {
        _subdir="$1"
 
-       mkdir -p $_OUTDIR/lib/$_subdir/arch/$MACHINE_ARCH
+       mkdir -p $_OUTDIR/lib/$_subdir/arch/$_MACHINE_ARCH
 
        getvars $_PLATFORM/libgomp/Makefile \
                libgomp_la_SOURCES \
                | write_mk $_OUTDIRBASE/lib/$_subdir/defs.mk
 
-       write_c $_OUTDIRBASE/lib/$_subdir/arch/$MACHINE_ARCH/config.h \
+       write_c $_OUTDIRBASE/lib/$_subdir/arch/$_MACHINE_ARCH/config.h \
                <$_TMPDIR/$_PLATFORM/libgomp/config.h
-       write_c $_OUTDIRBASE/lib/$_subdir/arch/$MACHINE_ARCH/libgomp_f.h \
+       write_c $_OUTDIRBASE/lib/$_subdir/arch/$_MACHINE_ARCH/libgomp_f.h \
                <$_TMPDIR/$_PLATFORM/libgomp/libgomp_f.h
-       write_mk $_OUTDIRBASE/lib/$_subdir/arch/$MACHINE_ARCH/libgomp.spec \
+       write_mk $_OUTDIRBASE/lib/$_subdir/arch/$_MACHINE_ARCH/libgomp.spec \
                <$_TMPDIR/$_PLATFORM/libgomp/libgomp.spec
-       write_c $_OUTDIRBASE/lib/$_subdir/arch/$MACHINE_ARCH/omp.h \
+       write_c $_OUTDIRBASE/lib/$_subdir/arch/$_MACHINE_ARCH/omp.h \
                <$_TMPDIR/$_PLATFORM/libgomp/omp.h
 }
 
@@ -187,17 +188,17 @@
 get_libbacktrace () {
        _subdir="$1"
 
-       mkdir -p $_OUTDIR/lib/$_subdir/arch/$MACHINE_ARCH
-       write_c $_OUTDIRBASE/lib/$_subdir/arch/$MACHINE_ARCH/config.h \
+       mkdir -p $_OUTDIR/lib/$_subdir/arch/$_MACHINE_ARCH
+       write_c $_OUTDIRBASE/lib/$_subdir/arch/$_MACHINE_ARCH/config.h \
                <$_TMPDIR/$_PLATFORM/$_subdir/config.h
-       write_c $_OUTDIRBASE/lib/$_subdir/arch/$MACHINE_ARCH/backtrace-supported.h \
+       write_c $_OUTDIRBASE/lib/$_subdir/arch/$_MACHINE_ARCH/backtrace-supported.h \
                <$_TMPDIR/$_PLATFORM/$_subdir/backtrace-supported.h
 }
 
 ##### lib/libobjc #####
 
 get_libobjc () {
-       _subdir="$1/arch/$MACHINE_ARCH"
+       _subdir="$1/arch/$_MACHINE_ARCH"
        _options="ALL_OPT_FILES"
 
        mkdir -p $_OUTDIR/lib/$_subdir
@@ -222,7 +223,7 @@
        _subdir="$1"
        _ver="$2"
 
-       mkdir -p $_OUTDIR/lib/$_subdir/arch/$MACHINE_ARCH
+       mkdir -p $_OUTDIR/lib/$_subdir/arch/$_MACHINE_ARCH
 
        _build_headers="c++config.h cxxabi_tweaks.h"
        _headers1="c_base_headers_extra_install"
@@ -234,13 +235,13 @@
 
        # build files
        for h in $_build_headers; do
-               write_c $_OUTDIRBASE/lib/$_subdir/arch/$MACHINE_ARCH/$h \
+               write_c $_OUTDIRBASE/lib/$_subdir/arch/$_MACHINE_ARCH/$h \
                        <$_TMPDIR/$_PLATFORM/libstdc++-v3/include/$_PLATFORM/bits/$h
        done
 
-       write_c $_OUTDIRBASE/lib/$_subdir/arch/$MACHINE_ARCH/gstdint.h \
+       write_c $_OUTDIRBASE/lib/$_subdir/arch/$_MACHINE_ARCH/gstdint.h \
                <$_TMPDIR/$_PLATFORM/libstdc++-v3/include/gstdint.h
-       write_c $_OUTDIRBASE/lib/$_subdir/arch/$MACHINE_ARCH/symver-config.h \
+       write_c $_OUTDIRBASE/lib/$_subdir/arch/$_MACHINE_ARCH/symver-config.h \
                <$_TMPDIR/$_PLATFORM/libstdc++-v3/config.h
 
        {
@@ -295,7 +296,7 @@
                getvars $_PLATFORM/libstdc++-v3/include/Makefile \
                        BASIC_FILE_H ALLOCATOR_H CSTDIO_H CLOCALE_H CMESSAGES_H CTIME_H
        } | sanitise_includes \
-         | write_mk $_OUTDIRBASE/lib/$_subdir/arch/$MACHINE_ARCH/defs.mk
+         | write_mk $_OUTDIRBASE/lib/$_subdir/arch/$_MACHINE_ARCH/defs.mk
 }
 
 ##### lib/libsanitizer #####
@@ -303,7 +304,7 @@
 get_libsanitizer () {
        _subdir="$1"
 
-       mkdir -p $_OUTDIR/lib/$_subdir/arch/$MACHINE_ARCH
+       mkdir -p $_OUTDIR/lib/$_subdir/arch/$_MACHINE_ARCH
 
        {
                getvars $_PLATFORM/libsanitizer/asan/Makefile \
@@ -316,28 +317,28 @@
                        ubsan_plugin_files
 
        } | sanitise_includes \
-         | write_mk $_OUTDIRBASE/lib/$_subdir/arch/$MACHINE_ARCH/defs.mk
+         | write_mk $_OUTDIRBASE/lib/$_subdir/arch/$_MACHINE_ARCH/defs.mk
 }
 
 ##### usr.bin/gcc* #####
 
 get_gcc_bootstrap () {
        _subdir="$1"
-       mkdir -p $_OUTDIR/usr.bin/$_subdir/arch/$MACHINE_ARCH
+       mkdir -p $_OUTDIR/usr.bin/$_subdir/arch/$_MACHINE_ARCH
        for f in auto-host tm config; do
-               write_c $_OUTDIRBASE/usr.bin/$_subdir/arch/$MACHINE_ARCH/$f.h <$_TMPDIR/gcc/$f.h
+               write_c $_OUTDIRBASE/usr.bin/$_subdir/arch/$_MACHINE_ARCH/$f.h <$_TMPDIR/gcc/$f.h
        done
        # XXXGCC5 don't really want to copy insn-modes as we build
        # it but libgcc needs to too early yet
        for f in insn-modes; do
-               write_c $_OUTDIRBASE/usr.bin/$_subdir/arch/$MACHINE_ARCH/$f.h <$_TMPDIR/gcc/$f.h
+               write_c $_OUTDIRBASE/usr.bin/$_subdir/arch/$_MACHINE_ARCH/$f.h <$_TMPDIR/gcc/$f.h
        done
 }



Home | Main Index | Thread Index | Old Index