This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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)
>         INPUT(obj7.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.

/Johan Holmberg


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


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