Description of problem: clang on Cauldron fails to compile the hello world program with these errors: clang-3.8: error: no such file or directory: 'hello_world.' clang-3.8: error: no input files gcc works fine. Script started on Wed 06 Apr 2016 11:34:51 IDT shlomif@telaviv1:~/progs/C/snippets/shlomif-c-snippets$ whci[K[Kich clang /usr/bin/clang shlomif@telaviv1:~/progs/C/snippets/shlomif-c-snippets$ which gcc /home/shlomif/bin/gcc shlomif@telaviv1:~/progs/C/snippets/shlomif-c-snippets$ cat hello_world.c /* * The canonical Hello World program kept here to avoid code duplication * * License is the MIT/X11 license - http://opensource.org/licenses/MIT . * ( https://en.wikipedia.org/wiki/MIT_License ). */ #include <stdio.h> int main(void) { printf ("%s\n", "Hello World!"); return 0; } shlomif@telaviv1:~/progs/C/snippets/shlomif-c-snippets$ gcc -o hello.gcc.exe hel lo_world.c shlomif@telaviv1:~/progs/C/snippets/shlomif-c-snippets$ ./hello.gcc.exe Hello World! shlomif@telaviv1:~/progs/C/snippets/shlomif-c-snippets$ clang hello_world. clang-3.8: error: no such file or directory: 'hello_world.' clang-3.8: error: no input files shlomif@telaviv1:~/progs/C/snippets/shlomif-c-snippets$ clang hello_world.c /usr/bin/ld: cannot find crtbegin.o: No such file or directory /usr/bin/ld: cannot find -lgcc clang-3.8: error: linker command failed with exit code 1 (use -v to see invocation) shlomif@telaviv1:~/progs/C/snippets/shlomif-c-snippets$ exit exit Script done on Wed 06 Apr 2016 11:36:38 IDT
Some more notes: 1. Rebuilding clang and then llvm and installing all their packages locally did not fix the problem. 2. It also happens in a new UNIX user account: <<<<< kdetest@telaviv1:~$ clang /var/tmp/hello_world.c /bin/ld: cannot find crtbegin.o: No such file or directory /bin/ld: cannot find -lgcc clang-3.8: error: linker command failed with exit code 1 (use -v to see invocation) kdetest@telaviv1:~$ cat /var/tmp/hello_world.c /* * The canonical Hello World program kept here to avoid code duplication * * License is the MIT/X11 license - http://opensource.org/licenses/MIT . * ( https://en.wikipedia.org/wiki/MIT_License ). */ #include <stdio.h> int main(void) { printf ("%s\n", "Hello World!"); return 0; } kdetest@telaviv1:~$ >>>>>
(In reply to Shlomi Fish from comment #0) > clang on Cauldron fails to compile the hello world program with these > errors: > > clang-3.8: error: no such file or directory: 'hello_world.' > clang-3.8: error: no input files > > gcc works fine. I guess you did not meant to report those errors as a bug? Obviously you just mistyped the filename here, and it can't find it. The other part you reported seems like a valid issue though: (In reply to Shlomi Fish from comment #1) > kdetest@telaviv1:~$ clang /var/tmp/hello_world.c > /bin/ld: cannot find crtbegin.o: No such file or directory > /bin/ld: cannot find -lgcc > clang-3.8: error: linker command failed with exit code 1 (use -v to see > invocation)
(In reply to Rémi Verschelde from comment #2) > (In reply to Shlomi Fish from comment #0) > > clang on Cauldron fails to compile the hello world program with these > > errors: > > > > clang-3.8: error: no such file or directory: 'hello_world.' > > clang-3.8: error: no input files > > > > gcc works fine. > > I guess you did not meant to report those errors as a bug? Obviously you > just mistyped the filename here, and it can't find it. > This was just part of my transcript. There's the right command below it which doesn't work - with different messages, and it is OK. For the record, it is: <<<<<<< shlomif@telaviv1:~/progs/C/snippets/shlomif-c-snippets$ clang hello_world.c /usr/bin/ld: cannot find crtbegin.o: No such file or directory /usr/bin/ld: cannot find -lgcc clang-3.8: error: linker command failed with exit code 1 (use -v to see invocation) shlomif@telaviv1:~/progs/C/snippets/shlomif-c-snippets$ >>>>>>>> > > The other part you reported seems like a valid issue though: > > (In reply to Shlomi Fish from comment #1) > > kdetest@telaviv1:~$ clang /var/tmp/hello_world.c > > /bin/ld: cannot find crtbegin.o: No such file or directory > > /bin/ld: cannot find -lgcc > > clang-3.8: error: linker command failed with exit code 1 (use -v to see > > invocation)
Hi all, I can reproduce the same problem with LLVM+clang built from source on mageia v6 x86-64 and installed into /opt/llvm using this bash script: « #!/bin/bash b='/opt/llvm' export PATH="$b/bin:$PATH" export PKG_CONFIG_PATH="$b/lib64/pkgconfig:$b/lib/pkgconfig:$PKG_CONFIG_PATH" cmake -DCMAKE_BUILD_TYPE="release" -DCMAKE_INSTALL_PREFIX="$b" "$@" » LLVM's "make check" passed and I could not readily find how to run clang's tests. Anyway, it seems to be an upstream problem and I'll report it there.
CC: (none) => marja11Assignee: bugsquad => thierry.vignaud
Hi all! Reported upstream at https://llvm.org/bugs/show_bug.cgi?id=27290 .
URL: (none) => https://llvm.org/bugs/show_bug.cgi?id=27290
Keywords: (none) => UPSTREAMSee Also: (none) => https://llvm.org/bugs/show_bug.cgi?id=27290
*** Bug 18202 has been marked as a duplicate of this bug. ***
CC: (none) => jamagallon
One workaround I found for this bug today (thanks in part to this stackoverflow thread - http://stackoverflow.com/questions/4160262/clang-linker-problem#4160340 ) is to set these environment variables (e.g: by sourcing the code from Bash): « export COMPILER_PATH=/usr/lib/gcc/x86_64-mageia-linux-gnu/5.3.1/ export LIBRARY_PATH="$COMPILER_PATH" » after doing that, the Hello World program compiles and I was able to get Freecell Solver to build and pass its tests' suite using /usr/bin/clang.
Created attachment 7693 [details] Tentative patch to fix the problem.
Actually this script, posted by Shlomi Fish could work around the problem: gcc_ver=5.4.0 export COMPILER_PATH=/usr/lib/gcc/x86_64-mageia-linux-gnu/"$gcc_ver" export CPATH=/usr/include/c++/"$gcc_ver"/:/usr/include/c++/"$gcc_ver"/x86_64-mageia-linux-gnu export LIBRARY_PATH="$COMPILER_PATH" export LD=/usr/bin/ld.gold
CC: (none) => ghibomgx
lib/Driver/ToolChains.cpp needs to be updated to support mageia, it contains things like: static const char *const X86_64Triples[] = { "x86_64-linux-gnu", "x86_64-unknown-linux-gnu", "x86_64-pc-linux-gnu", "x86_64-redhat-linux6E", "x86_64-redhat-linux", "x86_64-suse-linux", "x86_64-manbo-linux-gnu", "x86_64-linux-gnu", "x86_64-slackware-linux", "x86_64-linux-android", "x86_64-unknown-linux"};
CC: (none) => pterjan
http://svnweb.mageia.org/packages/cauldron/llvm/current/SOURCES/cfe-3.7.0-detect-Mageia.patch?revision=871736&view=markup&pathrev=939058
CC: (none) => cjw
Thanks, we also have armv5tl-mageia-linux-gnueabi and armv7hl-mageia-linux-gnueabi :)
Works for me too. I think we can close this bug too, as I was able to compile firefox with current clang/clang++ 3.8.1-3.mga6. Probably worthwhile to submit the patch upstream, if not yet done. A little off-topic, but for those interested, here is the score list of benchmark (Octane v2) for firefox compiled with clang (have not played much with compilation flags and LTO seems disabled) against gcc (higher score is better): firefox 48.0.2 with clang/clang++ 3.8.1 compilations flags: -O2 for clang, -O for clang++: 18768 firefox 48.0.2 with gcc 5.4.0 compilation flags: -O2 for gcc, -O2 for g++: 19902 firefox 48.0.2 upstream (they use gcc 4.8.5) compilation flags: -O3 for g++ with Profile Guided Optimazion enabled: 20901
Closing then
Status: NEW => RESOLVEDResolution: (none) => FIXED