delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2004/04/09/06:05:33

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Date: Fri, 9 Apr 2004 12:05:14 +0200 (MEST)
From: Johan Holmberg <holmberg AT iar DOT se>
To: Cygwin List <cygwin AT cygwin DOT com>
Subject: Re: Gcc/ld and long command lines (> 32k)
In-Reply-To: <Pine.GSO.4.50.0404082128460.8775-100000@pjakkur.iar.se>
Message-ID: <Pine.GSO.4.50.0404091133320.14210-100000@pjakkur.iar.se>
References: <Pine DOT GSO DOT 4 DOT 50 DOT 0404081719370 DOT 380-100000 AT pjakkur DOT iar DOT se> <6 DOT 0 DOT 1 DOT 1 DOT 0 DOT 20040408115748 DOT 039fb948 AT 127 DOT 0 DOT 0 DOT 1> <Pine DOT GSO DOT 4 DOT 50 DOT 0404082128460 DOT 8775-100000 AT pjakkur DOT iar DOT se>
MIME-Version: 1.0

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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019