Usenet comp.os.linux.alpha (1997-2013)
 help / color / mirror / Atom feed
* Compiling against a static libots using Compaq ccc
@ 2000-07-06  4:00 David Addison
  2000-07-06  4:00 ` Tony Hammitt
  0 siblings, 1 reply; 3+ messages in thread
From: David Addison @ 2000-07-06  4:00 UTC (permalink / raw)


Hi, does any one now how to make a dynamic executable that uses the the
static libots library when using the Compaq ccc compiler ? I want to use
ccc to compile my files, but not have to onward distribute the libots RPM
(this is allowed under their licence terms).

The obvious method;

ccc -o blob blob.c /usr/lib/libots.a

still ends up with the 'blob' binary linked against libots.so
I can compile to 'blob.o' and then use gcc to link, but that's a bit ugly.

Any other suggestions ?

Cheers,. Addy.



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

* Re: Compiling against a static libots using Compaq ccc
  2000-07-06  4:00 Compiling against a static libots using Compaq ccc David Addison
@ 2000-07-06  4:00 ` Tony Hammitt
  2000-07-07  4:00   ` David Addison
  0 siblings, 1 reply; 3+ messages in thread
From: Tony Hammitt @ 2000-07-06  4:00 UTC (permalink / raw)


How big of an executable can you stand? =-]

ccc supports the "-static" flag, just like gcc, but it's just as
literal as gcc.  You can't choose what you want to be statically
linked, you get everything including libc stuff.  I tried it on
a 60 line program and it linked to 2.1MB...  stripped to 380K

This, too is a bit ugly.

Regards,

Tony Hammitt


David Addison wrote:
> 
> Hi, does any one now how to make a dynamic executable that uses the the
> static libots library when using the Compaq ccc compiler ? I want to use
> ccc to compile my files, but not have to onward distribute the libots RPM
> (this is allowed under their licence terms).
> 
> The obvious method;
> 
> ccc -o blob blob.c /usr/lib/libots.a
> 
> still ends up with the 'blob' binary linked against libots.so
> I can compile to 'blob.o' and then use gcc to link, but that's a bit ugly.
> 
> Any other suggestions ?
> 
> Cheers,. Addy.



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

* Re: Compiling against a static libots using Compaq ccc
  2000-07-06  4:00 ` Tony Hammitt
@ 2000-07-07  4:00   ` David Addison
  0 siblings, 0 replies; 3+ messages in thread
From: David Addison @ 2000-07-07  4:00 UTC (permalink / raw)


In article <3964ED2F.11E55C62@kc.rr.com>, Tony Hammitt
<thammitt@kc.rr.com> wrote:

> How big of an executable can you stand? =-]
> 
> ccc supports the "-static" flag, just like gcc, but it's just as literal
> as gcc.  You can't choose what you want to be statically linked, you get
> everything including libc stuff.  I tried it on a 60 line program and it
> linked to 2.1MB...  stripped to 380K
> 
> This, too is a bit ugly.
> 
Yes, I guess its the same with gcc and libc. Simply putting
/usr/lib/libc.a on the command line has no effect. The difference is that
everyone has libc already installed!

The Compaq ccc compiler uses the standard ld as follows;

/usr/lib/compaq/ccc-6.2.9.002-2/alpha-linux/bin/ld -o blob -O1
-melf64alpha
 -G 8 -L/usr/lib/compaq/ccc-6.2.9.002-2/alpha-linux/lib
-L/usr/local/lib -L/usr/alpha-redhat-linux/lib
-L/usr/lib/gcc-lib/alpha-redhat-linux/egcs-2.91.66
 -dynamic-linker /lib/ld-linux.so.2 
/usr/lib/compaq/ccc-6.2.9.002-2/alpha-linux/bin/crt1.o
/usr/lib/compaq/ccc-6.2.9.002-2/alpha-linux/bin/crti.o
/usr/lib/compaq/ccc-6.2.9.002-2/alpha-linux/bin/crtbegin.o blob.o -lgcc
-lc -lgcc -lots /usr/lib/compaq/ccc-6.2.9.002-2/alpha-linux/bin/crtend.o
/usr/lib/compaq/ccc-6.2.9.002-2/alpha-linux/bin/crtn.o 

And its the -lots that gets us, even with /usr/lib/libots.a included in
this command, it still links dynamically. Removing -lots from this link
command seems to be the only fix.

Oh well, perhaps using gcc to link is not that bad after all !

Thanks for you help, Addy.



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

end of thread, other threads:[~2000-07-07  4:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2000-07-06  4:00 Compiling against a static libots using Compaq ccc David Addison
2000-07-06  4:00 ` Tony Hammitt
2000-07-07  4:00   ` David Addison

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox