Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Compiling world with llvm-gcc.
View unanswered posts
View posts from last 24 hours

Goto page Previous  1, 2  
Reply to topic    Gentoo Forums Forum Index Unsupported Software
View previous topic :: View next topic  
Author Message
the8lack8ox
n00b
n00b


Joined: 03 Feb 2009
Posts: 29
Location: Cleveland, OH, USA

PostPosted: Fri May 25, 2012 9:56 am    Post subject: Reply with quote

I too have experienced the infinite loop issue during linking, except it was when building guile. The only choice I had was to turn off LTO. After building 1000 different packages with clang -O4 I only experienced that once or twice, I don't remember if there was another one. There must be a bug in gold or the plugin. I may look into the issue further and submit a bug report, once my usual machine is running again. Thanks for the tip on screen.

Also, might I suggest you consider clang -O2 -flto for your standard package building. clang -O4 just forced me to rebuild my system due to so many segfaults at runtime. clang -O4 is the same as clang -O3 -flto, I believe. I plan to reserve the -O3 optimizations for select packages I handpick.

Addendum:
Did you at one point have libcxx installed on your system? Just a wild guess but maybe that has to do with why it's looking for cxxabi.h.
Back to top
View user's profile Send private message
SeeksTheMoon
Apprentice
Apprentice


Joined: 24 Sep 2003
Posts: 163

PostPosted: Fri May 25, 2012 3:00 pm    Post subject: Reply with quote

the8lack8ox wrote:
Also, might I suggest you consider clang -O2 -flto for your standard package building. clang -O4 just forced me to rebuild my system due to so many segfaults at runtime. clang -O4 is the same as clang -O3 -flto, I believe. I plan to reserve the -O3 optimizations for select packages I handpick.


I tried -O2 -flto, but in case of screen there is no difference to -O4, it either fails or loops.

Quote:
Did you at one point have libcxx installed on your system? Just a wild guess but maybe that has to do with why it's looking for cxxabi.h.


no, but I installed it now and there is no problem anymore with clang-compiling llvm. (I used CXX="/usr/bin/clang++ -stdlib=libc++ -O2 -flto"). compiling clang still fails with 'cxxabi.h' file not found, maybe because the gcc's system headers are (were?) hardcoded in clang.

Oh, and one should not compile x11-drivers with clang. It compiles, but e.g. KDE returns back to the login mask, after logging in, claiming it could not find a running dbus session, but after recompiling my x11 video driver with gcc it worked again. This is odd, but maybe these drivers are too linux specific because of this drm/kms stuff inside (xf86-video-ati in my case).
Back to top
View user's profile Send private message
the8lack8ox
n00b
n00b


Joined: 03 Feb 2009
Posts: 29
Location: Cleveland, OH, USA

PostPosted: Fri May 25, 2012 4:01 pm    Post subject: libcxxabi-9999 ebuild Reply with quote

I got your back. Here is an ebuild I just made for the libcxxabi package. Fair warning: for me, this built LLVM; it also broke it horribly. :cry:
Back to top
View user's profile Send private message
SeeksTheMoon
Apprentice
Apprentice


Joined: 24 Sep 2003
Posts: 163

PostPosted: Thu May 31, 2012 9:22 am    Post subject: Reply with quote

fix-buildit.patch is not there but libcxxabi compiles without it anyway. After installing libcxxabi I was able to compile llvm and clang using clang -O2. I will go through my list of gcc-fallbacks again and try them with clang again.

xorg-server throws a floating point exception if compiled with clang -O2, but I found a BSD forum entry where they compiled and started it successfully with clang -O1, I will try this also. Then I'll print my list again.
Back to top
View user's profile Send private message
SeeksTheMoon
Apprentice
Apprentice


Joined: 24 Sep 2003
Posts: 163

PostPosted: Thu May 31, 2012 12:20 pm    Post subject: Reply with quote

with libcxxabi it is much better to compile packages; I think that this enables nearly all important packages and that it is safe to use -O2 without LTO for the system. I also found out that clang is not always faster, e.g. compiling clang (with a clang compiled clang) needs 5 minutes more than with gcc.

Now, here is my package.env file:

Code:
# fallback from -O2 -lto to clang -O2:
# if build fails, emerge libcxxabi.
app-misc/screen clangO2
sci-geosciences/gpsd clangO2
dev-python/pycrypto clangO2
net-misc/openssh clangO2
sys-power/apcupsd clangO2
sys-libs/libutempter clangO2
app-doc/doxygen clangO2
app-editors/vim clangO2
sys-devel/llvm clangO2
sys-devel/clang clangO2
dev-libs/boost clangO2
sci-libs/ufconfig clangO2
dev-db/unixODBC clangO2
dev-libs/hyphen clangO2
app-text/libwpd clangO2
app-text/libwpg clangO2
media-video/mkvtoolnix clangO2
dev-libs/DirectFB clangO2
sys-apps/dbus clangO2
# x11-libs/qt-core clangO2 #only with USE="-pch", other qt libs: dito

