This is the mail archive of the
mailing list for the Cygwin project.
Re: Gcc/ld and long command lines (> 32k)
Ross Ridge wrote:
> You can try using an implicit linker script. Create a file, call it
> something like "my-ld-script", with lines like the following:
> INPUT(obj1.o obj2.o obj3.o)
> INPUT(obj4.o, obj5.o, obj6.o)
> And then instead of linking with a command that looks something like this:
> gcc -o foo.exe obj1.o obj2.o ... obj7.o -lbar -lbaz
> Use something like this:
> gcc -o foo.exe my-ld-script -lbar -lbaz
> Ross Ridge
Many thanks !
This was just the kind of thing I was looking for.
By tweaking my build tool, it will be an easy thing to switch to this
kind of command line automatically when the command line gets too long
(and generating a linker script "on the fly").
I actually printed out the LD manual ("Using ld") yesterday.
But I missed the way "linker scripts" could be specified, when I first
looked through the text.
Just to test it, I will probably also try the @filename feature to
gcc.exe together with the "mount -X" to make gcc.exe communicate with
collect2/ld via the cygwin-specific way of passing arc/argv.
Thanks a lot for all the helpful answers.
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html