Description of problem: Clang looks for headers and libraries in a wrong place on AArch64. $ clang++ -std=c++11 tc.cc tt.cc:1:10: fatal error: 'list' file not found #include <list> ^ 1 error generated. How reproducible: Compile any C++ code, e.g., example from en.cppreference.com cat << EOF > tc.cc #include <list> #include <string> #include <iostream> template<typename T> std::ostream& operator<<(std::ostream& s, const std::list<T>& v) { s.put('['); char comma[3] = {'\0', ' ', '\0'}; for (const auto& e : v) { s << comma << e; comma[0] = ','; } return s << ']'; } int main() { // c++11 initializer list syntax: std::list<std::string> words1 {"the", "frogurt", "is", "also", "cursed"}; std::cout << "words1: " << words1 << '\n'; // words2 == words1 std::list<std::string> words2(words1.begin(), words1.end()); std::cout << "words2: " << words2 << '\n'; // words3 == words1 std::list<std::string> words3(words1); std::cout << "words3: " << words3 << '\n'; // words4 is {"Mo", "Mo", "Mo", "Mo", "Mo"} std::list<std::string> words4(5, "Mo"); std::cout << "words4: " << words4 << '\n'; } EOF clang++ -std=c++11 tc.cc The libraries are installed at /usr/lib/gcc/aarch64-redhat-linux/4.8.1/ When I was debugging Clang driver (on F19) on aarch64 and x86_64 it looked like driver never used GCC version in the paths. Thus is went for /usr/lib/gcc/aarch64-redhat-linux. For headers defaults: #include "..." search starts here: #include <...> search starts here: /usr/local/include /usr/bin/../lib/clang/3.4.1/include /usr/include /usr/lib/gcc/aarch64-redhat-linux/4.8.1/include End of search list. Missing /usr/include/c++/4.8.1 The followed is enough to test lib paths: int main(void) { return 0; } Clang fails with: "/usr/bin/ld" --hash-style=gnu --no-add-needed --build-id --eh-frame-hdr -m aarch64linux -dynamic-linker /lib/ld-linux-aarch64.so.1 -o a.out /lib/../lib64/crt1.o /lib/../lib64/crti.o crtbegin.o -L/lib/../lib64 -L/usr/lib/../lib64 -L/lib -L/usr/lib /tmp/test-0ff054.o -lstdc++ -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc crtend.o /lib/../lib64/crtn.o /usr/bin/ld: cannot find crtbegin.o: No such file or directory /usr/bin/ld: cannot find -lstdc++ /usr/bin/ld: cannot find -lgcc_s /usr/bin/ld: cannot find -lgcc clang: error: linker command failed with exit code 1 (use -v to see invocation) While on x86_64 it has /usr/bin/../lib/gcc/x86_64-redhat-linux/4.8.2 Clang driver logic for finding the paths needs to be reviewed.
I'm aware of some of these issues. We're awaiting 3.5 to land because there's been some massive improvements and changes for aarch64 in that release.
> Clang fails with: > > "/usr/bin/ld" --hash-style=gnu --no-add-needed --build-id --eh-frame-hdr -m > aarch64linux -dynamic-linker /lib/ld-linux-aarch64.so.1 -o a.out > /lib/../lib64/crt1.o /lib/../lib64/crti.o crtbegin.o -L/lib/../lib64 > -L/usr/lib/../lib64 -L/lib -L/usr/lib /tmp/test-0ff054.o -lstdc++ -lm > -lgcc_s -lgcc -lc -lgcc_s -lgcc crtend.o /lib/../lib64/crtn.o > /usr/bin/ld: cannot find crtbegin.o: No such file or directory > /usr/bin/ld: cannot find -lstdc++ > /usr/bin/ld: cannot find -lgcc_s > /usr/bin/ld: cannot find -lgcc > clang: error: linker command failed with exit code 1 (use -v to see > invocation) > > While on x86_64 it has /usr/bin/../lib/gcc/x86_64-redhat-linux/4.8.2 What release are you using? F-21 has gcc 4.9.x not 4.8.x
I am still running F19 with Clang 3.4 on the boards, but hrw (IRC) double checked it on F21.
(In reply to David Abdurachmanov from comment #3) > I am still running F19 with Clang 3.4 on the boards, but hrw (IRC) double > checked it on F21. F-19 isn't supported. Please move to F-21. There are numerous toolchain issues and changes between the two.
15:28 hrw@pinkiepie-rawhide:devel$ clang++ --verbose hello.cc clang version 3.6.2 (tags/RELEASE_362/final) Target: aarch64-redhat-linux-gnu Thread model: posix Found candidate GCC installation: /bin/../lib/gcc/aarch64-redhat-linux/5.2.1 Found candidate GCC installation: /usr/lib/gcc/aarch64-redhat-linux/5.2.1 Selected GCC installation: /bin/../lib/gcc/aarch64-redhat-linux/5.2.1 Candidate multilib: .;@m64 Selected multilib: .;@m64 "/usr/bin/clang" -cc1 -triple aarch64-redhat-linux-gnu -emit-obj -mrelax-all -disable-free -disable-llvm-verifier -main-file-name hello.cc -mrelocation-m odel static -mthread-model posix -mdisable-fp-elim -fmath-errno -masm-verbose -mconstructor-aliases -fuse-init-array -target-cpu generic -target-feature + neon -target-abi aapcs -target-linker-version 2.25 -v -dwarf-column-info -resource-dir /usr/bin/../lib/clang/3.6.2 -internal-isystem /bin/../lib/gcc/aarch 64-redhat-linux/5.2.1/../../../../include/c++/5.2.1 -internal-isystem /bin/../lib/gcc/aarch64-redhat-linux/5.2.1/../../../../include/c++/5.2.1/aarch64-red hat-linux -internal-isystem /bin/../lib/gcc/aarch64-redhat-linux/5.2.1/../../../../include/c++/5.2.1/backward -internal-isystem /usr/local/include -intern al-isystem /usr/bin/../lib/clang/3.6.2/include -internal-externc-isystem /usr/include -internal-externc-isystem /usr/lib/gcc/aarch64-redhat-linux/5.1.1/in clude -fdeprecated-macro -fdebug-compilation-dir /home/hrw/devel -ferror-limit 19 -fmessage-length 154 -mstackrealign -fallow-half-arguments-and-returns - fno-signed-char -fobjc-runtime=gcc -fcxx-exceptions -fexceptions -fdiagnostics-show-option -fcolor-diagnostics -o /tmp/hello-409df4.o -x c++ hello.cc clang -cc1 version 3.6.2 based upon LLVM 3.6.2 default target aarch64-redhat-linux-gnu ignoring nonexistent directory "/usr/lib/gcc/aarch64-redhat-linux/5.1.1/include" #include "..." search starts here: #include <...> search starts here: /bin/../lib/gcc/aarch64-redhat-linux/5.2.1/../../../../include/c++/5.2.1 /bin/../lib/gcc/aarch64-redhat-linux/5.2.1/../../../../include/c++/5.2.1/aarch64-redhat-linux /bin/../lib/gcc/aarch64-redhat-linux/5.2.1/../../../../include/c++/5.2.1/backward /usr/local/include /usr/bin/../lib/clang/3.6.2/include /usr/include End of search list.
version rawhide has it sorted out then it crashes - bug 1227460