[SunHELP] Unable to ' -static' compile programs with gcc

fabio fabio at crearium.com
Wed Oct 26 14:36:37 CDT 2005


Sandwich Maker wrote:

>" From: fabio <fabio at crearium.com>
>" 
>" hello,
>" 
>" -bash-3.00$ cat 1.c;\gcc -static -ggdb 1.c -o 1
>" main(){
>"       printf("hello world\n");
>" }
>" ld: fatal: library -lc: not found
>" ld: fatal: library -lc: not found
>" ld: fatal: File processing errors. No output written to 1
>" collect2: ld returned 1 exit status
>" 
>" -bash-3.00$ find / -name "libc.so.1" -print 2>/dev/null
>" /usr/lib/sparcv9/libc.so.1
>" /usr/lib/libc.so.1
>" /usr/lib/libp/libc.so.1
>" /usr/lib/libp/sparcv9/libc.so.1
>" /lib/sparcv9/libc.so.1
>" /lib/libc.so.1
>
>these are dynamic; static would be libc.a
>
>" -bash-3.00$ uname -srm
>" SunOS 5.10 sun4u
>" 
>" The option -g works fine but I need the option ggdb. Option -static 
>" doesnt work either. But It compiles ok if no option is given.
>
>sun's position on late-model solarii is that static binaries and
>static linking are passe'.  unless gcc comes with its own libc you're
>out of luck.  i don't think sun's forte compiler comes with static
>libs either.
>  
>
I dont understand, we cant build static binaries in Solaris sparc ?
Any workaround?



More information about the SunHELP mailing list