<div dir="ltr">Hello,<div><br></div><div>I'm not sure why, but it seems like on your system for some reason the expression below does not filter out the "COST_CHK(N)" clauses:</div><div><br></div><div><div>grep -n COST_CHK erts/emulator/pcre/pcre_exec.c | grep -v 'COST_CHK(N)'</div>
</div><div><div>691:  COST_CHK(1);</div><div>1792:<span class="" style="white-space:pre">  </span>COST_CHK(1);</div><div>1899:<span class="" style="white-space:pre">  </span>  COST_CHK(1);</div><div>2067:<span class="" style="white-space:pre">   </span>    COST_CHK(1);</div>
<div>2087:<span class="" style="white-space:pre">       </span>    COST_CHK(1);</div><div>2184:<span class="" style="white-space:pre">    </span>  COST_CHK(1);</div><div>2412:<span class="" style="white-space:pre">   </span>    COST_CHK(1);</div>
<div>2483:<span class="" style="white-space:pre">       </span>  COST_CHK(1);</div><div>2522:<span class="" style="white-space:pre">   </span>  COST_CHK(1);</div><div>2716:<span class="" style="white-space:pre">   </span>    COST_CHK(1);</div>
<div>2735:<span class="" style="white-space:pre">       </span>    COST_CHK(1);</div><div>2846:<span class="" style="white-space:pre">    </span>    COST_CHK(1);</div><div>3035:<span class="" style="white-space:pre">    </span>    COST_CHK(1);</div>
<div>3849:<span class="" style="white-space:pre">       </span>    COST_CHK(1);</div><div>3865:<span class="" style="white-space:pre">    </span>    COST_CHK(1);</div><div>3879:<span class="" style="white-space:pre">    </span>    COST_CHK(1);</div>
<div>3893:<span class="" style="white-space:pre">       </span>    COST_CHK(1);</div><div>3907:<span class="" style="white-space:pre">    </span>    COST_CHK(1);</div><div>3945:<span class="" style="white-space:pre">    </span>    COST_CHK(1);</div>
<div>3947:<span class="" style="white-space:pre">       </span>    COST_CHK(1);</div><div>3993:<span class="" style="white-space:pre">            </span>COST_CHK(1);</div><div>4003:<span class="" style="white-space:pre">          </span>COST_CHK(1);</div>
<div>4019:<span class="" style="white-space:pre">               </span>COST_CHK(1);</div><div>4058:<span class="" style="white-space:pre">  </span>    COST_CHK(1);</div><div>4097:<span class="" style="white-space:pre">    </span>    COST_CHK(1);</div>
<div>4124:<span class="" style="white-space:pre">       </span>    COST_CHK(1);</div><div>4136:<span class="" style="white-space:pre">    </span>    COST_CHK(1);</div><div>4148:<span class="" style="white-space:pre">    </span>    COST_CHK(1);</div>
<div>4160:<span class="" style="white-space:pre">       </span>    COST_CHK(1);</div><div>4172:<span class="" style="white-space:pre">    </span>    COST_CHK(1);</div><div>4184:<span class="" style="white-space:pre">    </span>    COST_CHK(1);</div>
<div>4196:<span class="" style="white-space:pre">       </span>    COST_CHK(1);</div><div>4229:<span class="" style="white-space:pre">    </span>      COST_CHK(1);</div><div>4260:<span class="" style="white-space:pre">     </span>    COST_CHK(1);</div>
<div>4271:<span class="" style="white-space:pre">       </span>    COST_CHK(1);</div><div>4282:<span class="" style="white-space:pre">    </span>    COST_CHK(1);</div><div>4294:<span class="" style="white-space:pre">    </span>    COST_CHK(1);</div>
<div>4306:<span class="" style="white-space:pre">       </span>    COST_CHK(1);</div><div>4316:<span class="" style="white-space:pre">    </span>    COST_CHK(1);</div><div>4326:<span class="" style="white-space:pre">    </span>    COST_CHK(1);</div>
<div>4336:<span class="" style="white-space:pre">       </span>    COST_CHK(1);</div><div>4346:<span class="" style="white-space:pre">    </span>    COST_CHK(1);</div><div>4356:<span class="" style="white-space:pre">    </span>    COST_CHK(1);</div>
<div>4366:<span class="" style="white-space:pre">       </span>    COST_CHK(1);</div></div><div><br></div><div>What version of grep are you using?</div><div><br></div><div>Lukas</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">
On Mon, Apr 7, 2014 at 12:57 AM, Jamiel Almeida <span dir="ltr"><<a href="mailto:slashfoo@gmail.com" target="_blank">slashfoo@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">Hey guys,<div><br></div><div>I'm trying to build erlang from source (tried github and tar.gz sources from <a href="http://erlang.org" target="_blank">erlang.org</a>)</div><div><br></div><div>I'm running into issues when it proceeds to build the pcre side of things.</div>


