Samba compile issue on Solaris 9

Hi all :slight_smile:

I've been given a task to try and upgrade Samba on our legacy Solaris 9 (SunOS 5.9) sparc system. Its currently running samba 3.5.3 but we'd like to try and install 3.6.0 (or 3.6.25) to have minimal protocol smbv2.

When trying to install from source, it appears to configure fine, but when I try to make, it fails when compiling smbd/vfs.c with issues about statvfs64 :

bash-2.05# make test
Using CFLAGS     = -I../lib/zlib -O -I. -I/tmp/samba_build_upg/samba-3.6.25/source3 -I/tmp/samba_build_upg/samba-3.6.25/source3/../lib/iniparser/src -Iinclude -I./include  -I. -I. -I./../lib/replace -I./librpc -I./.. -I./../lib/talloc -I./../lib/tevent -I../lib/tdb/include -DHAVE_CONFIG_H  -D_REENTRANT -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -DLDAP_DEPRECATED -DSUNOS5  -I/tmp/samba_build_upg/samba-3.6.25/source3/lib -I.. -D_SAMBA_BUILD_=3 -D_SAMBA_BUILD_=3
      PICFLAG    = -fPIC
      LIBS       = -lsendfile -lresolv -lrt -ldl -lnsl -lsocket -lmd5 -lrt
      LDFLAGS    = -lthread -L./bin
      DYNEXP     =
      LDSHFLAGS  = -fPIC -shared  -lthread -L./bin -lc -Wl,-z,defs
      SHLIBEXT   = so
      SONAMEFLAG = -Wl,-h,
Compiling dynconfig.c
Linking shared library bin/libnetapi.so.0
Linking non-shared library bin/libsmbclient.a
Linking shared library bin/libsmbclient.so.0
Compiling smbd/vfs.c
smbd/vfs.c: In function `smb_vfs_call_statvfs':
smbd/vfs.c:1202: structure has no member named `statvfs64'
smbd/vfs.c:1203: structure has no member named `statvfs64'
The following command failed:
gcc -I../lib/zlib -O -I. -I/tmp/samba_build_upg/samba-3.6.25/source3 -I/tmp/samba_build_upg/samba-3.6.25/source3/../lib/iniparser/src -Iinclude -I./include  -I. -I. -I./../lib/replace -I./librpc -I./.. -I./../lib/talloc -I./../lib/tevent -I../lib/tdb/include -DHAVE_CONFIG_H  -D_REENTRANT -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -DLDAP_DEPRECATED -DSUNOS5  -I/tmp/samba_build_upg/samba-3.6.25/source3/lib -I.. -D_SAMBA_BUILD_=3 -D_SAMBA_BUILD_=3 -fPIC -c smbd/vfs.c -o smbd/vfs.o
make: *** [smbd/vfs.o] Error 1

This isn't something I've came across before, does anyone have any advice on how to resolve !? Adding 'LARGEFILE64_SOURCE' and 'FILE_OFFSET_BITS=64' to the compile options doesn't seem to help, unfortunately.

Cheers, Jim

Perhaps you should consider compiling samba as a static binary first and see how that goes?

Hi Neo,

Thanks for your reply.

How would I go about compiling as a static binary? It's not something I've done before and not something I've seen in the samba docs.

Cheers, Jim

If you are using a version of gcc , you might try the -static option. On Solaris, there is something similar but I don't have a Solaris box to work on.

Please look it up on the gcc man page or do a bit of Googl'n around for it.

Also, another fun thing to try is to look at all your included and linked object files in your configuration and search your filesystem to make sure they all exist.

This is normally the first thing I do when I get those pesky "not found" errors when building.

Thanks.

Do you have a 32-bit or 64-bit gcc?
It might be easier to use a 64-bit gcc and produce a 64-bit Samba.
Please read

man lfcompile
man lfcompile64

-static is a linker option, comes after the compile phase. I usually do not recommend it.