Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/tools/gcc Merge gcc-4.8 mknative bits.
details: https://anonhg.NetBSD.org/src/rev/ac0e2d5a898f
branches: trunk
changeset: 326790:ac0e2d5a898f
user: christos <christos%NetBSD.org@localhost>
date: Mon Feb 17 21:39:43 2014 +0000
description:
Merge gcc-4.8 mknative bits.
diffstat:
tools/gcc/Makefile | 76 ++++++-
tools/gcc/mknative-gcc48 | 421 ++++++++++++++++++++++++++++++++++++++++++++++
tools/gcc/mknative.common | 20 +-
3 files changed, 494 insertions(+), 23 deletions(-)
diffs (truncated from 658 to 300 lines):
diff -r e9168233bbad -r ac0e2d5a898f tools/gcc/Makefile
--- a/tools/gcc/Makefile Mon Feb 17 21:38:04 2014 +0000
+++ b/tools/gcc/Makefile Mon Feb 17 21:39:43 2014 +0000
@@ -1,14 +1,25 @@
-# $NetBSD: Makefile,v 1.62 2014/02/16 11:26:31 skrll Exp $
+# $NetBSD: Makefile,v 1.63 2014/02/17 21:39:43 christos Exp $
.include <bsd.own.mk>
GCC_LANGUAGES=c c++ objc
MODULE= gcc4
-.if ${HAVE_GCC} == 45
+.if ${HAVE_GCC} == 48
+CC_FOR_BUILD= ${HOST_CXX:Q}
+LIB_INTL=
+MKNATIVE= ${.CURDIR}/mknative-gcc48
+GNUHOSTDIST= ${.CURDIR}/../../external/gpl3/yagcc/dist
+.elif ${HAVE_GCC} == 45
GNUHOSTDIST= ${.CURDIR}/../../external/gpl3/gcc/dist
+UNWIND_H=unwind.h
.endif
+# Defaults
+CC_FOR_BUILD?= ${HOST_CC:Q}
+LIB_INTL?= "LIBS=-lintl"
+MKNATIVE?= ${.CURDIR}/mknative-gcc
+
.if ${MACHINE_ARCH} == "x86_64" || ${MACHINE_ARCH} == "sparc64"
MULTILIB_ARGS= --enable-multilib
.else
@@ -36,6 +47,7 @@
CONFIGURE_ARGS= ${COMMON_CONFIGURE_ARGS}
.if ${HAVE_GCC} >= 45
CONFIGURE_ARGS+= \
+ --with-sysroot=${DESTDIR} \
--with-mpc=${TOOLDIR} \
--with-mpfr=${TOOLDIR} \
--with-gmp=${TOOLDIR}
@@ -47,8 +59,7 @@
--program-transform-name="s,^,${MACHINE_GNU_PLATFORM}-," \
--enable-languages="${GCC_LANGUAGES}"
-GCC_CPPFLAGS= -DNETBSD_TOOLS -DTARGET_SYSTEM_ROOT=0 \
- -DTARGET_SYSTEM_ROOT_RELOCATABLE
+GCC_CPPFLAGS= -DNETBSD_TOOLS
MAKE_ARGS= MACHINE= MAKEINFO=${TOOL_MAKEINFO:Q} \
LIBGCC= LIBGCC1= LIBGCC1_TEST= LIBGCC2= INSTALL_LIBGCC= \
@@ -67,11 +78,17 @@
#
# mknative-gcc specific stuff
#
+
MKNATIVE_CONFIG_TARGET_LIBS= \
configure-target-libstdc++-v3 \
configure-target-libobjc
-.if ${HAVE_GCC} == 45
+.if ${HAVE_GCC} == 48
+MKNATIVE_CONFIG_TARGET_LIBS += configure-target-libgcc
+MKNATIVE_TARGET= gcc48
+MKNATIVE_CONFIG_TARGET_LIBS+= \
+ configure-target-libgomp
+.elif ${HAVE_GCC} == 45
MKNATIVE_TARGET= gcc45
MKNATIVE_CONFIG_TARGET_LIBS+= \
configure-target-libgomp
@@ -81,8 +98,11 @@
BINENV= /usr/bin/env -i
+
MKNATIVE_ENV= ${BINENV} ${CONFIGURE_ENV:NC*:NLD*} \
- CC_FOR_BUILD=${HOST_CC:Q} \
+ CC_FOR_BUILD=${CC_FOR_BUILD:Q} \
+ CXX_FOR_BUILD=${HOST_CXX:Q} \
+ CFLAGS_FOR_BUILD="-I${TOOLDIR}/include" \
CC=${CC:Q}' '${CCADDFLAGS:Q} \
CXX=${CXX:Q}' '${CCADDFLAGS:Q}' '${CXXADDFLAGS:Q} \
CPP=${CPP:Q}' '-I${DESTDIR}/usr/include \
@@ -91,7 +111,7 @@
MSGFMT=${TOOLDIR}/bin/${_TOOL_PREFIX}msgfmt \
NM=${NM:Q} OBJDUMP=${OBJDUMP:Q} \
XGETTEXT=${TOOLDIR}/bin/${_TOOL_PREFIX}xgettext \
- LIBS=-lintl \
+ ${LIB_INTL} \
ac_cv_prog_cc_cross=yes \
ac_cv_func_strcoll_works=yes \
ac_cv_func_elf_getshstrndx=no \
@@ -114,19 +134,28 @@
# NEWCONFIGDIR can be set to a read-write location of the source tree
# in case the version being used is not.
NEWCONFIGDIR?= ${.CURDIR}/../..
-MKNATIVE?= ${.CURDIR}/mknative-gcc
bootstrap-libgcc: .configure_done
@echo 'Creating files needed for libgcc by a native bootstrap build.'
- @MAKE=${BUILD_MAKE:Q} ${HOST_SH} ${MKNATIVE} lib${MKNATIVE_TARGET} \
+ (cd ${.OBJDIR}/build && ${BUILD_COMMAND} configure-target-libgcc)
+ @MAKE=${BUILD_MAKE:Q} ${HOST_SH} ${MKNATIVE} lib${MKNATIVE_TARGET}-bootstrap \
${.OBJDIR}/build ${NEWCONFIGDIR} ${NETBSDSRCDIR} \
- ${MACHINE_GNU_PLATFORM} ${DESTDIR}
+ ${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.'
@MAKE=${BUILD_MAKE:Q} ${HOST_SH} ${MKNATIVE} ${MKNATIVE_TARGET} \
${.OBJDIR}/.native ${NEWCONFIGDIR} ${NETBSDSRCDIR} \
- ${MACHINE_GNU_PLATFORM} ${DESTDIR}
+ ${MACHINE_GNU_PLATFORM} ${DESTDIR} ${TOOLDIR}
NATIVE_CONFIGURE_ARGS= ${COMMON_CONFIGURE_ARGS}
.if ${HAVE_GCC} >= 45
@@ -137,24 +166,31 @@
MPFROBJ!= cd ${MPFR}/lib/libmpfr && ${PRINTOBJDIR}
GMPOBJ!= cd ${GMP}/lib/libgmp && ${PRINTOBJDIR}
+GMP_MACHINE_ARCH?= ${MACHINE_ARCH:S/earmv4/arm/:C/armv[5-7]/arm/}
+
NATIVE_CONFIGURE_ARGS+= \
--with-mpc-lib=${MPCOBJ} \
--with-mpfr-lib=${MPFROBJ} \
--with-gmp-lib=${GMPOBJ} \
--with-mpc-include=${MPC}/dist/src \
--with-mpfr-include=${MPFR}/dist/src \
- --with-gmp-include=${GMP}/lib/libgmp/arch/${MACHINE_ARCH}
+ --with-gmp-include=${GMP}/lib/libgmp/arch/${GMP_MACHINE_ARCH}
. if ${MACHINE_ARCH} != "vax"
NATIVE_CONFIGURE_ARGS+= --enable-tls
. endif
+. if !empty(MACHINE_ARCH:Mearm*)
+NATIVE_CONFIGURE_ARGS+= --enable-initfini-array
+. endif
.endif
NATIVE_CONFIGURE_ARGS+= \
--disable-multilib \
--disable-symvers \
--disable-libstdcxx-pch \
--build=`${GCCSRCDIR}/config.guess` \
- --host=${MACHINE_GNU_PLATFORM}
+ --host=${MACHINE_GNU_PLATFORM} \
+ --with-sysroot=${DESTDIR}
+MKENV_BUILD_MAKE=cd .native && ${MKNATIVE_ENV} ${BUILD_MAKE}
.native/.configure_done: ${_GNU_CFGSRC} ${.CURDIR}/Makefile
mkdir .native 2>/dev/null || true
@@ -162,11 +198,15 @@
(cd .native && ${MKNATIVE_ENV} \
${HOST_SH} ${GNUHOSTDIST}/configure \
${NATIVE_CONFIGURE_ARGS}) && \
- (cd .native && ${MKNATIVE_ENV} ${BUILD_MAKE} all-build-libiberty)
+ (${MKENV_BUILD_MAKE} all-build-libiberty) && \
+ ([ "${HAVE_GCC}" = "48" ] && \
+ (${MKENV_BUILD_MAKE} all-libcpp) && \
+ (${MKENV_BUILD_MAKE} all-libbacktrace) && \
+ (${MKENV_BUILD_MAKE} all-libdecnumber) || true)
PATH=${TOOLDIR}/bin:$$PATH; export PATH; \
- (cd .native && ${MKNATIVE_ENV} ${BUILD_MAKE} configure-gcc configure-libcpp) && \
- (cd .native && ${MKNATIVE_ENV} ${BUILD_MAKE} configure-libiberty) && \
- (cd .native && ${MKNATIVE_ENV} ${BUILD_MAKE} configure-libdecnumber)
+ (${MKENV_BUILD_MAKE} configure-gcc configure-libcpp) && \
+ (${MKENV_BUILD_MAKE} configure-libiberty) && \
+ (${MKENV_BUILD_MAKE} configure-libdecnumber)
# edit Makefile so that maybe-all-gcc does not depend on all-gcc any more.
(cd .native && mv Makefile Makefile.config && \
${TOOL_SED} -e 's/\(maybe-all-gcc:\) all-gcc/\1/' \
@@ -175,7 +215,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 e9168233bbad -r ac0e2d5a898f tools/gcc/mknative-gcc48
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/gcc/mknative-gcc48 Mon Feb 17 21:39:43 2014 +0000
@@ -0,0 +1,421 @@
+#!/bin/sh
+# $NetBSD: mknative-gcc48,v 1.1 2014/02/17 21:39:43 christos Exp $
+#
+# Shell script for generating all the constants needed for a native
+# platform build of gcc.
+#
+
+# initialise
+
+_TMPDIR=$2
+_TOP=$3
+_SRC=$4
+_PLATFORM=$5
+_DESTDIR=$6
+_TOOLDIR=$7
+_VPATH=`grep VPATH ${_TMPDIR}/Makefile | sed 's,^.*=[ ]*,,'`
+_GNU_DIST=`cd ${_VPATH}; pwd`
+
+if [ -z "$_DESTDIR" ]; then
+ echo "\$_DESTDIR is empty" 2>&1
+ exit 1
+fi
+
+. $_TOP/tools/gcc/mknative.common
+
+# default to GCC 4.1 for now
+_OUTDIR="$_TOP/gnu"
+_OUTDIRBASE="gnu"
+
+sanitise_includes () {
+ sed \
+ -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/[a-z_0-9-]*,,g" \
+ -e "s,-I$_TOOLDIR/include,,g" \
+ -e "s,-I/usr/include/[^ ]*,,"
+}
+
+##### lib/crtstuff #####
+
+get_crtstuff () {
+ _subdir="$1"
+ mkdir -p $_OUTDIR/lib/$_subdir/arch
+
+ getvars gcc/Makefile \
+ INCLUDES CRTSTUFF_CFLAGS CRTSTUFF_T_CFLAGS CRTSTUFF_T_CFLAGS_S \
+ tm_defines xm_file xm_defines \
+ | sanitise_includes \
+ | write_mk $_OUTDIRBASE/lib/$_subdir/arch/$MACHINE_ARCH.mk
+}
+
+##### lib/libg2c #####
+
+get_libg2c () {
+ 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
+
+ {
+ getvars $_PLATFORM/libf2c/Makefile \
+ F2CEXT
+ getvars $_PLATFORM/libf2c/libF77/Makefile \
+ ALL_CFLAGS OBJS
+ getvars $_PLATFORM/libf2c/libI77/Makefile \
+ 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
+}
+
+##### lib/libgcc #####
+
+get_libgcc () {
+ _subdir="$1"
+ mkdir -p $_OUTDIR/lib/lib$_subdir/arch
+
+ # DPBIT, FPBIT only used on mn10[23]00, we don't need them.
+ # XXX we should probably grab everything Just In Case for
+ # the future.
+
+ mkdir -p $_OUTDIR/lib/lib$_subdir/arch/$MACHINE_ARCH
+ cd $_TMPDIR/$_PLATFORM/libgcc
+ {
+ getvars $_PLATFORM/libgcc/Makefile \
+ INCLUDES LIB2ADD LIB2ADDEH LIB2ADD_ST \
+ LIB1ASMFUNCS LIB1ASMSRC \
+ LIB2_DIVMOD_FUNCS LIB2FUNCS_ST \
+ LIB2FUNCS_EXTRA \
+ LIBGCC2_CFLAGS \
+ SHLIB_MKMAP SHLIB_MKMAP_OPTS \
+ SHLIB_MAPFILES SHLIB_NM_FLAGS
+ getvars gcc/Makefile \
+ NOEXCEPTION_FLAGS EXTRA_HEADERS
+ getlinks config.status libgcc
+ } | sanitise_includes \
+ | write_mk $_OUTDIRBASE/lib/lib$_subdir/arch/$MACHINE_ARCH/defs.mk
+
+ for f in auto-target.h; do
+ write_c $_OUTDIRBASE/lib/lib$_subdir/arch/$MACHINE_ARCH/$f \
+ <$_TMPDIR/$_PLATFORM/libgcc/$f
+ done
+}
+
+##### lib/libgcov #####
+
+get_libgcov () {
+ _subdir="$1"
+ _mf="$2"
Home |
Main Index |
Thread Index |
Old Index