<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
--></style>
</head>
<body class='hmmessage'>
<BR>&nbsp;<BR>
&gt; Date: Wed, 2 Jun 2010 19:51:01 +0200<BR>&gt; From: andrei@iptel.org<BR>&gt; To: kevin.jzh@hotmail.com<BR>&gt; CC: sr-users@lists.sip-router.org<BR>&gt; Subject: Re: [SR-Users] gmake: *** [cfg.tab.h] Broken Pipe while make kamailio on solaris 10<BR>&gt; <BR>&gt; On Jun 03, 2010 at 01:36, JinKevin &lt;kevin.jzh@hotmail.com&gt; wrote:<BR>&gt; &gt; <BR>&gt; &gt; <BR>&gt; &gt; <BR>&gt; &gt; <BR>&gt; &gt; &gt; Date: Wed, 2 Jun 2010 16:54:26 +0200<BR>&gt; &gt; &gt; From: andrei@iptel.org<BR>&gt; &gt; &gt; To: kevin.jzh@hotmail.com<BR>&gt; &gt; &gt; CC: sr-users@lists.sip-router.org<BR>&gt; &gt; &gt; Subject: Re: [SR-Users] gmake: *** [cfg.tab.h] Broken Pipe while make kamailio on solaris 10<BR>&gt; &gt; &gt; <BR>&gt; &gt; &gt; On Jun 02, 2010 at 08:32, JinKevin &lt;kevin.jzh@hotmail.com&gt; wrote:<BR>&gt; &gt; &gt; &gt; <BR>&gt; &gt; &gt; &gt; <BR>&gt; &gt; &gt; &gt; <BR>&gt; &gt; &gt; &gt; Hi Andrei,<BR>&gt; &gt; &gt; &gt; <BR>&gt; &gt; &gt; &gt; <BR>&gt; &gt; &gt; &gt; <BR>&gt; &gt; &gt; &gt; gcc -dM -E -x c /dev/null<BR>&gt; &gt; &gt; &gt; #define __sparc__ 1<BR>&gt; &gt; &gt; &gt; <BR>&gt; &gt; &gt; [...]<BR>&gt; &gt; &gt; &gt; <BR>&gt; &gt; &gt; &gt; <BR>&gt; &gt; &gt; &gt; isainfo -n<BR>&gt; &gt; &gt; &gt; sparcv9<BR>&gt; &gt; &gt; &gt; <BR>&gt; &gt; &gt; &gt; <BR>&gt; &gt; &gt; &gt; <BR>&gt; &gt; &gt; &gt; isainfo -b<BR>&gt; &gt; &gt; &gt; 64<BR>&gt; &gt; &gt; &gt; <BR>&gt; &gt; &gt; &gt; uname -m<BR>&gt; &gt; &gt; &gt; sun4u<BR>&gt; &gt; &gt; <BR>&gt; &gt; &gt; Now I remembered :-)<BR>&gt; &gt; &gt; The problem on sparcv9 is that you can build either sparc32 or sparc64<BR>&gt; &gt; &gt; code. The make system tries to use the configured compiler and use its<BR>&gt; &gt; &gt; default architecture, in this case sparc32.<BR>&gt; &gt; &gt; This changed from older ser or kamailio version, where IIRC<BR>&gt; &gt; &gt; 64 bits was always used on sparcv9 (the isainfo arch was used).<BR>&gt; &gt; &gt; The change was needed for better cross-compiler support, snow leopard<BR>&gt; &gt; &gt; (boots 32 bits kernel, but gcc is configured to produce 64 bit<BR>&gt; &gt; &gt; binaries).<BR>&gt; &gt; &gt; <BR>&gt; &gt; &gt; So if you have all the needed 64 bits libs installed, you should compile<BR>&gt; &gt; &gt; for sparc64.<BR>&gt; &gt; &gt; Either make config CC_EXTRA_OPTS=-m64 or<BR>&gt; &gt; &gt; make config ARCH=sparc64<BR>&gt; &gt; &gt; should do it (don't forget to re-run it after any make proper).<BR>&gt; &gt; &gt; <BR>&gt; &gt; &gt; <BR>&gt; &gt; &gt; [...]<BR>&gt; &gt; &gt; &gt; <BR>&gt; &gt; &gt; &gt; And bison is also installed, <BR>&gt; &gt; &gt; &gt; <BR>&gt; &gt; &gt; &gt; yacc -V <BR>&gt; &gt; &gt; <BR>&gt; &gt; &gt; <BR>&gt; &gt; &gt; I couldn't reproduce the yacc/bison problem.<BR>&gt; &gt; &gt; For me it compiles flawlessly on an old sparcv9 (solaris 9, bison<BR>&gt; &gt; &gt; 1.875d).<BR>&gt; &gt; &gt; <BR>&gt; &gt; &gt; Could you try running:<BR>&gt; &gt; &gt; yacc -d -b cfg cfg.y<BR>&gt; &gt; &gt; by hand and see what happens? (any error? cfg.tab.h and cfg.tab.c<BR>&gt; &gt; &gt; created?)<BR>&gt; &gt; &gt;<BR>&gt; &gt; <BR>&gt; &gt; <BR>&gt; &gt; <BR>&gt; &gt; It just reports "Broken Pipe"<BR>&gt; &gt; <BR>&gt; &gt; $ yacc -d -b cfg cfg.y<BR>&gt; &gt; Broken Pipe<BR>&gt; <BR>&gt; Looks like your bison or bison package is broken.<BR>&gt; One cause might be that you don't have GNU m4 installed or it's not in<BR>&gt; the PATH (it's used by bison).<BR>&gt; See http://old.nabble.com/Broken-pipe-td1225149.html.<BR>&gt; <BR>&gt; &gt; <BR>&gt; &gt; <BR>&gt; &gt; If I removed the bison , then got some other error as below:<BR>&gt; &gt; <BR>&gt; &gt; $ yacc -d -b cfg cfg.y<BR>&gt; &gt; "cfg.y", line 103: fatal: invalid escape, or illegal reserved word: expect<BR>&gt; <BR>&gt; You can safely comment out "%expect 5" at line 103. It's just a warning<BR>&gt; killer and for some unkown reason the solaris yacc doesn't seem to like<BR>&gt; it (bison understands it and berkley yacc just ignores it).<BR>&gt; If you want to compile with this yacc version (after removing %expect<BR>&gt; from cfg.y), you would need to run something like:<BR>&gt; make config YACC=/usr/ccs/bin/yacc<BR>&gt; <BR>&gt;&nbsp;<BR> Andrei,<BR>Many thanks!<BR>
After comment out the "%expect 5" at line 103, it can go through the "yacc -d -b cfg cfg.y" as below:<BR>
====snip=====<BR>
gcc -g -O9 -funroll-loops -m64 -mcpu=ultrasparc -mtune=ultrasparc -Wall&nbsp;&nbsp;&nbsp; -DNAME='"kamailio"' -DVERSION='"3.0.2"' -DARCH='"sparc64"' -DOS='solaris_' -DOS_QUOTED='"solaris"' -DCOMPILER='"gcc 3.4.6"' -D__CPU_sparc64 -D__OS_solaris -DSER_VER=3000002 -DCFG_DIR='"/usr/local/kamailio-3.0/etc/kamailio/"' -DPKG_MALLOC -DSHM_MEM -DSHM_MMAP -DDNS_IP_HACK -DUSE_IPV6 -DUSE_MCAST -DUSE_TCP -DDISABLE_NAGLE -DHAVE_RESOLV_RES -DUSE_DNS_CACHE -DUSE_DNS_FAILOVER -DUSE_DST_BLACKLIST -DUSE_NAPTR -DF_MALLOC -DUSE_TLS -DTLS_HOOKS -DSTATISTICS -DMALLOC_STATS -DFAST_LOCK -DADAPTIVE_WAIT -DADAPTIVE_WAIT_LOOPS=1024 -DCC_GCC_LIKE_ASM -DSPARC64_MODE -DHAVE_GETIPNODEBYNAME -DHAVE_SYS_SOCKIO_H -DHAVE_SCHED_YIELD -DHAVE_ALLOCA_H -DUSE_SIGACTION -DHAVE_DEVPOLL -DHAVE_SELECT -DHAVE_FILIO_H&nbsp;&nbsp; -c cfg.tab.c -o cfg.tab.o -MMD -MP<BR><FONT color=#ffc000>/usr/ccs/bin/yaccpar:5: warning: ignoring #pragma ident <BR>/usr/ccs/bin/yaccpar: In function `yyparse':<BR>/usr/ccs/bin/yaccpar:164: warning: label `yynewstate' defined but not used</FONT><BR>gcc -m64 -O2&nbsp; action.o atomic_ops.o basex.o bit_scan.o cfg_core.o cfg_parser.o core_cmd.o crc.o daemonize.o data_lump_rpl.o data_lump.o dns_cache.o dprint.o dset.o dst_blacklist.o endianness.o error.o events.o flags.o forward.o hash_func.o id.o io_wait.o ip_addr.o local_timer.o lock_ops.o lvalue.o main.o md5.o md5utils.o mod_fix.o modparam.o msg_translator.o nonsip_hooks.o pass_fd.o proxy.o pt.o pv_core.o pvapi.o qvalue.o re.o receive.o resolve.o route_struct.o route.o rpc_lookup.o rvalue.o script_cb.o sctp_options.o sctp_server.o select_buf.o select_core.o select.o ser_stun.o shm_init.o signals.o sip_msg_clone.o socket_info.o sr_compat.o sr_module.o stats.o switch.o tcp_main.o tcp_options.o tcp_read.o timer_proc.o timer.o tls_hooks.o tsend.o udp_server.o usr_avp.o ut.o xavp.o mem/dl_malloc.o mem/f_malloc.o mem/ll_malloc.o mem/mem.o mem/memtest.o mem/q_malloc.o mem/sf_malloc.o mem/shm_mem.o parser/hf.o parser/msg_parser.o parser/parse_allow.o parser/parse_body.o parser/parse_content.o parser/parse_cseq.o parser/parse_date.o parser/parse_disposition.o parser/parse_diversion.o parser/parse_event.o parser/parse_expires.o parser/parse_fline.o parser/parse_from.o parser/parse_hname2.o parser/parse_hostport.o parser/parse_identity.o parser/parse_identityinfo.o parser/parse_methods.o parser/parse_nameaddr.o parser/parse_param.o parser/parse_refer_to.o parser/parse_retry_after.o parser/parse_rpid.o parser/parse_rr.o parser/parse_sipifmatch.o parser/parse_subscription_state.o parser/parse_to.o parser/parse_uri.o parser/parse_via.o parser/parser_f.o parser/digest/digest_parser.o parser/digest/digest.o parser/digest/param_parser.o parser/contact/contact.o parser/contact/parse_contact.o parser/sdp/sdp_helpr_funcs.o parser/sdp/sdp.o rand/fastrand.o rand/isaac/rand.o cfg/cfg_ctx.o cfg/cfg_script.o cfg/cfg_select.o cfg/cfg_struct.o cfg/cfg.o lex.yy.o cfg.tab.o&nbsp; -ldl -lresolv -L/usr/local/lib -lxnet -lnsl&nbsp; -lrt&nbsp;&nbsp; -o kamailio<BR>
====snip====<BR>
Hope this is as expected and I can go forward.<BR>
&nbsp;<BR>
Thanks<BR>
Kevin<BR>
&nbsp;<BR>                                               <br /><hr />搜索本应是彩色的,快来体验新一代搜索引擎-必应,精美图片每天换哦! <a href='http://cn.bing.com/?form=CRMADS ' target='_new'>立即试用!</a></body>
</html>