Description of problem: Trying to compile --- #include <stdio.h> int main(void) { printf("Hello, world!\n"); return 0; } --- fails with a segfault (dumped onto console) and a return value at the prompt of 254. Version-Release number of selected component (if applicable): clang version 3.5.0 (tags/RELEASE_350/final) How reproducible: 100% Steps to Reproduce: 1. clang -c hello.c 2. 3. Actual results: Segfault. Expected results: Functional hello world program generated. Additional info: AMD Seattle Overdrive B0 platform (otherwise fully functional - gcc works fine and can rebuild the kernel among other things).
$ clang -v /tmp/hello.c ;echo $? clang version 3.6.1 (tags/RELEASE_361/final) Target: aarch64-redhat-linux-gnu Thread model: posix Found candidate GCC installation: /bin/../lib/gcc/aarch64-redhat-linux/5.1.1 Found candidate GCC installation: /usr/lib/gcc/aarch64-redhat-linux/5.1.1 Selected GCC installation: /bin/../lib/gcc/aarch64-redhat-linux/5.1.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.c -mrelocation-model 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.1 -internal-isystem /usr/local/include -internal-isystem /usr/bin/../lib/clang/3.6.1/include -internal-externc-isystem /usr/include -internal-externc-isystem /usr/lib/gcc/aarch64-redhat-linux/5.1.1/include -fdebug-compilation-dir /home/hrw/rpmbuild/fedora-packager/lv2-fabla -ferror-limit 19 -fmessage-length 187 -mstackrealign -fallow-half-arguments-and-returns -fno-signed-char -fobjc-runtime=gcc -fdiagnostics-show-option -fcolor-diagnostics -o /tmp/hello-e9f3ec.o -x c /tmp/hello.c clang -cc1 version 3.6.1 based upon LLVM 3.6.1 default target aarch64-redhat-linux-gnu #include "..." search starts here: #include <...> search starts here: /usr/local/include /usr/bin/../lib/clang/3.6.1/include /usr/include /usr/lib/gcc/aarch64-redhat-linux/5.1.1/include End of search list. #0 0x3ff986ec6c4 llvm::sys::PrintStackTrace(_IO_FILE*) (/usr/lib64/llvm/libLLVM-3.6.so+0x7ac6c4) #1 0x3ff986eaeac (/usr/lib64/llvm/libLLVM-3.6.so+0x7aaeac) #2 0x3ff99a50510 (linux-vdso.so.1+0x510) #3 0x3ff98c5ef04 llvm::MachineInstr::addOperand(llvm::MachineFunction&, llvm::MachineOperand const&) (/usr/lib64/llvm/libLLVM-3.6.so+0xd1ef04) #4 0x3ff98664b48 llvm::AArch64InstrInfo::storeRegToStackSlot(llvm::MachineBasicBlock&, llvm::MachineBasicBlock::bundle_iterator<llvm::MachineInstr, llvm::ilist_iterator<llvm::MachineInstr> >, unsigned int, bool, int, llvm::TargetRegisterClass const*, llvm::TargetRegisterInfo const*) const (/usr/lib64/llvm/libLLVM-3.6.so+0x724b48) #5 0x3ff98cc2670 (/usr/lib64/llvm/libLLVM-3.6.so+0xd82670) #6 0x3ff98cc32c8 (/usr/lib64/llvm/libLLVM-3.6.so+0xd832c8) #7 0x3ff98cc61f8 (/usr/lib64/llvm/libLLVM-3.6.so+0xd861f8) #8 0x3ff98cc6974 (/usr/lib64/llvm/libLLVM-3.6.so+0xd86974) #9 0x3ff9890f54c llvm::FPPassManager::runOnFunction(llvm::Function&) (/usr/lib64/llvm/libLLVM-3.6.so+0x9cf54c) #10 0x3ff9890f880 llvm::FPPassManager::runOnModule(llvm::Module&) (/usr/lib64/llvm/libLLVM-3.6.so+0x9cf880) #11 0x3ff9890fb10 llvm::legacy::PassManagerImpl::run(llvm::Module&) (/usr/lib64/llvm/libLLVM-3.6.so+0x9cfb10) #12 0x2aad1537114 clang::EmitBackendOutput(clang::DiagnosticsEngine&, clang::CodeGenOptions const&, clang::TargetOptions const&, clang::LangOptions const&, llvm::StringRef, llvm::Module*, clang::BackendAction, llvm::raw_ostream*) (/usr/bin/clang+0x577114) #13 0x2aad1527f40 (/usr/bin/clang+0x567f40) #14 0x2aad16c35d8 clang::ParseAST(clang::Sema&, bool, bool) (/usr/bin/clang+0x7035d8) #15 0x2aad152857c clang::CodeGenAction::ExecuteAction() (/usr/bin/clang+0x56857c) #16 0x2aad13b7164 clang::FrontendAction::Execute() (/usr/bin/clang+0x3f7164) #17 0x2aad1393490 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/usr/bin/clang+0x3d3490) #18 0x2aad137d66c clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/usr/bin/clang+0x3bd66c) #19 0x2aad1379020 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/usr/bin/clang+0x3b9020) #20 0x2aad1377da8 main (/usr/bin/clang+0x3b7da8) #21 0x3ff97a0fafc __libc_start_main (/lib64/libc.so.6+0x1fafc) #22 0x2aad13785c4 _start (/usr/bin/clang+0x3b85c4) Stack dump: 0. Program arguments: /usr/bin/clang -cc1 -triple aarch64-redhat-linux-gnu -emit-obj -mrelax-all -disable-free -disable-llvm-verifier -main-file-name hello.c -mrelocation-model 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.1 -internal-isystem /usr/local/include -internal-isystem /usr/bin/../lib/clang/3.6.1/include -internal-externc-isystem /usr/include -internal-externc-isystem /usr/lib/gcc/aarch64-redhat-linux/5.1.1/include -fdebug-compilation-dir /home/hrw/rpmbuild/fedora-packager/lv2-fabla -ferror-limit 19 -fmessage-length 187 -mstackrealign -fallow-half-arguments-and-returns -fno-signed-char -fobjc-runtime=gcc -fdiagnostics-show-option -fcolor-diagnostics -o /tmp/hello-e9f3ec.o -x c /tmp/hello.c 1. <eof> parser at end of file 2. Code generation 3. Running pass 'Function Pass Manager' on module '/tmp/hello.c'. 4. Running pass 'Fast Register Allocator' on function '@main' clang: error: unable to execute command: Segmentation fault (core dumped) clang: error: clang frontend command failed due to signal (use -v to see invocation) clang version 3.6.1 (tags/RELEASE_361/final) Target: aarch64-redhat-linux-gnu Thread model: posix clang: note: diagnostic msg: PLEASE submit a bug report to http://llvm.org/bugs/ and include the crash backtrace, preprocessed source, and associated run script. clang: note: diagnostic msg: ******************** PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT: Preprocessed source(s) and associated run script(s) are located at: clang: note: diagnostic msg: /tmp/hello-5c92b1.c clang: note: diagnostic msg: /tmp/hello-5c92b1.sh clang: note: diagnostic msg: ******************** 254
Created attachment 1053820 [details] /tmp/hello-5c92b1.c
Created attachment 1053821 [details] /tmp/hello-5c92b1.sh
problem still present in rawhide
12:32 hrw@pinkiepie-rawhide:devel$ clang -v hello.c clang version 3.7.0 (tags/RELEASE_370/final) Target: aarch64-redhat-linux-gnu Thread model: posix Found candidate GCC installation: /bin/../lib/gcc/aarch64-redhat-linux/5.3.1 Found candidate GCC installation: /usr/lib/gcc/aarch64-redhat-linux/5.3.1 Selected GCC installation: /bin/../lib/gcc/aarch64-redhat-linux/5.3.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.c -mrelocation-model 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.1 -v -dwarf-column-info -resource-dir /usr/bin/../lib/clang/3.7.0 -internal-isystem /usr/local/include -internal-isystem /usr/bin/../lib/clang/3.7.0/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -fdebug-compilation-dir /home/hrw/devel -ferror-limit 19 -fmessage-length 138 -mstackrealign -fallow-half-arguments-and-returns -fno-signed-char -fobjc-runtime=gcc -fdiagnostics-show-option -fcolor-diagnostics -o /tmp/hello-4f4ec2.o -x c hello.c clang -cc1 version 3.7.0 based upon LLVM 3.7.0 default target aarch64-redhat-linux-gnu ignoring nonexistent directory "/include" #include "..." search starts here: #include <...> search starts here: /usr/local/include /usr/bin/../lib/clang/3.7.0/include /usr/include End of search list. "/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 /bin/../lib/gcc/aarch64-redhat-linux/5.3.1/../../../../lib64/crt1.o /bin/../lib/gcc/aarch64-redhat-linux/5.3.1/../../../../lib64/crti.o /bin/../lib/gcc/aarch64-redhat-linux/5.3.1/crtbegin.o -L/bin/../lib/gcc/aarch64-redhat-linux/5.3.1 -L/bin/../lib/gcc/aarch64-redhat-linux/5.3.1/../../../../lib64 -L/usr/bin/../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/bin/../lib/gcc/aarch64-redhat-linux/5.3.1/../../.. -L/usr/bin/../lib -L/lib -L/usr/lib /tmp/hello-4f4ec2.o -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed /bin/../lib/gcc/aarch64-redhat-linux/5.3.1/crtend.o /bin/../lib/gcc/aarch64-redhat-linux/5.3.1/../../../../lib64/crtn.o 12:32 hrw@pinkiepie-rawhide:devel$ ./a.out hello world