Tuomo Valkonen <[EMAIL PROTECTED]> writes:

[...]

> In the usual case of linear dependencies, all it would have to do is
> remember the symbols and libraries already seen, and search them
> instead of suffering from amnesia. It should _not_ be up to the user
> to order the libraries on the command line. I guess GCC programmers
> don't care about user-friendliness, or it is designed for some
> higher-level build tools yet to be written... after hurd is
> finished.

Well, presumably it's the linker, not GCC as such.  So that might be
GNU ld (from binutils?) or some other random linker, depending on what
OS, and the configuration of gcc.

Indeed, I notice that John Levine has a bit of a rant in the classic
"Linkers & Loaders":

    UNIX linkers and many MS Windows linkers take an intermixed list
    of object files and libraries on the command line or in a control
    file and process each in order, so the programmer can control the
    order in which objects are loaded and libraries are searched.
    Although in principle this offers a great deal of flexibility
    [...], in practice the ordered search provides little extra
    utility. [...]

    [...] Because there are rarely any duplicated symbols among the
    libraries, if the linker simply searched them all as a group (as
    IBM mainframe linkers and AIX linker do) programmers would be well
    served.

I wonder if POSIX has standardised this suboptimal behaviour?

[...]

Reply via email to