Don't define USED_FOR_TARGET on the command line.
authorSimon Schubert <corecode@dragonflybsd.org>
Thu, 23 Aug 2007 06:52:02 +0000 (06:52 +0000)
committerSimon Schubert <corecode@dragonflybsd.org>
Thu, 23 Aug 2007 06:52:02 +0000 (06:52 +0000)
commitcac7e294a86cec041ddc551efa4a8b313843247b
tree64c173180fafaa33022dc779d93d605f381ed961
parent23f5c568d53582ccaf4658834509d65065ec8671
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