snprintf on SunOS

Andrew Bartlett abartlet at
Tue Jun 5 07:33:39 MDT 2012

On Tue, 2012-06-05 at 04:06 -0700, Constantin Vultur wrote:
>  Hello,
> We are trying to build the latest samba alpha version (samba-4.0.0alpha21) on a SunOS5.10 machine but are encountering the following linkage error:
> Undefined                       first referenced
> symbol                             in file
> rep_vasprintf                      
>  default/source4/heimdal/lib/roken/strpool_5.o
> rep_snprintf                        default/source4/heimdal/lib/roken/getarg_5.o
> rep_asprintf                        default/source4/heimdal/lib/asn1/gen_134.o
> ld: fatal: Symbol referencing errors. No output written to /tmp/samba-4.0.0alpha21/bin/default/source4/heimdal_build/asn1_compile
> collect2: ld returned 1 exit status
> Waf: Leaving directory `/tmp/samba-4.0.0alpha21/bin'
> Build failed:  -> task failed (err #1):
>         {task: cc_link
>  base64_5.o,ct_5.o,hex_5.o,bswap_5.o,dumpdata_5.o,emalloc_5.o,ecalloc_5.o,getarg_5.o,get_window_size_5.o,getdtablesize_5.o,h_errno_5.o,issuid_5.o,net_read_5.o,net_write_5.o,parse_time_5.o,parse_units_5.o,vis_5.o,strlwr_5.o,strsep_copy_5.o,strsep_5.o,strupr_5.o,strpool_5.o,estrdup_5.o,erealloc_5.o,simple_exec_5.o,strcollect_5.o,rtbl_5.o,rand_5.o,cloexec_5.o,xfree_5.o,replace_5.o,print_version_132.o,version_132.o,main_134.o,gen_134.o,gen_copy_134.o,gen_decode_134.o,gen_encode_134.o,gen_free_134.o,gen_glue_134.o,gen_length_134.o,gen_seq_134.o,gen_template_134.o,hash_134.o,symbol_134.o,asn1parse_134.o,lex_134.o,strptime_1.o,replace_1.o,timegm_1.o -> asn1_compile}
> make: *** [all] Error 1
> Thank you in advance for any help.

This attached patch should fix it.  The additional attachment here is a
patch to reproduce the problem on linux (in case it helps other
developers, such as Jelmer who tried to fix this once before). 

Please let me know, so I can push this to autobuild.

Andrew Bartlett

Andrew Bartlett                      
Authentication Developer, Samba Team 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-lib-replace-Fix-snprintf-override-for-systems-with-a.patch
Type: text/x-patch
Size: 1139 bytes
Desc: not available
URL: <>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: reproduce-snprintf-on-linux.patch
Type: text/x-patch
Size: 521 bytes
URL: <>

More information about the samba-technical mailing list