Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Compiling against a static libots using Compaq ccc

3 views
Skip to first unread message

David Addison

unread,
Jul 6, 2000, 3:00:00 AM7/6/00
to
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.

Tony Hammitt

unread,
Jul 6, 2000, 3:00:00 AM7/6/00
to
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

unread,
Jul 7, 2000, 3:00:00 AM7/7/00
to
In article <3964ED2F...@kc.rr.com>, Tony Hammitt
<tham...@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.

0 new messages