<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>