This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: RFA: Adding feature for putting system libraries for pe-coff targets as last in link order
Kai Tietz <ktietz70@googlemail.com> writes:
> Well, as example (btw this could be done also in gcc driver but I
> think a linker option for this is easier) the command 'gcc -o tst my.c
> -lmsvcrt'. For this example the import library of libmsvcrt.a will be
> linked before the libmingwex.a (specified by gcc spec).
> For code of my.c:
> #include <math.h>
> #include <stdio.h>
>
> int main (int argc, char **argv)
> {
> printf ("Pow(%d)=%g\n", argc, pow ((double) argc, 2.0));
> return 0;
> }
>
> For this example above the function 'pow' will be taken from
> msvcrt.dll. If you omit the -lmsvcrt option, it is taken from
> libmingwex.a.
I think that for special purposes the right approach is to use gcc's
-nodefaultlibs option and specify the library yourself.
For general purpose it seems to me that a gcc spec patch would be
appropriate.
Ian