clangupc / clang-upc

Clang UPC Front-End
https://clangupc.github.io/
Other
17 stars 5 forks source link

Opensuse 13.2 build missconfigured for 3.6 version #81

Closed nenadv closed 9 years ago

nenadv commented 9 years ago

I tried building 2.6 release on opensuse 13.2 (Tumbleweed). It fails to link as some of the GCC crt/libgcc are not found (both clang and clang-upc).

clang -### -o test test.c
[...]
/usr/bin/ld
-o t
/usr/lib/../lib64/crt1.o
/usr/lib/../lib64/crti.o
crtbegin.o  <<<<
-L/lib/../lib64
-L/usr/lib/../lib64
-L/eng/upc/dev/nenad/clang-upc/bld/llvm-dbg/bin/../lib
-L/eng/upc/dev/nenad/clang-upc/bld/llvm-dbg/bin/../lib
-L/lib
-L/usr/lib
[...]
-lgcc <<<<<
-lgcc_s
crtend.o <<<<<
/usr/lib/../lib64/crtn.o

It seems that the build does NOT include correct paths for GCC libraries and crtbegin.o, crtend.o, libgcc, libgcc_s, cannot be found.

nenadv commented 9 years ago

The system Clang 3.7 DOES have GCC library paths - /usr/bin/../lib64/gcc/x86_64-suse-linux/5 - included on the link line. And crtbegin.o is there with the full path to it. Note that system's clang can deal with multiple GCC installations (same on Fedora).

$ clang -v
clang version 3.7.0 (tags/RELEASE_370/final 246586)
Target: x86_64-suse-linux
Thread model: posix
Found candidate GCC installation: /usr/bin/../lib64/gcc/x86_64-suse-linux/5
Found candidate GCC installation: /usr/lib64/gcc/x86_64-suse-linux/5
Selected GCC installation: /usr/bin/../lib64/gcc/x86_64-suse-linux/5
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Selected multilib: .;@m64

Calng-upc does not show any paths for GCC candidates.

I also tried to build trunk (3.8) but got the same failure.

nenadv commented 9 years ago

This article suggests to use GCC_INSTALL_PREFIX configure switch. http://btorpey.github.io/blog/2015/01/02/building-clang/ Which I tried, however, I did couple of tries with some of the GCC paths, /usr/lib4/gcc/x86_64-suse-linux/5, /usr/lib64/gcc, ... and none of them worked.

One option is to build GCC and specify its install dri as GCC install prefix for Clang.

nenadv commented 9 years ago

https://llvm.org/bugs/show_bug.cgi?id=22295

Suggested patch: https://build.opensuse.org/package/view_file/devel:tools:compiler/llvm/llvm-fix-find-gcc5-install.patch?expand=1

nenadv commented 9 years ago

Fixed with https://github.com/Intrepid/clang-upc/commit/5bdb40d0c99f7040b8a7a29844eb5b592cd6c45f