From cac7e294a86cec041ddc551efa4a8b313843247b Mon Sep 17 00:00:00 2001 From: Simon Schubert Date: Thu, 23 Aug 2007 06:52:02 +0000 Subject: [PATCH] Don't define USED_FOR_TARGET on the command line. This produces all kinds of side effects, ultimately leading to the csu sources and the compiler being out of sync on compilation, thus triggering an internal compiler error. Details for the curious and for historical purposes: Our gcc is configured to work with a ld which can merge ro and rw sections to rw sections. Nevertheless cc1 will enforce sections in one unit to be of one type or the other, i.e. it disallows section flag changes. Sections are usually a compiler internal detail, so a flag change is considered a compiler bug and thus cc1 aborts with an internal compiler error on such occasions. The csu libs consider themselves as part of the compiler and use section declarations. However if the lib and the compiler don't agree on some settings and are out of sync, the lib will decide to create a rw .eh_frame section (by not declaring a variable constant). If the compiler uses the .eh_frame section as well, like gcc41/amd64 does to store dwarf2 exception rollback information, the above mentioned internal compiler error is triggered. The essential problem here was that USED_FOR_TARGET will prevent the auto-host.h/dragonfly-native.h config.h-style headers to set the necessary compiler configuration which is also used by the csu libs. By moving it to the place where the gcc people intended it to be, everything works as desired. --- gnu/lib/csu/Makefile.csu | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/gnu/lib/csu/Makefile.csu b/gnu/lib/csu/Makefile.csu index 61c33fc8d2..cc9a67e336 100644 --- a/gnu/lib/csu/Makefile.csu +++ b/gnu/lib/csu/Makefile.csu @@ -1,5 +1,5 @@ # $FreeBSD: src/gnu/lib/csu/Makefile,v 1.24 2004/09/10 06:48:04 ru Exp $ -# $DragonFly: src/gnu/lib/csu/Makefile.csu,v 1.1 2007/01/15 18:01:44 corecode Exp $ +# $DragonFly: src/gnu/lib/csu/Makefile.csu,v 1.2 2007/08/23 06:52:02 corecode Exp $ .include "${CSUDIR}/Makefile.csu" @@ -18,7 +18,6 @@ CFLAGS+= -finhibit-size-directive -fno-inline-functions \ -fno-exceptions -fno-zero-initialized-in-bss \ -fno-omit-frame-pointer -fno-unit-at-a-time CFLAGS+= -I. -CFLAGS+= -DUSED_FOR_TARGET CRTS_CFLAGS= -DCRTSTUFFS_O -DSHARED ${PICFLAG} MKDEP= -DCRT_BEGIN -- 2.41.0