This is the mail archive of the gcc@gcc.gnu.org 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]

Re: order of switches


Alexandre Oliva wrote:
> >    In one instance I had to move -l after the .o file
> >    so that gcc does not silently ignore -l
> 
> It doesn't.  It passes it to the linker, that opens the library but
> figures out it doesn't need any symbol from it. 
> Then it gets to the .o files.  Maybe SunCC reorders flags, or some implicit
> object file it links in before any library imports the symbols you need from
> it.
 
  Well.. I can say that with SunCC, when using shared libs,
  I never get "undefined" symbols due to bad ordering. 
  (It's not as nice with static libs though). I think that,
  at minimum, it processes all libs and all object files in
  just two pieces, rather than "some libs first, then some
  object files, then more libs, more obj"...
  I can see that this may be somewhat limiting, but in practice
  it's much more convenient.

> >    In another instance I was bitten by both -Ixxx and -I being
> >    legal (I defined STL="" because g++ has a good STL inside)
> 
> `-I dir' is legal because some compilers accept it, SunCC included.
> You're the one causing the difference, by setting STL="", misled by
> whoever designed the Makefile in a way that makes it hard for one to
> disable the flag to search for STL.  You could probably make it work
> with STL="unneeded"

   that's right

> >> >   I just grep'ed man g++ for "order" and it there were no matches.
> 
> >> The man pages are very minimal guides to the option flags.  The real
> >> documentation of GCC is in the texinfo files.

   hmm...man g++ never mentions textinfo
   (I saw other man pages doing that).
   To be honest, I am not a big fan of textinfo 
   (I am a vi-head, and textinfo causes emacs)
   but at least I can browse HTML versions of all textinfo
   pages on RH6.0

   Alexandre, don't take the conspiracy theory too close to your
   heart ;-)    

								Igor
-- 
  Igor Markov  office: (310) 206-0179   
  http://vlsicad.cs.ucla.edu/~imarkov


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