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.
I am getting the errors (given at the end) related to undeclared identifiers ‘_NR*’. Can someone please provide some input about how to tackle this issue?
On my other machine, I followed the same guide[1] (without the --enable-optimized option), and everything built successfully.
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:
Can you provide details about your system (uname -a)? It is weird that you
don't have __NR_open defined in your system headers.
As a workaround, you may drop compiler-rt repository from your checkout,
it's possible to build Clang without it.
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.
I just grep’ed for ‘__NR_fork’, and I can see these numbers in the header files.
sandeep@ubuntu:/usr/include$ uname -a
Linux ubuntu 3.13.0-29-generic #53-Ubuntu SMP Wed Jun 4 21:00:20 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
I recently upgraded my Linux version (to Ubuntu 14.04). Could the issue be because of that?
So to drop compiler-rt, I can just delete the whole directory and do an incremental build? The reason I’m asking this is - it takes more than a couple of hours for the build on my system. It would be great if I can avoid it. Please let me know.
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.
I just grep'ed for '__NR_fork', and I can see these numbers in the header
files.