Created attachment 9977 [details] creating mostly empty c file on which the dynamic library is based Solaris studio can't compile 'empty' libraries the way gcc can: gcc -shared -o a.so -lz Samba build uses this feature. There was some attempty at working around the limitation here: http://git.samba.org/?p=anatoliy/anatoliy.git;a=commitdiff_plain;h=65743f932b511db009655847e77288c95c0aa525 Basically adding '-' at the end of the command line. That does not work, or at least with recent versions of Solaris Studio: $ cc -G -Bdynamic -o a.so -lz usage: cc [ options ] files. Use 'cc -flags' for details $ cc -G -Bdynamic -o a.so -lz - cc: standard input (-) valid only for preprocessor $ cc -V cc: Sun C 5.12 SunOS_i386 Patch 148918-08 2013/10/18 I'm ataching patch which fixes the issue. Basically creating mostly empty c file on which the dynamic library is based ... I am not sure it's the best fix, but it works well.
Hmmm, the patch sometimes works sometimes does not. I'll investigate more.
Created attachment 10549 [details] Vlad's update (fixed) Vlad's fixed update of the patch ...works fine to me
(In reply to Jura Sasek from comment #2) can't we just pass /dev/null instead of - ?
(In reply to Stefan (metze) Metzmacher from comment #3) $ /opt/SUNWspro/solarisstudio12.3/bin/cc -c -o tmp.o /dev/null cc: No valid input files specified, no output generated $ touch tmp.c $ /opt/SUNWspro/solarisstudio12.3/bin/cc -c -o tmp.o tmp.c "tmp.c", line 1: warning: empty translation unit $ file tmp.o tmp.o: ELF 32-bit MSB relocatable SPARC32PLUS Version 1, V8+ Required $ ln -s /dev/null . $ mv null null.c $ rm tmp.o $ /opt/SUNWspro/solarisstudio12.3/bin/cc -c -o tmp.o null.c "null.c", line 1: warning: empty translation unit $ file tmp.o tmp.o: ELF 32-bit MSB relocatable SPARC32PLUS Version 1, V8+ Required ...it looks the "cc" needs the appropriate suffix appended to compiled file
I think we should avoid calling the compiler at all or autogenerate an empty file.
See also bug 10315
(In reply to Tom Schulz from comment #6) ...yes Bug 10315 is a duplicate. SunCC can not compile from "-" (stdin). It needs the file suffix at least (see above).
Fixed in bug #11073.