public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Linking cc1 to external libraries
@ 2003-04-17 13:14 Alexandre Courbot
  2003-04-17 13:15 ` Andrew Pinski
  0 siblings, 1 reply; 5+ messages in thread
From: Alexandre Courbot @ 2003-04-17 13:14 UTC (permalink / raw)
  To: GCC Mailing List

Hi everybody,

I wandered around the doc and the Makefiles, and have found no way to add 
additional libraries to link to for cc1. I need the compiler (and only the 
compiler) to link to one library that is installed on the system (using -L 
and -l options), but at first sight it doesn't seem possible. As a workaround 
I've included my library as a part of the backend, but that quite... gruiiik.

I know this is not something really common - but do someone know of a way to 
require additional linking when building cc1? That could be useful, and if it 
isn't possible yet it wouldn't require much more than an additional Makefile 
variable that the backend programmer could override...

Alex.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Linking cc1 to external libraries
  2003-04-17 13:14 Linking cc1 to external libraries Alexandre Courbot
@ 2003-04-17 13:15 ` Andrew Pinski
  2003-04-17 14:05   ` Alexandre Courbot
  2003-04-17 16:16   ` Alexandre Courbot
  0 siblings, 2 replies; 5+ messages in thread
From: Andrew Pinski @ 2003-04-17 13:15 UTC (permalink / raw)
  To: Alexandre Courbot; +Cc: Andrew Pinski, GCC Mailing List

I would look the variable `LIBS' (located around line 693 on the 
mainline).

Thanks,
Andrew Pinski


On Thursday, Apr 17, 2003, at 08:45 US/Eastern, Alexandre Courbot wrote:

> Hi everybody,
>
> I wandered around the doc and the Makefiles, and have found no way to 
> add
> additional libraries to link to for cc1. I need the compiler (and only 
> the
> compiler) to link to one library that is installed on the system 
> (using -L
> and -l options), but at first sight it doesn't seem possible. As a 
> workaround
> I've included my library as a part of the backend, but that quite... 
> gruiiik.
>
> I know this is not something really common - but do someone know of a 
> way to
> require additional linking when building cc1? That could be useful, 
> and if it
> isn't possible yet it wouldn't require much more than an additional 
> Makefile
> variable that the backend programmer could override...
>
> Alex.
>
>
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Linking cc1 to external libraries
  2003-04-17 13:15 ` Andrew Pinski
@ 2003-04-17 14:05   ` Alexandre Courbot
  2003-04-17 16:16   ` Alexandre Courbot
  1 sibling, 0 replies; 5+ messages in thread
From: Alexandre Courbot @ 2003-04-17 14:05 UTC (permalink / raw)
  To: Andrew Pinski; +Cc: GCC Mailing List

> I would look the variable `LIBS' (located around line 693 on the
> mainline).

I had seen it too - unfortunately, it is used not only when linking cc1, but 
also for xgcc and cpp. Of course, it wouldn't hurt much to have these linked 
to the library as well, since cc1 would be. But it's certainly not the 
cleanest way to do. In my mind, since only cc1 need this lib, it doesn't make 
sense to link the other programs with it too.

Anyway, your mail made me think again about it, and it seems that it would be 
less hassle than including the lib to the backend. The problem (or should I 
rather say feature) still remains half-open, though.

Thanks!
Alex.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Linking cc1 to external libraries
  2003-04-17 13:15 ` Andrew Pinski
  2003-04-17 14:05   ` Alexandre Courbot
@ 2003-04-17 16:16   ` Alexandre Courbot
  2003-04-17 16:39     ` Alexandre Courbot
  1 sibling, 1 reply; 5+ messages in thread
From: Alexandre Courbot @ 2003-04-17 16:16 UTC (permalink / raw)
  To: Andrew Pinski; +Cc: GCC Mailing List

> I would look the variable `LIBS' (located around line 693 on the
> mainline).

Ah, actually I don't think it would work. The backend's Makefile fragments are 
outputted before LIBS is initially set, which results in an override of any 
value you would have put in it.

Alex.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Linking cc1 to external libraries
  2003-04-17 16:16   ` Alexandre Courbot
@ 2003-04-17 16:39     ` Alexandre Courbot
  0 siblings, 0 replies; 5+ messages in thread
From: Alexandre Courbot @ 2003-04-17 16:39 UTC (permalink / raw)
  To: Andrew Pinski; +Cc: GCC Mailing List

> > I would look the variable `LIBS' (located around line 693 on the
> > mainline).
>
> Ah, actually I don't think it would work. The backend's Makefile fragments
> are outputted before LIBS is initially set, which results in an override of
> any value you would have put in it.

Woops. And I forgot that when linking cc1, -lstdc++ must obviously be 
specified, otherwise there will obviously be loads of undefined references. 
So in any way, I must be able to specify additional libraries for cc1. Since 
I'm manually modifying the generated Makefile for now, I'm open to any 
suggestion! :)

Alex.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2003-04-17 13:46 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-04-17 13:14 Linking cc1 to external libraries Alexandre Courbot
2003-04-17 13:15 ` Andrew Pinski
2003-04-17 14:05   ` Alexandre Courbot
2003-04-17 16:16   ` Alexandre Courbot
2003-04-17 16:39     ` Alexandre Courbot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).