<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jun 9, 2014 at 6:12 PM, Sandeep K Chaudhary <span dir="ltr"><<a href="mailto:babbusandy2006@gmail.com" target="_blank">babbusandy2006@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"><div>Hi Reid,</div><div class=""><div><br></div>Thanks for the reply !<div><br></div></div><div>Earlier the build was complaining about not having /asm in /usr/include so I created a symbolic link to it with asm-generic, after that I am encountering this issue.</div>

<div><br></div><div>I just grep'ed for '__NR_fork', and I can see these numbers in the header files.</div><div><br></div><div><div>sandeep@ubuntu:/usr/include$ grep -rni __NR_fork .</div><div>./asm-generic/unistd.h:850:#define __NR_fork 1079</div>

<div>./asm-generic/unistd.h:852:__SYSCALL(__NR_fork, sys_fork)</div><div>./asm-generic/unistd.h:854:__SYSCALL(__NR_fork, sys_ni_syscall)</div><div>./asm-generic/unistd.h:858:#define __NR_syscalls (__NR_fork+1)</div><div>
./x86_64-linux-gnu/asm/unistd_x32.h:51:#define __NR_fork (__X32_SYSCALL_BIT + 57)</div>
<div>./x86_64-linux-gnu/asm/unistd_64.h:61:#define __NR_fork 57</div><div>./x86_64-linux-gnu/asm/unistd_32.h:6:#define __NR_fork 2</div><div>./x86_64-linux-gnu/bits/syscall.h:70:#define SYS_fork __NR_fork</div><div>./x86_64-linux-gnu/bits/syscall.h:418:#define SYS_fork __NR_fork</div>

<div>./x86_64-linux-gnu/bits/syscall.h:730:#define SYS_fork __NR_fork</div></div><div><br></div><div>So these numbers are available in /usr/include. Are these not sufficient?</div></div></blockquote><div><br></div><div>Sanitizers use this line to get syscall numbers:</div>
<div>  #include <sys/syscall.h></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><br></div><div>Thanks,</div><div>Sandeep.</div>

<div><br></div><div><div><br></div></div></div><div class="gmail_extra"><div><div class="h5"><br><br><div class="gmail_quote">On Mon, Jun 9, 2014 at 8:37 PM, Reid Kleckner <span dir="ltr"><<a href="mailto:rnk@google.com" target="_blank">rnk@google.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">-cfe-dev<div><br></div><div>Based on your question on IRC, it sounds like there's something wrong with your Linux headers.  Make sure you have something that provides the syscall numbers in /usr/include.  My workstation has them in x86_64-linux-gnu/asm/unistd_(32|64).h:</div>


<div><br></div><div><div>$ ack '__NR_fork' /usr/include/</div><div>/usr/include/asm-generic/unistd.h</div><div>849:#define __NR_fork 1079</div><div>851:__SYSCALL(__NR_fork, sys_fork)</div><div>853:__SYSCALL(__NR_fork, sys_ni_syscall)</div>


<div>857:#define __NR_syscalls (__NR_fork+1)</div><div><br></div><div>/usr/include/x86_64-linux-gnu/asm/unistd_32.h</div><div>10:#define __NR_fork              2</div><div><br></div><div>/usr/include/x86_64-linux-gnu/asm/unistd_64.h</div>


<div>136:#define __NR_fork                           57</div><div>137:__SYSCALL(__NR_fork, stub_fork)</div><div><br></div><div>/usr/include/x86_64-linux-gnu/bits/syscall.h</div><div>70:#define SYS_fork __NR_fork</div><div>


417:#define SYS_fork __NR_fork</div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote"><div><div>On Mon, Jun 9, 2014 at 5:08 PM, Sandeep K Chaudhary <span dir="ltr"><<a href="mailto:babbusandy2006@gmail.com" target="_blank">babbusandy2006@gmail.com</a>></span> wrote:<br>


</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div><div dir="ltr">Hi guys,<div><br></div><div>I am following this[1] tutorial to install clang. However, I have made a small change in the configure command, and I am running it with '--enable-optimized' option to avoid the debug build. </div>




<div><br></div><div>I am getting the errors (given at the end) related to <b>undeclared identifiers '__NR_*'</b>. Can someone please provide some input about how to tackle this issue? </div><div><br></div><div>On my other machine, I followed the same guide[1] (without the --enable-optimized option), and everything built successfully.</div>




