summaryrefslogtreecommitdiff
path: root/gnu/lib
diff options
context:
space:
mode:
authorjmc <jmc@NetBSD.org>2001-12-02 12:23:52 +0000
committerjmc <jmc@NetBSD.org>2001-12-02 12:23:52 +0000
commitd08eaff246f855a244ff074475eccb4452b25423 (patch)
tree9c16f83407e946ed47a441f778dc1847e06db446 /gnu/lib
parente2387142a7689b5e5011157ac6ebbb4c3d54f3a7 (diff)
While gcc may automatically add -fexecptions to c++ code it will only do that
for files named .cc or .C. _eh gets generated into a .c file so we need explicit rules for it's targets (.o .po and .so) to compile it correctly. Without this exceptions just plain don't work. Nothing ever gets caught.
Diffstat (limited to 'gnu/lib')
-rw-r--r--gnu/lib/libgcc/Makefile14
1 files changed, 12 insertions, 2 deletions
diff --git a/gnu/lib/libgcc/Makefile b/gnu/lib/libgcc/Makefile
index 7a35c74151b..1d5b72bc6e3 100644
--- a/gnu/lib/libgcc/Makefile
+++ b/gnu/lib/libgcc/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.29 2001/12/02 03:06:55 jmc Exp $
+# $NetBSD: Makefile,v 1.30 2001/12/02 12:23:52 jmc Exp $
REQUIRETOOLS= yes
@@ -25,11 +25,12 @@ CPPFLAGS+= -I${GCCARCH} ${GCPPFLAGS:M-D*} ${GCPPFLAGS:M-I*:N-I.*} \
CFLAGS+= -msoft-quad-float
.endif
-LIB2FUNCS= ${G_LIB2FUNCS:=.c} ${G_LIB2FUNCS_EH:=.c}
+LIB2FUNCS= ${G_LIB2FUNCS:=.c}
CXX_LIB2FUNCS= ${G_CXX_LIB2FUNCS:Mop*:S/opdel.o/opdelete.o/:.o=.cc}
SRCS+= ${LIB2FUNCS} ${CXX_LIB2FUNCS} \
${G_CXX_LIB2FUNCS:Nop*:.o=.cc} ${G_LIB2ADD:M*.c:T}
+OBJS+= ${G_LIB2FUNCS_EH:=.o}
# XXX fp-bit.c should be removed from this list after some grace period.
CLEANFILES+= ${LIB2FUNCS} ${CXX_LIB2FUNCS} dp-bit.c fp-bit.c
@@ -37,6 +38,15 @@ CLEANFILES+= ${LIB2FUNCS} ${CXX_LIB2FUNCS} dp-bit.c fp-bit.c
${LIB2FUNCS}: ${.CURDIR}/Makefile
printf '#define L${.PREFIX}\n#include <libgcc2.c>\n' >${.TARGET}
+${G_LIB2FUNCS_EH:=.o}: libgcc2.c
+ ${COMPILE.c} -fexceptions -DL$* -o $@ ${>:M*.c}
+
+${G_LIB2FUNCS_EH:=.po}: libgcc2.c
+ ${COMPILE.c} -pg -fexceptions -DL$* -o $@ ${>:M*.c}
+
+${G_LIB2FUNCS_EH:=.so}: libgcc2.c
+ ${COMPILE.c} ${CPICFLAGS} -fexceptions -DL$* -o $@ ${>:M*.c}
+
${CXX_LIB2FUNCS}: ${.CURDIR}/Makefile
printf '#define L_op_${.PREFIX:S/^op//}\n#include <new1.cc>\n#include <new2.cc>\n' >${.TARGET}