Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/tools/gcc prepare for GCC 5:
details: https://anonhg.NetBSD.org/src/rev/89942a0370d0
branches: trunk
changeset: 343172:89942a0370d0
user: mrg <mrg%NetBSD.org@localhost>
date: Sun Jan 24 05:10:26 2016 +0000
description:
prepare for GCC 5:
- remove GCC 4.5 stuff, add most very basic GCC 5 stuff.
- use mknative-gcc.old for GCC 4.8
- copy mknative-gcc to mknative-gcc.old (should have done this when we
switched to using gcc.old.)
this should not affect current builds.
diffstat:
tools/gcc/Makefile | 26 +-
tools/gcc/mknative-gcc.old | 592 ++++++++++----------------------------------
2 files changed, 150 insertions(+), 468 deletions(-)
diffs (truncated from 889 to 300 lines):
diff -r 2ca1039260d7 -r 89942a0370d0 tools/gcc/Makefile
--- a/tools/gcc/Makefile Sun Jan 24 05:02:23 2016 +0000
+++ b/tools/gcc/Makefile Sun Jan 24 05:10:26 2016 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.74 2015/01/16 20:10:26 christos Exp $
+# $NetBSD: Makefile,v 1.75 2016/01/24 05:10:26 mrg Exp $
.include <bsd.own.mk>
@@ -9,16 +9,11 @@
GNUHOSTDIST= ${GCCDIST}
.if ${HAVE_GCC} == 48
-CC_FOR_BUILD= ${HOST_CXX:Q}
-LIB_INTL=
-.elif ${HAVE_GCC} == 45
-UNWIND_H=unwind.h
MKNATIVE= ${.CURDIR}/mknative-gcc.old
.endif
# Defaults
-CC_FOR_BUILD?= ${HOST_CC:Q}
-LIB_INTL?= "LIBS=-lintl"
+CC_FOR_BUILD= ${HOST_CXX:Q}
MKNATIVE?= ${.CURDIR}/mknative-gcc
.if ${MACHINE_ARCH} == "x86_64" || ${MACHINE_ARCH} == "sparc64"
@@ -88,13 +83,14 @@
MKNATIVE_CONFIG_TARGET_LIBS=
-.if ${HAVE_GCC} == 48
+.if ${HAVE_GCC} == 5
+MKNATIVE_CONFIG_TARGET_LIBS+= configure-target-libgcc
+MKNATIVE_CONFIG_TARGET_LIBS+= configure-target-libgomp
+MKNATIVE_TARGET= gcc5
+.elif ${HAVE_GCC} == 48
MKNATIVE_CONFIG_TARGET_LIBS+= configure-target-libgcc
MKNATIVE_CONFIG_TARGET_LIBS+= configure-target-libgomp
MKNATIVE_TARGET= gcc48
-.elif ${HAVE_GCC} == 45
-MKNATIVE_CONFIG_TARGET_LIBS+= configure-target-libgomp
-MKNATIVE_TARGET= gcc45
.endif
MKNATIVE_CONFIG_TARGET_LIBS+= \
@@ -116,7 +112,6 @@
MSGFMT=${TOOLDIR}/bin/${_TOOL_PREFIX}msgfmt \
NM=${NM:Q} OBJDUMP=${OBJDUMP:Q} \
XGETTEXT=${TOOLDIR}/bin/${_TOOL_PREFIX}xgettext \
- ${LIB_INTL} \
ac_cv_prog_cc_cross=yes \
ac_cv_func_strcoll_works=yes \
ac_cv_func_elf_getshstrndx=no \
@@ -141,14 +136,12 @@
${.OBJDIR}/build ${NEWCONFIGDIR} ${NETBSDSRCDIR} \
${MACHINE_GNU_PLATFORM} ${DESTDIR} ${TOOLDIR}
-.if ${HAVE_GCC} == "48"
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}
-.endif
native-gcc: .native/.configure_done
@echo 'Extracting GNU GCC configury for a native toolchain.'
@@ -201,8 +194,7 @@
${HOST_SH} ${GNUHOSTDIST}/configure \
${NATIVE_CONFIGURE_ARGS}) && \
(${MKENV_BUILD_MAKE} all-build-libiberty) && \
- ([ "${HAVE_GCC}" = "48" ] && \
- (${MKENV_BUILD_MAKE} all-libcpp) && \
+ ((${MKENV_BUILD_MAKE} all-libcpp) && \
(${MKENV_BUILD_MAKE} all-libbacktrace) && \
(${MKENV_BUILD_MAKE} all-libdecnumber) || true)
PATH=${TOOLDIR}/bin:$$PATH; export PATH; \
@@ -217,7 +209,7 @@
PATH=${TOOLDIR}/bin:$$PATH; export PATH; \
(cd .native/gcc && ${MKNATIVE_ENV} ${BUILD_MAKE} -e tree-check.h config.h multilib.h gcov-iov.h)
PATH=${TOOLDIR}/bin:$$PATH; export PATH; \
- (cd .native/gcc && ${MKNATIVE_ENV} ${BUILD_MAKE} -e libgcc.mvars tconfig.h ${UNWIND_H})
+ (cd .native/gcc && ${MKNATIVE_ENV} ${BUILD_MAKE} -e libgcc.mvars tconfig.h unwind.h
(cd .native && touch gcc/cc1obj gcc/cc1plus gcc/f771 gcc/libgcc.a gcc/libgcc_s.so)
.for _lib in ${MKNATIVE_CONFIG_TARGET_LIBS}
PATH=${TOOLDIR}/bin:$$PATH; export PATH; \
diff -r 2ca1039260d7 -r 89942a0370d0 tools/gcc/mknative-gcc.old
--- a/tools/gcc/mknative-gcc.old Sun Jan 24 05:02:23 2016 +0000
+++ b/tools/gcc/mknative-gcc.old Sun Jan 24 05:10:26 2016 +0000
@@ -1,13 +1,10 @@
#!/bin/sh
-# $NetBSD: mknative-gcc.old,v 1.1 2014/02/26 09:54:34 mrg Exp $
-#
-# was: NetBSD: mknative-gcc,v 1.75 2014/02/16 11:26:31 skrll Exp
+# $NetBSD: mknative-gcc.old,v 1.2 2016/01/24 05:10:26 mrg Exp $
#
# Shell script for generating all the constants needed for a native
# platform build of gcc.
#
-
-# XXX split out GCC 4.1 support
+# This version is for GCC 4.8.
# initialise
@@ -16,7 +13,7 @@
_SRC=$4
_PLATFORM=$5
_DESTDIR=$6
-_ABI=$7
+_TOOLDIR=$7
_VPATH=`grep VPATH ${_TMPDIR}/Makefile | sed 's,^.*=[ ]*,,'`
_GNU_DIST=`cd ${_VPATH}; pwd`
@@ -36,11 +33,12 @@
-e "s,-I$_DESTDIR/usr/include,,g" \
-e "s,-I$_SRC/external/lgpl3/mpfr/dist/src,,g" \
-e "s,-I$_SRC/external/lgpl3/mpc/dist/src,,g" \
- -e "s,-I$_SRC/external/lgpl3/gmp/lib/libgmp/arch/$MACHINE_ARCH,,g" \
+ -e "s,-I$_SRC/external/lgpl3/gmp/lib/libgmp/arch/[a-z_0-9-]*,,g" \
+ -e "s,-I$_TOOLDIR/include,,g" \
-e "s,-I/usr/include/[^ ]*,,"
}
-##### gnu/lib/crtstuff #####
+##### lib/crtstuff #####
get_crtstuff () {
_subdir="$1"
@@ -53,7 +51,7 @@
| write_mk $_OUTDIRBASE/lib/$_subdir/arch/$MACHINE_ARCH.mk
}
-##### gnu/lib/libg2c #####
+##### lib/libg2c #####
get_libg2c () {
mkdir -p $_OUTDIR/lib/libg2c3/arch/$MACHINE_ARCH
@@ -73,359 +71,57 @@
} | write_mk $_OUTDIRBASE/lib/libg2c3/arch/$MACHINE_ARCH/defs.mk
}
-##### gnu/lib/libgcc #####
-
-get_libgcc_list_funcs_asm () {
- {
- getvars gcc/Makefile LIB1ASMFUNCS | {
- # print newline separated list
- sed -e '
- s,^.*=,,
- s, *$,,
- s, *, ,g
- s, ,\
-,g'
- }
- getvars gcc/Makefile LIB2FUNCS_EXTRA | {
- # print newline separated list
- sed -e '
- s,^.*=,,
- s, *$,,
- s, *, ,g
- s, ,\
-,g' | \
- sed -ne '
- /\.S$/ { s,^.*/,,; s,\.S$,,; p; }
- /\.asm$/ { s,^.*/,,; s,\.asm$,,; p; }
- '
- }
- } | {
- # print foo and foo_s
- sed -ne '
- /./ {
- p
- s,$,_s,
- p
- }
- '
- } | sort
-}
-
-get_libgcc_list_funcs_lib () {
- local _lib=$1
- local _lib_prefix=${_lib%.*}
- local _lib_suffix=${_lib#*.}
- local _abi=${2:-'\.'}
-
- cat build/gcc/libgcc.mk | \
- grep '/'${_abi}'/' | \
- sed -ne '
- /^'${_abi}'\/'${_lib_prefix}'\.'${_lib_suffix}': .*\.o$/ {
- s,^.*/,,
- s,\.o$,,
- p
- }
- ' | sort
-}
-
-get_libgcc_list_objs_libs () {
- local _abi=${1:-'\.'}
-
- cat build/gcc/libgcc.mk | \
- grep '/'${_abi}'/' | \
- egrep '^'${_abi}'\/(libgcc_s\.so|libgcc\.a|libgcc_eh\.a|libgcov\.a): (libgcc_s|libgcc|libgcc_eh|libgcov)\/.*\.o$' | \
- sed -e '
- s,^'${_abi}'\/,,
- s,: .*/, ,
- s,^\(.*\) \(.*\)$,\2 \1,
- ' | sort
-}
-
-get_libgcc_list_objs_srcs () {
- local _abi=${1:-'\.'} # XXX not used
-
- if [ -e $_TOP/${libgcc_db_funcs}.S ]; then
- cut -f1 $_TOP/${libgcc_db_objs_libs} | sed -e 's,\.o$,,' | \
- comm -23 /dev/stdin $_TOP/${libgcc_db_funcs}.S | \
- sed -e 's,\(.*\),\1.o \1.c,'
-
- cut -f1 $_TOP/${libgcc_db_objs_libs} | sed -e 's,\.o$,,' | \
- comm -12 /dev/stdin $_TOP/${libgcc_db_funcs}.S | \
- sed -e 's,\(.*\),\1.o \1.S,'
- else
- cut -f1 $_TOP/${libgcc_db_objs_libs} | sed -e 's,\.o$,,' | \
- sed -e 's,\(.*\),\1.o \1.c,'
- fi | sort
-}
-
-get_libgcc_list_objs_tmplsrcs () {
- local _abi=${1:-'\.'}
-
- grep 'GCC_FOR_TARGET.*\.o$' build/gcc/libgcc.mk | \
- grep '/'${_abi}'/' | \
- sed -ne '
- s,^.* -c \([^ ]*\).* -o .*/\([^ ]*\.o\)$,\2 \1,
- # basename
- /\$/ { s,\$.*/,,; }
- /\// { s,\/.*/,,; }
- p
- ' | sort -u
-}
-
-get_libgcc_list_objs_xflags () {
- local _flags=$1
- local _abi=${2:-'\.'}
-
- grep 'GCC_FOR_TARGET.*\.o$' build/gcc/libgcc.mk | \
- grep '/'${_abi}'/' | \
- sed -n '
- x
- :loop
- g
- s/^\(.*\) \(-['${_flags}'][^ ][^ ]*\) \(.*\) \(-o .*\)\/\(.*\.o\)$/\5 \2/p
- g
- s/^\(.*\) \(-['${_flags}'][^ ][^ ]*\) \(.*\) \(-o .*\)\/\(.*\.o\)$/\1 \3 \4\/\5/
- h
- t loop
- ' | sort
-}
-
-get_libgcc_list_objs_cppflags () {
- get_libgcc_list_objs_xflags D $1
-}
-
-get_libgcc_list_objs_copts () {
- get_libgcc_list_objs_xflags fmx $1
-}
-
-get_libgcc_list_tmplsrcs () {
- local _lib=$1
- local _abi=$2 # XXX not used
- local _tmplallsrcs=$( mktemp /tmp/mknative-gcc._tmplallsrcs.XXXXXX )
-
- touch $_TOP/${libgcc_db_tmplsrcs}.tmplsrcs.${_lib%.*}
- touch $_TOP/${libgcc_db_tmplsrcs}.tmplfpsrcs.${_lib%.*}
- touch $_TOP/${libgcc_db_tmplsrcs}.tmplasmsrcs.${_lib%.*}
-
- # all files
- local _lib_prefix=${_lib%.*}
- local _lib_suffix=${_lib#*.}
- join $_TOP/$libgcc_db_objs_libs $_TOP/$libgcc_db_objs_tmplsrcs | \
- grep ${_lib_prefix}'\.'${_lib_suffix} | cut -d' ' -f 3 | sort -u > \
- $_tmplallsrcs
-
- # TMPLFPSRCS = [fdp]p-bit.c
- grep '[fdt]p-bit\.c' <$_tmplallsrcs | sort -u | \
- writefile ${libgcc_db_tmplsrcs}.tmplfpsrcs.${_lib%.*}
-
- # TMPLASMSRCS = $(LIB1ASMSRC)
- grep '\$(LIB1ASMSRC)' <$_tmplallsrcs | sort -u | \
- writefile ${libgcc_db_tmplsrcs}.tmplasmsrcs.${_lib%.*}
-
- # TMPLSRCS is anything else; exclude TMPLFPSRCS and TMPLASMSRCS
- cat $_tmplallsrcs | \
- comm -23 /dev/stdin $_TOP/${libgcc_db_tmplsrcs}.tmplfpsrcs.${_lib%.*} | \
- comm -23 /dev/stdin $_TOP/${libgcc_db_tmplsrcs}.tmplasmsrcs.${_lib%.*} | \
- writefile ${libgcc_db_tmplsrcs}.tmplsrcs.${_lib%.*}
-
- rm -f $_tmplallsrcs
Home |
Main Index |
Thread Index |
Old Index