snprintf on SunOS

Mihai-Radu, Orza orzamihai at
Wed Jun 6 04:13:35 MDT 2012

Hello Andrew,

Thank you for the patch. I managed to go past the asn1 linkage problem, so it helped.

But now I get the following build error:
[ 522/3534] Compiling lib/ccan/failtest/failtest.c
../lib/ccan/failtest/failtest.c:8:17: err.h: No such file or directory
Waf: Leaving directory `/tmp/samba-4.0.0beta1/bin'
Build failed:  -> task failed (err #1):
        {task: cc failtest.c -> failtest_1.o}

The err.h C header does not come with SunOS so I guess the compiler should use the replacement functions defined in source4\heimdal_build\replace.c. Is there some config param I'm missing?

Thanks again and regards,

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 

More information about the samba-technical mailing list