question about -specs and prefix setup

Tom Tromey tromey@cygnus.com
Tue Jun 22 12:41:00 GMT 1999


In gcc.c I see this:

  /* If not cross-compiling, look for startfiles in the standard places.  */
  /* The fact that these are done here, after reading the specs file,
     means that it cannot be found in these directories.
     But that's okay.  It should never be there anyway.  */

In my case, I want a specs file to be found in one of these
directories.

Some background: the Java runtime supplies a specs file (which is read
in addition to the standard specs file) that lists all the libraries
required by default when linking a Java application.  The Java front
end reads this specs file when it determines that the user is trying
to link a program.  In the ordinary case it does this by adding
`-specs=libgcj.spec' to the command line via lang_specific_driver().

However, we recently changed libgcj so that the libraries would be
installed in libdir when doing a native build (we still use tooldir
for cross compiles).  This seems to follow what other libraries do,
and it also seems like the right thing to do.

I think the easiest fix, for me, would be to change gcc.c so that
specs files are read after setting up the startfile prefixes.
However, I'm not sure whether that would break anything.

Other fixes are likely to either be far more complicated (e.g., we'd
have to handle GCC_EXEC_PREFIX on our own in jvspec.c -- ugly), or not
very robust (hard-coding the default libdir would work in the common
case but wouldn't respect location independence).

Tom


More information about the Gcc mailing list