<div><br></div><div>[1] <a href="http://clang.llvm.org/get_started.html" target="_blank">http://clang.llvm.org/get_started.html</a><br></div><div><br></div><div>====================</div><div>warning: <a href="http://clang_darwin.mk" target="_blank">clang_darwin.mk</a>: dropping arch 'x86_64h' from lib 'ubsan_osx' (ld does not support it)<br>



</div><div>
<div>make[5]: Entering directory `/home/sandeep/llvm_clang/llvm/projects/compiler-rt'</div><div>  COMPILE:   clang_linux/san-i386/i386: /home/sandeep/llvm_clang/llvm/projects/compiler-rt/lib/sanitizer_common/sanitizer_linux.cc</div>




<div>/home/sandeep/llvm_clang/llvm/projects/compiler-rt/lib/sanitizer_common/sanitizer_linux.cc:123:27: error: use of undeclared identifier '__NR_open'</div><div>  return internal_syscall(SYSCALL(open), (uptr)filename, flags);</div>




<div>                          ^</div><div>/home/sandeep/llvm_clang/llvm/projects/compiler-rt/lib/sanitizer_common/sanitizer_syscall_generic.inc:17:24: note: expanded from macro 'SYSCALL'</div><div># define SYSCALL(name) __NR_ ## name</div>




<div>                       ^</div><div><scratch space>:62:1: note: expanded from here</div><div>__NR_open</div><div>^</div><div>/home/sandeep/llvm_clang/llvm/projects/compiler-rt/lib/sanitizer_common/sanitizer_linux.cc:132:27: error: use of undeclared identifier '__NR_open'</div>




<div>  return internal_syscall(SYSCALL(open), (uptr)filename, flags, mode);</div><div>                          ^</div><div>--------------</div><div><br></div><div>/home/sandeep/llvm_clang/llvm/projects/compiler-rt/lib/sanitizer_common/sanitizer_linux.cc:516:27: error: use of undeclared identifier '__NR_fork'</div>




<div>  return internal_syscall(SYSCALL(fork));</div><div>                          ^</div><div>/home/sandeep/llvm_clang/llvm/projects/compiler-rt/lib/sanitizer_common/sanitizer_syscall_generic.inc:17:24: note: expanded from macro 'SYSCALL'</div>




<div># define SYSCALL(name) __NR_ ## name</div><div>                       ^</div><div><scratch space>:62:1: note: expanded from here</div><div>__NR_fork</div><div>^</div><div>12 errors generated.</div><div>make[5]: *** [/home/sandeep/llvm_clang/build/tools/clang/runtime/compiler-rt/clang_linux/san-i386/i386/SubDir.lib__sanitizer_common/sanitizer_linux.o] Error 1</div>




<div>make[5]: Leaving directory `/home/sandeep/llvm_clang/llvm/projects/compiler-rt'</div><div>make[4]: *** [BuildRuntimeLibraries] Error 2</div><div>make[4]: Leaving directory `/home/sandeep/llvm_clang/build/tools/clang/runtime/compiler-rt'</div>




<div>make[3]: *** [compiler-rt/.makeall] Error 2</div><div>make[3]: Leaving directory `/home/sandeep/llvm_clang/build/tools/clang/runtime'</div><div>make[2]: *** [all] Error 1</div><div>make[2]: Leaving directory `/home/sandeep/llvm_clang/build/tools/clang'</div>




<div>make[1]: *** [clang/.makeall] Error 2</div><div>make[1]: Leaving directory `/home/sandeep/llvm_clang/build/tools'</div><div>make: *** [all] Error 1</div><div><br></div></div><div>Thanks and regards,<br>Sandeep.</div>




<div><br></div></div>
<br></div></div>_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@cs.uiuc.edu" target="_blank">cfe-dev@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br>
<br></blockquote></div><br></div>
</blockquote></div><br><br clear="all"><div><br></div></div></div><div class="">-- <br>Thanks and regards,<br>Sandeep K Chaudhary.
</div></div>
<br>_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div dir="ltr">Alexey Samsonov<br><a href="mailto:vonosmas@gmail.com" target="_blank">vonosmas@gmail.com</a></div>
</div></div>