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.
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
> 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.