Samba 3.0.0rc3 on Solaris 8 -- unexpected diagnostics

David Collier-Brown -- Customer Engineering David.Collier-Brown at Sun.COM
Tue Sep 16 13:27:05 GMT 2003


David Collier-Brown -- Customer Engineering wrote:
>   I was able to use smbclient for a test, but the
> **number** of diagnostics was surprising.

   And I found a bug in the Makefile macros used on
Solaris (skip to the end for the fix).

   I went to hunt down the missing init_module call
by adding -z initarray=init_module to the Solaris linker
line, but discovered the link command was actually
	
     gcc -g -O2 -G -o bin/CP850.so modules/CP850.po \
         -h `basename bin/CP850.so`

   This is the set of option I expect to use with the Solaris
linker to build a shared library: -G builds a .so,
-h sets the internal copy of its name.

   With gcc, I normally use (from memory) "gcc -shared
-Wl,-soname,CP850.so -o CP850.so", and the -G option
sets the size of "small" bss data. I have no idea
what -h will do...

   It appears that the LDSHFLAGS macro is set for the
Solaris linker, which is normal on Solaris and was done
in previous releases, and the SHLD option was set to gcc.
I'm trying variants on the options as we speak...

Test 1:
Compiling modules/CP850.c with -fPIC
Building plugin bin/CP850.so
gcc -shared  -o bin/CP850.so modules/CP850.po
ld: warning: global symbol `_DYNAMIC' has non-global binding:
         (file 
/usr/local/lib/gcc-lib/sparc-sun-solaris2.8/3.0/../../../libgcc_s.so 
value=LOCL);
ld: warning: global symbol `_PROCEDURE_LINKAGE_TABLE_' has non-global 
binding:
         (file 
/usr/local/lib/gcc-lib/sparc-sun-solaris2.8/3.0/../../../libgcc_s.so 
value=LOCL);
ld: warning: global symbol `_GLOBAL_OFFSET_TABLE_' has non-global binding:
         (file 
/usr/local/lib/gcc-lib/sparc-sun-solaris2.8/3.0/../../../libgcc_s.so 
value=LOCL);

(not good --dave)

Test 2:
elsbeth> rm bin/CP850.so modules/CP850.po bin/smbclient
elsbeth> make
...
Building plugin bin/CP850.so
ld -G -o bin/CP850.so modules/CP850.po \
         -h `basename bin/CP850.so` -z initarray=init_module
Linking bin/smbsh
...


I reccomend changing the configure script to set SHLD=ld
in the resulting Makefile.

This doesn't fix the underlying problem with init_module, but it
does get us back to a plausible link command (;-))

--dave
-- 
David Collier-Brown,       | Always do right. This will gratify
Sun Microsystems,          | some people and astonish the rest.
Toronto, Ontario,          |                      -- Mark Twain
(905) 415-2849 or x52849   | davecb at canada.sun.com





More information about the samba-technical mailing list