[Samba] Fwd: RE: Problems 'make'ing on Solaris 9/10

Gaiseric Vandal gaiseric.vandal at gmail.com
Fri May 7 13:57:51 MDT 2010



On Solaris 10 (x86), trying to compile samba 3.5.2

I have downloaded GCC 3.4.x., make,  binutils (ld etc) and  sed  from 
Sunfreeware.
GCC (gcc -v) has /usr/ccs/bin/ld hardcoded so the only way around it was 
to symlink to the gnu one.



# mv /usr/ccs/bin/ld /usr/ccs/bin/ld.1
# ln -s /usr/local/bin/ld   /usr/ccs/bin/ld
# ./configure --prefix=/usr/local/talloc-2.0.1


When setting some environmental variables (e.g. CPPFLAGS) I had some 
issues with sh rather that bash.   So just in case any scripts were 
calling sh I did the following:


# mv /sbin/sh /sbin/sh.1
# ln -s /bin/bash /sbin/sh



When compiling samba, make (actually ld) would hang fail on libtalloc 
and libtdb.


/usr/ccs/bin/ld: cannot open linker script file 
/export/src/Samba/samba-3.5.2/source3/exports/libtalloc.so.2: No such 
file or directory
collect2: ld returned 1 exit status
make: *** [bin/libtalloc.so.2] Error 1



So I had to download and compile those separately

http://samba.org/ftp/tdb/tdb-1.2.1.tar.gz
http://samba.org/ftp/talloc/talloc-2.0.1.tar.gz

libtalloc wouldn't compile until I did the symlinked "ld" as described 
above.

Before compiling samba I set PATH and other variables


PATH=/usr/bin:/usr/sbin
PATH=/usr/local/bin:$PATH
PATH=/usr/local/samba-3.5.2/bin:/usr/local/samba-3.5.2/sbin:$PATH
LD_LIBRARY_PATH=/usr/local/lib:/usr/lib
LD_LIBRARY_PATH=/usr/local/samba-3.5.2/lib:$LD_LIBRARY_PATH
CPPFLAGS="-I /usr/local/include -I/usr/local/ssl/include -I/usr/include"
CPPFLAGS="-I /usr/local/samba-3.5.2/include $CPPFLAGS"
LDFLAGS="-L/usr/local/ssl/lib -R/usr/local/ssl/lib \
  -L/usr/local/lib -R/usr/local/lib -L/usr/lib -R/usr/lib"
LDFLAGS="-L/usr/local/samba-3.5.2/lib -R/usr/local/samba-3.5.2/lib $LDFLAGS"
export CPPFLAGS
export LDFLAGS
PKG_CONFIG_PATH=/usr/local/samba-3.5.2/lib/pkgconfig
export LD_LIBRARY_PATH
export PATH
export PKG_CONFIG_PATH



PKG_CONFIG_PATH is used to locate the pkg files for libtdb and libtalloc.


Configure command is:

./configure --prefix=/usr/local/samba-3.5.2 \
--with-shared-modules=vfs_zfsacl  \
--with-privatedir=/etc/samba/private  \
--with-lockdir=/var/samba/locks  \
--with-configdir=/etc/samba \
--with-ads  --with-ldap \
--enable-external-libtalloc=yes \
--enable-external-libtdb=yes  \
--enable-nss-wrapper  \
--with-winbind

So no more issues related to libtalloc BUT the compile still failed:

creating /export/src/Samba/samba-3.5.2/source3/exports/libwbclient.syms
Linking shared library bin/libwbclient.so.0
/usr/local/lib/gcc/i386-pc-solaris2.10/3.4.6/crt1.o: In function `_start':
crt1.s:(.text+0x5c): undefined reference to `main'
collect2: ld returned 1 exit status
make: *** [bin/libwbclient.so.0] Error 1
-sh-3.00#


I installed GCC 4.4.x from blastwave, tried compiling samba  and got a 
similar error:

creating /export/src/Samba/samba-3.5.2/source3/exports/libwbclient.syms
Linking shared library bin/libwbclient.so.0
/usr/lib/crt1.o: In function `_start':
fsr.s:(.text+0x7c): undefined reference to `main'
collect2: ld returned 1 exit status
make: *** [bin/libwbclient.so.0] Error 1


removing the following from the configure command did not seem to help

--enable-nss-wrapper
--with-winbind
--with-wbclient

I have now downloaded samba 3.4.7 from blastwave-  will see if that 
works for me.




-------- Original Message --------
Subject: 	RE: [Samba] Problems 'make'ing on Solaris 9.
Date: 	Fri, 7 May 2010 07:14:47 -0400
From: 	Gaiseric Vandal <gaiseric.vandal at gmail.com>
To: 	<samba at lists.samba.org>



Hello Christoph

I guess samba lists will not let you include attachments.  I had problems
compiling samba 3.4.7 on solaris 10-  eventually I got it working.  I was
trying to recompile samba 3.5.2 yesterday but this time was getting stuck
with the /usr/ccs/bin/ld and  libtalloc thing (which seems like everyone
on solaris has this issue.)

I downloaded the "binutils" package (and dependencies) from sunfreeware
which includes the gnu ld.  (Not 100% sure this was necessary.)  I also
already download the sunfreeware packages for gcc, make, openldap and
Kerberos.

In hindsight I could probably have used the gcc in /usr/sfw/bin (Sun's
"freeware" CD) since ld seems to be the issue not gcc.


PATH=/usr/local/bin:/usr/bin
PATH=/usr/local/samba-3.5.2/bin:/usr/local/samba-3.5.2/sbin:$PATH
LD_LIBRARY_PATH=/usr/local/lib:/usr/lib
LD_LIBRARY_PATH=/usr/local/samba-3.5.2:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH
export PATH

export CPPFLAGS="-I/usr/local/include -I/usr/local/ssl/include
-I/usr/include"
export LDFLAGS="-L/usr/local/ssl/lib -R/usr/local/ssl/lib \
-L/usr/local/lib -R/usr/local/lib -L/usr/lib -R/usr/lib"


./configure --prefix=/usr/local/samba-3.5.2 \
--with-shared-modules=vfs_zfsacl \
--with-privatedir=/etc/samba/private \
--with-lockdir=/var/samba/locks \
--with-configdir=/etc/samba \
--enable-nss-wrapper \
--with-libtalloc \
--with-ads --with-ldap \
--with-winbind


The CPPFLAGS and LDFLAGS were to make sure it used the openldap not sun
ldap *h files.

But make still fails with libtalloc

/usr/ccs/bin/ld: illegal option -- version-script

Which I really don't get since /usr/local/bin/ld is the the path.
I think Sunfreeware GCC was compiled to export /usr/ccs/bin/ld



I am not quite sure what I did last time to make this work.

Maybe I need gcc 4?



-----Original Message-----
From: samba-bounces at lists.samba.org [mailto:samba-bounces at lists.samba.org]
On Behalf Of christoph.beyer at desy.de
Sent: Friday, May 07, 2010 5:35 AM
To: Collin Baillie
Cc: samba at lists.samba.org
Subject: Re: [Samba] Problems 'make'ing on Solaris 9.

Hi,

I just did built 3.5.2 on solaris 10 sparc and had some similar errors.
Main thing is probably to make upsolutely sure that none of the
krb/ldap/sasl headers of solaris are used. I attached a built script which
figured out to work for me, it does not look very professional but I did a
lot of testing with it and did not touch it again since it was working.
Maybe it gives you some hints for compiling on solaris 9 as well..

good luck
christoph


On Fri, 7 May 2010, Collin Baillie wrote:

>
>
>   Hi list! I'm trying to build Samba 3.4.7 with ADS support on Solaris
>  9 and experiencing a heap of problems (which seem to be common). First
>  of my
>  system: Solaris 9 SPARC>  uname -a
>  SunOS sunfire2 5.9 Generic_122300-08
>  sun4u sparc SUNW,Sun-Fire-V240 Solaris Using GCC 3.4.6 from
>  sunfreeware (with all noted dependancies installed)>  gcc --version
>  gcc (GCC)
>  3.4.6
>  Copyright (C) 2006 Free Software Foundation, Inc.
>  This is free
>  software; see the source for copying conditions. There is NO warranty;
>  not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Make
>  version
>  3.81>  make --version
>  GNU Make 3.81
>  Copyright (C) 2006 Free Software
>  Foundation, Inc.
>  This is free software; see the source for copying conditions.
>  There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
>  PARTICULAR PURPOSE. This program built for sparc-sun-solaris2.9 The
>  problem I have been experiencing is a fail during the make sequence. I
>  got the good old error of libtalloc.so.1 link script missing. In fact,
>  when I manually expanded all the 'macros' ( ie $(LIBSMB_OBJ) ) and
>  produce the entire gcc command, libtalloc.so.1 builds successfully, as
>  do a number of other libs after it. libaddns.so.0 built ok by itself,
>  and then I had to do a couple more. Finally I have arrived at the
>  build of bin/smbd. Even with hand parsing the gcc command line, I am
>  getting errors about undefined references to functions:>  make Using
>  CFLAGS = -I/usr/local/include -O -I.
>  -I/export/home/cbaillie/samba/samba-3.4.7/source3
>  -I/export/home/cbaillie/samba/samba-3.4.7/source3/iniparser/src
>  -Iinclude -I./include -I. -I. -I./../lib/replace -I./../lib/talloc
>  -I./../lib/tevent -I./../lib/tdb/include -I./libaddns -I./librpc
>  -I./.. -DHAVE_CONFIG_H -I/usr/local/include -I/usr/local/include
>  -D_LARGEFILE_SOURCE -D_REENTRANT
>  -D_FILE_OFFSET_BITS=64 -DLDAP_DEPRECATED -DSUNOS5
>  -I/export/home/cbaillie/samba/samba-3.4.7/source3/lib -I..
>  -I../source4
>  -D_SAMBA_BUILD_=3 -D_SAMBA_BUILD_=3
>  PICFLAG = -fPIC
>  LIBS = -lsendfile
>  -lresolv -lrt -ldl -lnsl -lsocket -liconv -laio LDFLAGS = -pie
>  -L/usr/local/lib -R/usr/local/lib -R/usr/lib -L/usr/openwin/lib
>  -R/usr/openwin/lib -L/usr/local/ssl/lib -R/usr/local/ssl/lib
>  -L/usr/local/BerkeleyDB.4.2/lib -R/usr/local/BerkeleyDB.4.7/lib
>  -lthread -L./bin DYNEXP = -Wl,-E LDSHFLAGS = -G -L/usr/local/lib
>  -R/usr/local/lib -R/usr/lib -L/usr/openwin/lib -R/usr/openwin/lib
>  -L/usr/local/ssl/lib -R/usr/local/ssl/lib
>  -L/usr/local/BerkeleyDB.4.2/lib -R/usr/local/BerkeleyDB.4.7/lib
>  -lthread -L./bin SHLIBEXT = so SONAMEFLAG = -Wl,-soname= Linking
>  bin/smbd
>
/usr/local/lib/gcc/sparc-sun-solaris2.9/3.4.6/../../../../sparc-sun-solari
s2.9/bin/ld:
>  warning: libcom_err.so.1, needed by /usr/local/lib/libasn1.so, may
>  conflict with
>  libcom_err.so.3
>
/usr/local/lib/gcc/sparc-sun-solaris2.9/3.4.6/../../../../sparc-sun-solari
s2.9/bin/ld:
>  warning: libtalloc.so, needed by /usr/local/lib/libwbclient.so, not
>  found (try using -rpath or -rpath-link)
>  smbd/mangle_hash.o: In function
>  `mangle_hash_init':
>  mangle_hash.c:(.text+0x15ac): undefined reference to `tdb_open_ex'
>  rpc_parse/parse_prs.o: In function
>  `tdb_prs_fetch':
>  parse_prs.c:(.text+0x31cc): undefined reference to `tdb_fetch'
>  passdb/secrets.o: In function
>  `open_schannel_session_store':
>  secrets.c:(.text+0x2b70): undefined
>  reference to `tdb_close'
>  secrets.c:(.text+0x2c18): undefined reference to `tdb_close'
>  passdb/secrets.o: In function
>  `secrets_store_schannel_session_info':
>  secrets.c:(.text+0x2f38): undefined
>  reference to `tdb_close'
>  passdb/secrets.o: In function
>  `secrets_restore_schannel_session_info':
>  secrets.c:(.text+0x3094):
>  undefined reference to `tdb_close'
>  secrets.c:(.text+0x31a0): undefined
>  reference to `tdb_close'
>  passdb/secrets.o:secrets.c:(.text+0x3268): more undefined references
>  to `tdb_close' follow
>  libsmb/unexpected.o: In function
>  `unexpected_packet':
>  unexpected.c:(.text+0x1a0): undefined reference to `tdb_store'
>  -- snip -- and so on. Is anyone out there more experienced with
>  compiling OSS stuff on Solaris/SPARC willing to help with this build?
>  We were running 3.0.25b happily, until a recent reboot when we
>  discovered our shiney new Windows 2008 domain controllers don't play
>  nicely with that version. Now trying to get our production server back
>  online with a newer version. Regards, Collin Baillie
>  --
>  To unsubscribe from this list go to the following URL and read the
>  instructions:  https://lists.samba.org/mailman/options/samba
>

best regards
  	~christoph


-- 
/*   Christoph Beyer     |   Office: Building 2b / 23     *\
   *   DESY                |    Phone: 040-8998-2317        *
   *   - IT -              |      Fax: 040-8998-4060        *
\*   22603 Hamburg       |     http://www.desy.de         */




More information about the samba mailing list