Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/share/mk Deal with crti and crtn not present in some EXTERNA...
details: https://anonhg.NetBSD.org/src/rev/a0ec3ac75194
branches: trunk
changeset: 783201:a0ec3ac75194
user: pooka <pooka%NetBSD.org@localhost>
date: Mon Dec 10 20:58:55 2012 +0000
description:
Deal with crti and crtn not present in some EXTERNAL_TOOLCHAIN's. Also,
handle "missing" crtstuff internally instead of depending on external
intervention.
diffstat:
share/mk/bsd.gcc.mk | 30 +++++++++++++++++++-----------
1 files changed, 19 insertions(+), 11 deletions(-)
diffs (45 lines):
diff -r 87db1169184d -r a0ec3ac75194 share/mk/bsd.gcc.mk
--- a/share/mk/bsd.gcc.mk Mon Dec 10 20:30:06 2012 +0000
+++ b/share/mk/bsd.gcc.mk Mon Dec 10 20:58:55 2012 +0000
@@ -1,22 +1,30 @@
-# $NetBSD: bsd.gcc.mk,v 1.7 2012/11/21 20:30:01 pooka Exp $
+# $NetBSD: bsd.gcc.mk,v 1.8 2012/12/10 20:58:55 pooka Exp $
.if !defined(_BSD_GCC_MK_)
_BSD_GCC_MK_=1
.if defined(EXTERNAL_TOOLCHAIN)
_GCC_CRTBEGIN!= ${CC} --print-file-name=crtbegin.o
-.ifndef _GCC_CRTBEGINS
-_GCC_CRTBEGINS!= ${CC} --print-file-name=crtbeginS.o
-.endif
_GCC_CRTEND!= ${CC} --print-file-name=crtend.o
-.ifndef _GCC_CRTENDS
-_GCC_CRTENDS!= ${CC} --print-file-name=crtendS.o
-.endif
-_GCC_CRTI!= ${CC} --print-file-name=crti.o
-_GCC_CRTN!= ${CC} --print-file-name=crtn.o
-_GCC_CRTDIR!= dirname ${_GCC_CRTBEGIN}
-_GCC_LIBGCCDIR!= dirname `${CC} --print-libgcc-file-name`
+
+# If the toolchain does not know about a file, --print-file-name echoes
+# the input file name (why??). In that case we want an empty string for
+# dependencies to work correctly. Note: do _not_ use TOOL_SED here because
+# this file is used before TOOL_SED is built.
+_GCC_CRTBEGINS!= ${CC} --print-file-name=crtbeginS.o \
+ | sed 's|^crtbeginS.o$$||'
+_GCC_CRTENDS!= ${CC} --print-file-name=crtendS.o \
+ | sed 's|^crtendS.o$$||'
+_GCC_CRTI!= ${CC} --print-file-name=crti.o \
+ | sed 's|^crti.o$$||'
+_GCC_CRTN!= ${CC} --print-file-name=crtn.o \
+ | sed 's|^crtn.o$$||'
+
+_GCC_CRTDIR!= dirname ${_GCC_CRTBEGIN}
+_GCC_LIBGCCDIR!= dirname `${CC} --print-libgcc-file-name`
+
.else
+
_GCC_CRTBEGIN?= ${DESTDIR}/usr/lib/crtbegin.o
_GCC_CRTBEGINS?= ${DESTDIR}/usr/lib/crtbeginS.o
_GCC_CRTEND?= ${DESTDIR}/usr/lib/crtend.o
Home |
Main Index |
Thread Index |
Old Index