Randy Parker
2006-Jul-02 10:47 UTC
[Samba] snprintf.c:(.text+0x14): undefined reference to `VA_COPY'
Trying to compile Samba 2.2.8a on Solaris 10. Changing Samba versions is not an option. Too many production systems hanging off that PDC. Samba 2.2.8a SunOS smb244-1 5.10 Generic sun4u sparc SUNW,Sun-Fire-V210 Tried gcc 3.3.2 and 2.95.3. Everything compiles but when it tries to link I get the following error. I searched the archives but didn't find any answer for this. How do I fix this? Thanks, Randy Using FLAGS32 = -O -Iinclude -I./include -I./ubiqx -I./smbwrapper -DLOGFILEBASE="/var/adm" -DCONFIGFILE="/etc/samba/smb.conf" -DLMHOSTSFILE="/usr/local/samba-2.2.8a/lib/lmhosts" -DSWATDIR="/usr/local/samba-2.2.8a/swat" -DSBINDIR="/usr/local/samba-2.2.8a/sbin" -DLOCKDIR="/var/adm/locks" -DCODEPAGEDIR="/usr/local/samba-2.2.8a/lib/codepages" -DDRIVERFILE="/usr/local/samba-2.2.8a/lib/printers.def" -DBINDIR="/usr/local/samba-2.2.8a/bin" -DPIDDIR="/var/adm/locks" -DLIBDIR="/usr/local/samba-2.2.8a/lib" -DHAVE_INCLUDES_H -DPASSWD_PROGRAM="/usr/bin/passwd" -DSMB_PASSWD_FILE="/etc/samba/private/smbpasswd" -DTDB_PASSWD_FILE="/etc/samba/private/smbpasswd.tdb" Using LIBS = -lsec -lgen -lsocket -lnsl -lpopt Linking bin/smbd lib/snprintf.o: In function `vasprintf': snprintf.c:(.text+0x14): undefined reference to `VA_COPY' snprintf.c:(.text+0x5c): undefined reference to `VA_COPY' collect2: ld returned 1 exit status *** Error code 1 The following command caused the error: gcc -O -Iinclude -I./include -I./ubiqx -I./smbwrapper -DLOGFILEBASE=\"/var/adm\" -DCONFIGFILE=\"/etc/samba/smb.conf\" -DLMHOSTSFILE=\"/usr/local/samba-2.2.8a/lib/lmhosts\" -DSWATDIR=\"/usr/local/samba-2.2.8a/swat\" -DSBINDIR=\"/usr/local/samba-2.2.8a/sbin\" -DLOCKDIR=\"/var/adm/locks\" -DCODEPAGEDIR=\"/usr/local/samba-2.2.8a/lib/codepages\" -DDRIVERFILE=\"/usr/local/samba-2.2.8a/lib/printers.def\" -DBINDIR=\"/usr/local/samba-2.2.8a/bin\" -DPIDDIR=\"/var/adm/locks\" -DLIBDIR=\"/usr/local/samba-2.2.8a/lib\" -DHAVE_INCLUDES_H -DPASSWD_PROGRAM=\"/usr/bin/passwd\" -DSMB_PASSWD_FILE=\"/etc/samba/private/smbpasswd\" -DTDB_PASSWD_FILE=\"/etc/samba/private/smbpasswd.tdb\" -o bin/smbd smbd/server.o smbd/files.o smbd/chgpasswd.o smbd/connection.o smbd/utmp.o smbd/session.o smbd/dfree.o smbd/dir.o smbd/password.o smbd/conn.o smbd/fileio.o smbd/ipc.o smbd/lanman.o smbd/mangle.o smbd/mangle_hash2.o smbd/mangle_hash.o smbd/mangle_map.o smbd/negprot.o smbd/message.o smbd/nttrans.o smbd/pipes.o smbd/reply.o smbd/trans2.o smbd/uid.o smbd/dosmode.o smbd/filename.o smbd/open.o smbd/close.o smbd/blocking.o smbd/sec_ctx.o smbd/vfs.o smbd/vfs-wrap.o smbd/statcache.o smbd/posix_acls.o lib/sysacls.o smbd/process.o smbd/service.o smbd/error.o printing/printfsp.o lib/util_seaccess.o libsmb/cli_pipe_util.o msdfs/msdfs.o param/loadparm.o param/params.o libsmb/clientgen.o libsmb/cliconnect.o libsmb/clifile.o libsmb/clirap.o libsmb/clierror.o libsmb/climessage.o libsmb/clireadwrite.o libsmb/clilist.o libsmb/cliprint.o libsmb/clitrans.o libsmb/clisecdesc.o libsmb/clidgram.o libsmb/namequery.o libsmb/nmblib.o libsmb/clistr.o libsmb/nterr.o libsmb/smbdes.o libsmb/smbencrypt.o libsmb/smberr.o libsmb/credentials.o libsmb/pwd_cache.o libsmb/clioplock.o libsmb/errormap.o libsmb/doserr.o libsmb/passchange.o libsmb/unexpected.o rpc_parse/parse_prs.o rpc_parse/parse_sec.o rpc_parse/parse_misc.o libsmb/namecache.o ubiqx/ubi_BinTree.o ubiqx/ubi_Cache.o ubiqx/ubi_SplayTree.o ubiqx/ubi_dLinkList.o ubiqx/ubi_sLinkList.o ubiqx/debugparse.o rpc_server/srv_lsa.o rpc_server/srv_lsa_nt.o rpc_server/srv_lsa_hnd.o rpc_server/srv_netlog.o rpc_server/srv_netlog_nt.o rpc_server/srv_pipe_hnd.o rpc_server/srv_reg.o rpc_server/srv_reg_nt.o rpc_server/srv_samr.o rpc_server/srv_samr_nt.o rpc_server/srv_srvsvc.o rpc_server/srv_srvsvc_nt.o rpc_server/srv_util.o rpc_server/srv_wkssvc.o rpc_server/srv_wkssvc_nt.o rpc_server/srv_pipe.o rpc_server/srv_dfs.o rpc_server/srv_dfs_nt.o rpc_server/srv_spoolss.o rpc_server/srv_spoolss_nt.o rpc_client/cli_spoolss_notify.o rpc_parse/parse_lsa.o rpc_parse/parse_net.o rpc_parse/parse_reg.o rpc_parse/parse_rpc.o rpc_parse/parse_samr.o rpc_parse/parse_srv.o rpc_parse/parse_wks.o rpc_parse/parse_spoolss.o rpc_parse/parse_dfs.o rpc_client/cli_netlogon.o rpc_client/cli_pipe.o rpc_client/cli_login.o rpc_client/cli_trust.o locking/locking.o locking/brlock.o locking/posix.o passdb/passdb.o passdb/secrets.o passdb/pass_check.o passdb/smbpassfile.o passdb/machine_sid.o passdb/pdb_smbpasswd.o passdb/pampass.o passdb/pdb_tdb.o passdb/pdb_ldap.o passdb/pdb_nisplus.o printing/pcap.o printing/print_svid.o printing/print_cups.o printing/print_generic.o printing/lpq_parse.o printing/load.o profile/profile.o lib/charcnv.o lib/charset.o lib/debug.o lib/fault.o lib/getsmbpass.o lib/interface.o lib/kanji.o lib/md4.o lib/interfaces.o lib/pidfile.o lib/replace.o lib/signal.o lib/system.o lib/sendfile.o lib/time.o lib/ufc.o lib/genrand.o lib/username.o lib/util_getent.o lib/access.o lib/smbrun.o lib/bitmap.o lib/crc32.o lib/snprintf.o lib/wins_srv.o lib/util_str.o lib/util_sid.o lib/util_unistr.o lib/util_file.o lib/util.o lib/util_sock.o lib/util_sec.o smbd/ssl.o lib/talloc.o lib/hash.o lib/substitute.o lib/fsusage.o lib/ms_fnmatch.o lib/select.o lib/error.o lib/messages.o lib/pam_errors.o nsswitch/wb_client.o nsswitch/wb_common.o tdb/tdb.o tdb/spinlock.o tdb/tdbutil.o printing/printing.o printing/nt_printing.o smbd/quotas.o smbd/oplock.o smbd/oplock_irix.o smbd/oplock_linux.o smbd/notify.o smbd/notify_hash.o smbd/notify_kernel.o -Wl,-E -lsec -lgen -lsocket -lnsl -lpopt make: Fatal error: Command failed for target `bin/smbd'
Adam Nielsen
2006-Jul-02 22:52 UTC
[Samba] snprintf.c:(.text+0x14): undefined reference to `VA_COPY'
> Trying to compile Samba 2.2.8a on Solaris 10. > > Changing Samba versions is not an option. Too many > production systems hanging off that PDC. > > Samba 2.2.8a > SunOS smb244-1 5.10 Generic sun4u sparc SUNW,Sun-Fire-V210 > Tried gcc 3.3.2 and 2.95.3. > > Everything compiles but when it tries to link I get > the following error. I searched the archives but > didn't find any answer for this. How do I fix this?It looks like there have been some changes to lib/snprintf.c to fix this - what happens if you add this code near the top of snprintf.c? #ifndef VA_COPY #ifdef HAVE_VA_COPY #define VA_COPY(dest, src) va_copy(dest, src) #else #ifdef HAVE___VA_COPY #define VA_COPY(dest, src) __va_copy(dest, src) #else #define VA_COPY(dest, src) (dest) = (src) #endif #endif You might even just want to force that last definition, which doesn't rely on any external functions. Cheers, Adam.