# fallback from clang to gcc:
media-libs/mesa gcc
x11-drivers/xf86-video-ati gcc
x11-libs/libdrm gcc
media-libs/opencv gcc
dev-libs/boehm-gc gcc
net-print/cups gcc
app-office/akonadi-server gcc
dev-db/mysql gcc
net-p2p/ktorrent gcc
media-gfx/gimp gcc
www-client/firefox gcc
games-engines/scummvm-tools gcc
sys-cluster/openmpi gcc #compiles with clangO2 but weird install error
x11-libs/qt-core gcc # for USE=pch
x11-libs/qt-sql gcc # dito
sys-libs/glibc gcc #just too GNU
sys-block/thin-provisioning-tools gcc # uses -O8, just stupid. But does not compile even after patching this
app-emulation/virtualbox gcc #needs 32bit libs
app-emulation/wine gcc #needs 32bit libs
x11-base/xorg-server gcc #compiles, but throws floating point exception
Back to top
View user's profile Send private message
the8lack8ox
n00b
n00b


Joined: 03 Feb 2009
Posts: 29
Location: Cleveland, OH, USA

PostPosted: Mon Jun 04, 2012 12:59 pm    Post subject: Reply with quote

SeeksTheMoon wrote:
fix-buildit.patch is not there but libcxxabi compiles without it anyway. After installing libcxxabi I was able to compile llvm and clang using clang -O2. I will go through my list of gcc-fallbacks again and try them with clang again.

xorg-server throws a floating point exception if compiled with clang -O2, but I found a BSD forum entry where they compiled and started it successfully with clang -O1, I will try this also. Then I'll print my list again.


Thanks for the tip about xorg-server. No wonder Xorg wouldn't start. Right now I switched my machine and all 1179 packages back to GCC, but I'll try going back to clang before too long. I just have some other projects in the way right now. I'll get to bug reporting and more compatibility testing eventually.

fix-buildit.patch is available here. Using this with libcxx and libcxxabi caused a strange bug for me with LTO in clang. Part of a temporary filename vanishes while clang is using it, causing clang to fail sometimes with LTO turned on.
_________________
* Applying another-hack-im-going-to-hell-for.patch ... [ ok ]
Back to top
View user's profile Send private message
ryao
Developer
Developer


Joined: 27 Feb 2012
Posts: 132

PostPosted: Mon Jun 04, 2012 1:59 pm    Post subject: Reply with quote

SeeksTheMoon wrote:
sys-libs/glibc (sure, glibc is very GNUish, I bet that gcc also won't compile with clang)


I have compiled GCC with Clang, so you lose that bet. Also, the failure in glibc is because it checks explicitly if the compiler is a recent GCC and Clang identifies itself as GCC 4.2.x to it. There could be other failures past that, but I have not tried disabling the check.
Back to top
View user's profile Send private message
SeeksTheMoon
Apprentice
Apprentice


Joined: 24 Sep 2003
Posts: 163

PostPosted: Mon Jun 04, 2012 9:27 pm    Post subject: Reply with quote

it also seems that glibc does not like ld gold and claims that ld is missing
Back to top
View user's profile Send private message
SeeksTheMoon
Apprentice
Apprentice


Joined: 24 Sep 2003
Posts: 163

PostPosted: Tue Jun 05, 2012 8:33 am    Post subject: Reply with quote

I found out that I made some unproper testings, because I use /bin/sh -> dash instead of bash and e.g. cups uses a bashism in it's install.sh script (after removing the bashism, installation worked /Edit: reported upstream/). Further, the change of ld.bfd to ld.gold causes problems for some packages, so it is wrong to say that this was clang's fault.
Back to top
View user's profile Send private message
the8lack8ox
n00b
n00b


Joined: 03 Feb 2009
Posts: 29
Location: Cleveland, OH, USA

PostPosted: Tue Jun 05, 2012 8:55 pm    Post subject: Firefox 13.0 with Clang! Reply with quote

The newly released version 13 of Firefox builds with clang -O4 -march=bdver1 for me. I don't know whether it's improvements in the new version or whether it's Clang/LLVM, but there is a quite notable improvement in performance. :o
_________________
* Applying another-hack-im-going-to-hell-for.patch ... [ ok ]
Back to top
View user's profile Send private message
ryao
Developer
Developer


Joined: 27 Feb 2012
Posts: 132

PostPosted: Sun Jun 10, 2012 6:32 pm    Post subject: Reply with quote

SeeksTheMoon wrote:
I found out that I made some unproper testings, because I use /bin/sh -> dash instead of bash and e.g. cups uses a bashism in it's install.sh script (after removing the bashism, installation worked /Edit: reported upstream/). Further, the change of ld.bfd to ld.gold causes problems for some packages, so it is wrong to say that this was clang's fault.


I would call that a bug. Please file a bug report.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Unsupported Software All times are GMT
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum