<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">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>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><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>_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@cs.uiuc.edu">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>