This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RFC: Support for optional library files in specs

For a while now, I've bene thinking about moving NetBSD over to using
GCC's crtstuff (it currently uses its own because NetBSD's crtstuff
provides some things NetBSD needs which GCC's does not provide).

In order to do this, I need to split out the NetBSD-specific bits into
separate start/end files ... no problem, this is easy to do.

However, I then have the issue of a flag day to contend with, which
doesn't particularly fill me with joy and happiness.

What I'd like to do, then, is add support for optional library files in
specs, in order to avoid the flag day.  For example, if an optional library
file were denoted with the %@ suffix, then my start/end file specs could
look like:

#define STARTFILE_SPEC          \
  "%{!shared:                   \
     %{pg:gcrt0%O%s}            \
     %{!pg:                     \
       %{p:gcrt0%O%s}           \
       %{!p:crt0%O%s}}}         \
   crti%O%@                     \
   %{!shared:crtbegin%O%s} %{shared:crtbeginS%O%s}"

#define ENDFILE_SPEC            \
  "%{!shared:crtend%O%s} %{shared:crtendS%O%s} \

...and the optional files would not be inserted into the command if
not found.

This looks quite easy to implement in the spec processing code.  If people
think this is a reasonable idea, then I'll be happy to make the necessary
changes (for b-i-b, cross fingers for 3.3 branch sometime in the future),
but obviously I don't want to spend time working on a patch that will be
rejected :-)

        -- Jason R. Thorpe <>

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]