Public bug reported:
*compiling* a simple test program such as this
int
main ()
{
;
return 0;
}
works out fine:
$ clang -v -c conftest.c
clang version 2.9 (tags/RELEASE_29/final)
Target: x86_64-pc-linux-gnu
Thread model: posix
"/usr/bin/clang" -cc1 -triple x86_64-pc-linux-gnu -emit-obj -mrelax-all
-disable-free -disable-llvm-verifier -main-file-name conftest.c
-mrelocation-model static -mdisable-fp-elim -masm-verbose -mconstructor-aliases
-munwind-tables -target-cpu x86-64 -target-linker-version 2.21.53.20110810
-momit-leaf-frame-pointer -v -resource-dir /usr/bin/../lib/clang/2.9
-ferror-limit 19 -fmessage-length 239 -fgnu-runtime -fdiagnostics-show-option
-fcolor-diagnostics -o conftest.o -x c conftest.c
clang -cc1 version 2.9 based upon llvm 2.9 hosted on x86_64-pc-linux-gnu
ignoring duplicate directory "/usr/include/x86_64-linux-gnu"
#include "..." search starts here:
#include <...> search starts here:
/usr/local/include
/usr/include/x86_64-linux-gnu
/usr/bin/../lib/clang/2.9/include
/usr/include
End of search list.
$
Linking it however, does not:
$ clang -v -o conftest conftest.o
clang version 2.9 (tags/RELEASE_29/final)
Target: x86_64-pc-linux-gnu
Thread model: posix
"/usr/bin/ld" --eh-frame-hdr -m elf_x86_64 -dynamic-linker
/lib64/ld-linux-x86-64.so.2 -o conftest crt1.o crti.o crtbegin.o -L
-L/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/../../.. conftest.o
-lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s
--no-as-needed crtend.o crtn.o
/usr/bin/ld.bfd.real: cannot find crt1.o: No such file or directory
/usr/bin/ld.bfd.real: cannot find crti.o: No such file or directory
/usr/bin/ld.bfd.real: cannot find crtbegin.o: No such file or directory
/usr/bin/ld.bfd.real: cannot find -lgcc
/usr/bin/ld.bfd.real: cannot find -lgcc_s
clang: error: linker command failed with exit code 1 (use -v to see invocation)
$
I am currently rebuilding clang/llvm-2.9 to verify if the information I found
on the internet is true:
"gcc used to build clang is not in a standard location"
http://stackoverflow.com/questions/5637178/clang-2-9-crt1-not-found-error
ProblemType: Bug
DistroRelease: Ubuntu 11.10
Package: clang 2.9-8
ProcVersionSignature: Ubuntu 3.0.0-11.17-generic 3.0.4
Uname: Linux 3.0.0-11-generic x86_64
NonfreeKernelModules: wl
ApportVersion: 1.22.1-0ubuntu2
Architecture: amd64
Date: Sun Sep 18 00:11:38 2011
InstallationMedia: Ubuntu 11.04 "Natty Narwhal" - Release amd64 (20110427.1)
ProcEnviron:
PATH=(custom, no user)
LANG=en_US.UTF-8
SHELL=/usr/bin/zsh
SourcePackage: clang
UpgradeStatus: Upgraded to oneiric on 2011-07-14 (65 days ago)
** Affects: clang (Ubuntu)
Importance: Undecided
Status: New
** Tags: amd64 apport-bug oneiric
--
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/852870
Title:
clang is unable to link binaries/libraries
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/clang/+bug/852870/+subscriptions
--
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs