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.
On my other machine, I followed the same guide[1] (without the --enable-optimized option), and everything built successfully.
make[5]: Entering directory `/home/sandeep/llvm_clang/llvm/projects/compiler-rt'
COMPILE: clang_linux/san-i386/i386: /home/sandeep/llvm_clang/llvm/projects/compiler-rt/lib/sanitizer_common/sanitizer_linux.cc
/home/sandeep/llvm_clang/llvm/projects/compiler-rt/lib/sanitizer_common/sanitizer_linux.cc:123:27: error: use of undeclared identifier '__NR_open'
return internal_syscall(SYSCALL(open), (uptr)filename, flags);
^
/home/sandeep/llvm_clang/llvm/projects/compiler-rt/lib/sanitizer_common/sanitizer_syscall_generic.inc:17:24: note: expanded from macro 'SYSCALL'
# define SYSCALL(name) __NR_ ## name
^
<scratch space>:62:1: note: expanded from here
__NR_open
^
/home/sandeep/llvm_clang/llvm/projects/compiler-rt/lib/sanitizer_common/sanitizer_linux.cc:132:27: error: use of undeclared identifier '__NR_open'
return internal_syscall(SYSCALL(open), (uptr)filename, flags, mode);
^
--------------
/home/sandeep/llvm_clang/llvm/projects/compiler-rt/lib/sanitizer_common/sanitizer_linux.cc:516:27: error: use of undeclared identifier '__NR_fork'
return internal_syscall(SYSCALL(fork));
^
/home/sandeep/llvm_clang/llvm/projects/compiler-rt/lib/sanitizer_common/sanitizer_syscall_generic.inc:17:24: note: expanded from macro 'SYSCALL'
# define SYSCALL(name) __NR_ ## name
^
<scratch space>:62:1: note: expanded from here
__NR_fork
^
12 errors generated.
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
make[5]: Leaving directory `/home/sandeep/llvm_clang/llvm/projects/compiler-rt'
make[4]: *** [BuildRuntimeLibraries] Error 2
make[4]: Leaving directory `/home/sandeep/llvm_clang/build/tools/clang/runtime/compiler-rt'
make[3]: *** [compiler-rt/.makeall] Error 2
make[3]: Leaving directory `/home/sandeep/llvm_clang/build/tools/clang/runtime'
make[2]: *** [all] Error 1
make[2]: Leaving directory `/home/sandeep/llvm_clang/build/tools/clang'
make[1]: *** [clang/.makeall] Error 2
make[1]: Leaving directory `/home/sandeep/llvm_clang/build/tools'
make: *** [all] Error 1