<div><br></div><div>Here's an excerpt of the point where `make` breaks:</div><div><div><font face="courier new, monospace">gcc -c -Werror=return-type -g -O2 -I/home/jamiel/repos/erlang/erts/x86_64-unknown-linux-gnu -fno-tree-copyrename -D_GNU_SOURCE -DERTS_SMP -DHAVE_CONFIG_H -Wall -Wstrict-prototypes -Wmissing-prototypes -Wdeclaration-after-statement -DUSE_THREADS -D_THREAD_SAFE -D_REENTRANT -DPOSIX_THREADS -D_POSIX_THREAD_SAFE_FUNCTIONS -DERLANG_INTEGRATION -o /home/jamiel/repos/erlang/erts/emulator/pcre/obj/x86_64-unknown-linux-gnu/opt/pcre_exec.o pcre/pcre_exec.c</font></div>


<div><font face="courier new, monospace">In file included from pcre/pcre_exec.c:4451:0:</font></div><div><font face="courier new, monospace">pcre/pcre_exec.c: In function ‘match’:</font></div><div><font face="courier new, monospace">pcre/pcre_exec_loop_break_cases.inc:3:1: error: label ‘L_LOOP_COUNT_585’ used but not defined</font></div>


<div><font face="courier new, monospace"> case 685: goto L_LOOP_COUNT_585;</font></div><div><font face="courier new, monospace"> ^</font></div><div><font face="courier new, monospace">pcre/pcre_exec_loop_break_cases.inc:2:1: error: label ‘L_LOOP_COUNT_499’ used but not defined</font></div>


<div><font face="courier new, monospace"> case 599: goto L_LOOP_COUNT_499;</font></div><div><font face="courier new, monospace"> ^</font></div><div><font face="courier new, monospace">pcre/pcre_exec_loop_break_cases.inc:1:1: error: label ‘L_LOOP_COUNT_474’ used but not defined</font></div>


<div><font face="courier new, monospace"> case 574: goto L_LOOP_COUNT_474;</font></div><div><font face="courier new, monospace"> ^</font></div><div><font face="courier new, monospace">pcre/<a href="http://pcre.mk:60" target="_blank">pcre.mk:60</a>: recipe for target '/home/jamiel/repos/erlang/erts/emulator/pcre/obj/x86_64-unknown-linux-gnu/opt/pcre_exec.o' failed</font></div>


</div><div><br></div><div>Full output of the (./configure && make) commands is here: <a href="https://gist.github.com/slashfoo/c71437a01e708086072f" target="_blank">https://gist.github.com/slashfoo/c71437a01e708086072f</a></div>

<div>
<div><br>My system is an x86_64 Arch Linux install with kernel 3.13.8-1</div><div><br></div><div><div>$ gcc --version</div><div>gcc (GCC) 4.8.2 20140206 (prerelease)</div></div><br></div><div>Other prereq versions:<br>

<div>m4 1.4.17-1</div><div>flex 2.5.39-1</div><div>perl 5.18.2-2</div><div>jre7-openjdk 7.u51_2.4.6-1</div><div>jdk7-openjdk 7.u51_2.4.6-1</div><div>make 4.0-2</div><div>gcc 4.8.2-8</div></div><div><div>libxslt 1.1.28-3</div>


<div>fop 1.1-1</div><div>autoconf 2.69-1</div></div><div><br></div><div>I have tried building other "tags" on the git checkout, and from their respective tarballs from <a href="http://erlang.org" target="_blank">erlang.org</a> with the same results.</div>


<div><br></div><div>Grepping for "L_LOOP_COUNT" on the source directory yields two files that make use of it, and the build-time-generated file <span style="line-height:16.799999237060547px;font-size:12px;white-space:pre-wrap;font-family:Consolas,'Liberation Mono',Courier,monospace">erts/emulator/pcre/pcre_exec_loop_break_cases.inc .
</span></div><div><br></div><div>Googling for L_LOOP_COUNT and erlang, etc yields no useful results, of which the most "informative" is this one: <a href="http://stackoverflow.com/questions/9647427/fail-to-compile-erlang-r14b03" target="_blank">http://stackoverflow.com/questions/9647427/fail-to-compile-erlang-r14b03</a><br>


<br>But the only use for that result is knowing that I'm not the only one seeing this and that the issue is at least 2 years old.</div><div><br></div><div>I'm not using MacOS, or kerl; I'm using Arch Linux, and building by HOWTO/INSTALL.md.</div>


<div><br></div><div>In a blind/crazy idea that it might be trying to use my system PCRE (8.34-2) instead of the one in the sources directory I tried installing some of those locally to my home directory and using LDFLAGS and CFLAGS pointing to lib/include dirs where I installed them. This had no effect. And, of course, running from a clean bash instance with no shell magic applied to the environment.</div>


<div><br></div><div>The reason I want to install from source is that I require R17 to poke around, and my distro doesn't have packages for it yet. When it failed, I tried building other Rs from source, and found I was getting the same issues.</div>


<div><br></div><div>I have the very deep feeling that I'm missing some simple thing, but can't spot it.</div><div><br></div><div>What steps would you suggest I follow? Any ideas?</div><div><br></div><div>Thanks in advance.<span class="HOEnZb"><font color="#888888"><br clear="all">


<div><br></div>-- <br>Jamiel Almeida
</font></span></div></div>
<br>_______________________________________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
<br></blockquote></div><br></div>