From ae7c8a2bb8d926e24ef7ccf3a3e091d2d1fbc280 Mon Sep 17 00:00:00 2001 From: "David E. O'Brien" Date: Sat, 28 Oct 2000 21:26:48 +0000 Subject: * Bring back the guts of crt{i,n}.S. This allows C++ exceptions to work when using the egcs and gcc-devel ports, along with GCC built from stock public FSF sources. With out this change, FreeBSD will be removed from the list of systems GCC 3.0 must be evaluated on before release. With the effort some of us put into getting FreeBSD on this list, we should not turn this effort into a waste, else we might not be worth fighting for in the future. (note that Alpha and IA-64 versions of crt{i,n}.S are needed) * Switch from our own crt{begin,in} to those created from GCC's crtstuff.c. This will allow us to switch to DWARF2 exceptions in the future, along with staying in sync with any future GCC requirements. * Break out our ELF branding bits into a seperate file. Currently this is now included by our crt1.c files (since this functionality was part of our native crtbegin.c). Later crtbrand.o will be merged in the creation of crti.o. --- gnu/lib/Makefile | 2 +- gnu/lib/csu/Makefile | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 57 insertions(+), 1 deletion(-) create mode 100644 gnu/lib/csu/Makefile (limited to 'gnu/lib') diff --git a/gnu/lib/Makefile b/gnu/lib/Makefile index a577f54e3e32..e2accacdcf34 100644 --- a/gnu/lib/Makefile +++ b/gnu/lib/Makefile @@ -1,6 +1,6 @@ # $FreeBSD$ -SUBDIR= libdialog libgcc libgcc_r libgmp libmp libregex libreadline +SUBDIR= csu libdialog libgcc libgcc_r libgmp libmp libregex libreadline .if !defined(NO_CXX) SUBDIR+= libstdc++ diff --git a/gnu/lib/csu/Makefile b/gnu/lib/csu/Makefile new file mode 100644 index 000000000000..3a94ab8d84e5 --- /dev/null +++ b/gnu/lib/csu/Makefile @@ -0,0 +1,56 @@ +# $FreeBSD$ + +GCCDIR= ${.CURDIR}/../../../contrib/gcc.295 +.PATH: ${GCCDIR} + +SRCS= crtstuff.c tm.h +OBJS= crtbegin.o crtend.o +SOBJS= crtbegin.So crtend.So +CFLAGS+= -I${GCCDIR}/config -I. -DIN_GCC \ + -finhibit-size-directive -fno-inline-functions \ + -fno-exceptions -fno-omit-frame-pointer +NOMAN= true +NOPIC= true +NOPROFILE= true +INTERNALLIB= true +CLEANFILES+= tm.h + +CRTS_CFLAGS= -DCRTSTUFFS_O ${PICFLAG} + +all: ${OBJS} ${SOBJS} + +crtbegin.o: crtstuff.c tm.h + ${CC} ${CFLAGS} -g0 -DCRT_BEGIN \ + -c -o ${.TARGET} ${GCCDIR}/crtstuff.c + +crtbegin.So: crtstuff.c tm.h + ${CC} ${CFLAGS} -g0 -DCRT_BEGIN ${CRTS_CFLAGS} \ + -c -o ${.TARGET} ${GCCDIR}/crtstuff.c + +crtend.o: crtstuff.c tm.h + ${CC} ${CFLAGS} -g0 -DCRT_END \ + -c -o ${.TARGET} ${GCCDIR}/crtstuff.c + +crtend.So: crtstuff.c tm.h + ${CC} ${CFLAGS} -g0 -DCRT_END ${CRTS_CFLAGS} \ + -c -o ${.TARGET} ${GCCDIR}/crtstuff.c + +# KEEP THIS IN SYNC with src/gnu/usr.bin/cc/cc_tools/Makefile !! +tm.h: + echo '#include "${MACHINE_ARCH}/${MACHINE_ARCH}.h"' > ${.TARGET} +.if ${MACHINE_ARCH} == "i386" + echo '#include "${MACHINE_ARCH}/att.h"' >> ${.TARGET} +.endif + echo '#include ' >> ${.TARGET} + echo '#include "${MACHINE_ARCH}/freebsd.h"' >> ${.TARGET} +.if ${MACHINE_ARCH} == "i386" + echo '#include "${MACHINE_ARCH}/perform.h"' >> ${.TARGET} +.endif + +realinstall: +.for file in ${OBJS} ${SOBJS} + ${INSTALL} ${COPY} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ + ${file} ${DESTDIR}${LIBDIR}/${file:S/.So$/S.o/} +.endfor + +.include -- cgit v1.3