Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
If clang/LLVM was finished, would you support Gentoo's move?
View unanswered posts
View posts from last 24 hours

Goto page Previous  1, 2, 3, 4, 5, 6, 7, 8, 9  Next  
Reply to topic    Gentoo Forums Forum Index Gentoo Chat
View previous topic :: View next topic  

Would you support a Gentoo move to clang/LLVM
Yes
78%
 78%  [ 157 ]
No
21%
 21%  [ 43 ]
Total Votes : 200

Author Message
wswartzendruber
Veteran
Veteran


Joined: 23 Mar 2004
Posts: 1261
Location: Idaho, USA

PostPosted: Sun May 23, 2010 4:22 pm    Post subject: Reply with quote

Shining Arcanine wrote:
It seems that Clang can now build the Boost C++ libraries:

http://blog.llvm.org/2010/05/clang-builds-boost.html

C++ support could be mature enough by the release of LLVM 2.8 that work could begin on replacing GCC with LLVM/Clang should people wish to work on that.

Beat me to the punch. :)
Back to top
View user's profile Send private message
wilsonsamm
Apprentice
Apprentice


Joined: 12 Jul 2008
Posts: 196

PostPosted: Tue Jun 22, 2010 11:01 am    Post subject: Reply with quote

It's been a few months since anyone's replied to this.
Is there still interest in this? And I'd like to lend a helping hand :-)
Back to top
View user's profile Send private message
n3rd
Guru
Guru


Joined: 30 Apr 2005
Posts: 328

PostPosted: Sun Jun 27, 2010 3:41 pm    Post subject: Reply with quote

Hi,

and what with security and hardened gentoo project?

Hardened gentoo strongly based on SSP and PIE in GCC (-PIE -fstack-protector). ICC compiler support like SSP stuff with -fstack-security-check. And how it looks in LLVM/CLANG??

ICC links everything to its own libraries, but we don't have noexecstack support in intel libraries and you can't fix this because it's closed source.

@avx you can test your system:
http://www.gentoo.org/proj/en/hardened/gnu-stack.xml

---
open source ICC alternative:
http://developer.amd.com/cpu/open64/pages/default.aspx

regards,
daniel
_________________
"Jeśli coś jest niemożliwe do zrobienia, przychodzi ktoś kto o tym nie wie i robi to."
-- Albert Einstein

Zanim zadasz pytanie na forum, wykonaj: /etc/init.d/brain.
Back to top
View user's profile Send private message
Shining Arcanine
Veteran
Veteran


Joined: 24 Sep 2009
Posts: 1110

PostPosted: Sun Jun 27, 2010 7:43 pm    Post subject: Reply with quote

wilsonsamm wrote:
It's been a few months since anyone's replied to this.
Is there still interest in this? And I'd like to lend a helping hand :-)


I avoided replying to this earlier because I was not sure what to say. C++ in LLVM/Clang is still too immature for this sort of thing to be done. It would be best to wait until LLVM 2.8 debuts.
Back to top
View user's profile Send private message
avx
Advocate
Advocate


Joined: 21 Jun 2004
Posts: 2152

PostPosted: Mon Jun 28, 2010 4:27 pm    Post subject: Reply with quote

Well, after ~1.5months my system is back up, thanks ASUS for your "perfect" support :evil:

Quote:
@avx you can test your system:
http://www.gentoo.org/proj/en/hardened/gnu-stack.xml
Looking into it as soon as I find some spare time.
Back to top
View user's profile Send private message
Skillshot
n00b
n00b


Joined: 20 Nov 2002
Posts: 70
Location: KA, Germany

PostPosted: Wed Oct 06, 2010 1:09 pm    Post subject: Reply with quote

So, llvm/clang 2.8 is there ... looking forward to see any results using it with gentoo core components ...
Back to top
View user's profile Send private message
benneque
Tux's lil' helper
Tux's lil' helper


Joined: 01 Dec 2007
Posts: 134

PostPosted: Wed Oct 06, 2010 6:43 pm    Post subject: Reply with quote

who want's to compile world using clang ? ;)
Back to top
View user's profile Send private message
scottishduck
n00b
n00b


Joined: 07 Oct 2010
Posts: 4
Location: Scotland

PostPosted: Fri Oct 08, 2010 7:42 am    Post subject: Reply with quote

benneque wrote:
who want's to compile world using clang ? ;)


My VM just finished emerging world (with GCC) last night, just installing llvm and clang now :)


I should also point this out to folks: http://llvm.org/bugs/show_bug.cgi?id=3429#c11

This means that clang svn will be able to build a working kernel some time in the next week or so.
_________________
Freedom is the right of the individual to choose the software he installs, not the right of GNU to force you into GPL.

Member of the Board of Governors at PPUK.
Back to top
View user's profile Send private message
scottishduck
n00b
n00b


Joined: 07 Oct 2010
Posts: 4
Location: Scotland

PostPosted: Fri Oct 08, 2010 9:22 am    Post subject: Reply with quote

Is zlib known not to build with clang? It has once again broken my system :/
_________________
Freedom is the right of the individual to choose the software he installs, not the right of GNU to force you into GPL.

Member of the Board of Governors at PPUK.
Back to top
View user's profile Send private message
Dr.Willy
Guru
Guru


Joined: 15 Jul 2007
Posts: 547
Location: NRW, Germany

PostPosted: Fri Oct 08, 2010 11:40 am    Post subject: Reply with quote

actually I dont get clang to compile anything on my system. It doesn't find some header files, even with system-cxx-headers.
Back to top
View user's profile Send private message
ComaWhite
Tux's lil' helper
Tux's lil' helper


Joined: 07 Oct 2008
Posts: 125

PostPosted: Sat Oct 09, 2010 7:02 pm    Post subject: Reply with quote

I can't wait til clang gets more mature. It will definitely help much better in development of C++ unlike GCC.
Back to top
View user's profile Send private message
scottishduck
n00b
n00b


Joined: 07 Oct 2010
Posts: 4
Location: Scotland

PostPosted: Mon Oct 11, 2010 4:05 pm    Post subject: Reply with quote

I've now found that a large amount of things build if you replace CPP=clang++ with CXXCPP=clang++.
_________________
Freedom is the right of the individual to choose the software he installs, not the right of GNU to force you into GPL.

Member of the Board of Governors at PPUK.
Back to top
View user's profile Send private message
Dr.Willy
Guru
Guru


Joined: 15 Jul 2007
Posts: 547
Location: NRW, Germany

PostPosted: Sun Apr 10, 2011 12:13 pm    Post subject: Reply with quote

Update for everybody: clang-2.9 hit ~
Back to top
View user's profile Send private message
theBlackDragon
l33t
l33t


Joined: 23 Nov 2002
Posts: 768
Location: Belgium

PostPosted: Thu Jun 09, 2011 9:12 am    Post subject: Reply with quote

tylerwylie wrote:
Considering that they're actually free unlike GPL'd software I say "fuck yea!"


Which is why BSD failed (to gather market share, vendor support etc) where Linux succeeded.
_________________
Fvwm|Fvwm forum
Back to top
View user's profile Send private message
golagoda
Tux's lil' helper
Tux's lil' helper


Joined: 18 Jun 2011
Posts: 105
Location: Australia

PostPosted: Wed Dec 07, 2011 2:39 pm    Post subject: Reply with quote

Clang 3.0 was released recently if anyone is still interested.
Back to top
View user's profile Send private message
jdhore
Retired Dev
Retired Dev


Joined: 13 Apr 2007
Posts: 106

PostPosted: Wed Dec 07, 2011 9:10 pm    Post subject: Reply with quote

I would personally like it (especially if it was possible now, perhaps it is and I don't know) if you could compile some stuff with LLVM/clang, but most with GCC. Like for XUL-based stuff, clang seems to improve things, but for everything else, it probably doesn't make a significant enough difference that i'd still compile the rest of my system with GCC.
Back to top
View user's profile Send private message
Neo2
Apprentice
Apprentice


Joined: 25 Sep 2006
Posts: 224
Location: Italy

PostPosted: Fri Dec 16, 2011 12:11 pm    Post subject: Reply with quote

For those who are interested, I have setup a VM with a basic Gentoo stage3 install, and each time a clang version gets released I try to recompile system with that. My intent is to try to support full @system compile (yes, glibc and gcc may still not work), after that slowly test all other packages.
My main showstopper has always been zlib. Will keep you posted if that works now or not =)
BTW, clang-3.0 on AMD K10 processor has a problem, in order to make it work there you should make a custom ebuild with this patch or emerge clang-9999. I'm testing this now..
_________________
Neo2
Unofficial minimal liveCD for x86/amd64 w/reiser4+truecrypt
Back to top
View user's profile Send private message
Neo2
Apprentice
Apprentice


Joined: 25 Sep 2006
Posts: 224
Location: Italy

PostPosted: Sat Dec 17, 2011 1:05 pm    Post subject: Reply with quote

System compilation seems to go way smoother than the 2.9 release. I have some problems only with 6/7 packages out of 209 or so (tied to some gnu extensions I guess).
Now I'm interested in some benchmarking. I'll do a clean VM setup, and then snapshot and recompile trying to extract the differences in compile time and output file size. I'm hoping that some bash magic will do the trick =) Will keep you posted, and as soon as the first round finished I'll post you the package failures.
_________________
Neo2
Unofficial minimal liveCD for x86/amd64 w/reiser4+truecrypt
Back to top
View user's profile Send private message
Dr.Willy
Guru
Guru


Joined: 15 Jul 2007
Posts: 547
Location: NRW, Germany

PostPosted: Sat Dec 17, 2011 1:20 pm    Post subject: Reply with quote

Neo2 wrote:
Will keep you posted, and as soon as the first round finished I'll post you the package failures.

:thumbsup:
Back to top
View user's profile Send private message
Neo2
Apprentice
Apprentice


Joined: 25 Sep 2006
Posts: 224
Location: Italy

PostPosted: Sun Dec 18, 2011 11:15 pm    Post subject: Reply with quote

So, here is a list of the failing system packages:
    dev-libs/klibc-1.5.25
    dev-libs/openssl-1.0.0e-r1
    sys-apps/busybox-1.19.3-r1
    sys-apps/tcp-wrappers-7.6-r8
    sys-apps/which-2.20
    sys-devel/binutils-2.22-r1
    sys-fs/e2fsprogs-1.32
    sys-fs/reiserfsprogs-3.6.21-r1
    sys-libs/glibc-2.14.1-r1
    sys-libs/gpm-1.20.6
    sys-libs/ncurses-5.9-r1
    sys-process/latencytop-0.5

Honestly, I would have expected also GCC to miscompile.
Most of the failures are missing symbols in the linking phase, but two of them IIRC are bugs in the code for which clang bails out with error, rather than silently compiling away.
Yes, latencytop is not part of the system profile, I used it to see what the VM was doing when it seemed stuck. Other additions include utility packages such as genlop, mlocate, hdparm, p7zip and so on. I will post a detailed list if anyone is interested. USE flags are also stripped to the bare minimum.
I don't have time now to do the full parsing of emerge.log to compare compile time, du -sh on binpkgs reports:
196M binpkgs_clang/
197M binpkgs_gcc/
but of course, that's a minimal variation due to the fact that everything is bzip2'ed.
I used -j20 to compile the packages. That was done only to avoid the scheduling overhead and other similar issues from interfering with the comparison.
There is some gain in compile time, judging from the results of the bigger packages:
Code:
Package - GCC time - Clang time - %clang vs gcc - %time gain (speedup)
sys-devel/gcc-4.6.2 - 25m33s - 24m29s - 95,8% - 4,2%
dev-lang/python-3.2.2 - 2m54s - 2m43s - 93,7% - 6,3%
dev-lang/python-2.7.2-r3 - 2m43s - 2m26s - 89,6% - 10,4%
dev-lang/perl-5.12.4-r1 - 6m18s - 5m59s - 95% - 5%

"%clang vs gcc" indicates the amount of time spent compiling by clang against gcc, in percent, eg:
GCC =2m, clang =1m -> %clang vs gcc = 50%
GCC =2m, clang =3m -> %clang vs gcc = 150%
The fourth number is simply (100%-%clang vs gcc). It is there to just highlight the difference rather than the absolute value.
Note that GCC recompiles itself three times, so the time reduction is achieved only in stage1 for GCC. I bet it would count a lot more if it were to compile only once.
All the results have been achieved within a VM, caching is of paramount relevance, the access time to the files is very little when compared to a "real" environment. The VM has 4Gb of dedicated and preallocated RAM (gets reserved when the VM starts instead of being allocated dinamically) and 4 phenom processors, hand-compiled stripped kernel with BFS scheduler, version 3.1.5.
It is important to notice, however, that being in a VM means interposing another layer of indirection for access to memory, disk, network, task execution, etc.. I guess that outside a VM we can expect timings to drop on both of sides, but keeping more or less the relative differences between the two.
I will use a script and genlop to elaborate a more detailed comparison in the next few days.
I'm honestly eager to try and compile www-client/chromium now :D
Will leave that for some time ahead though, I'd rather fix system for the time being.

Cheers,
Neo2
_________________
Neo2
Unofficial minimal liveCD for x86/amd64 w/reiser4+truecrypt
Back to top
View user's profile Send private message
devilheart
l33t
l33t


Joined: 17 Mar 2005
Posts: 848
Location: Villach, Austria

PostPosted: Tue Dec 20, 2011 1:14 pm    Post subject: Reply with quote

Is there a bug opened for listing packages that failed?

apr-1.4.5 fails with this message

Code:
ake[1]: Entering directory `/var/tmp/portage/dev-libs/apr-1.4.5/work/apr-1.4.5'
/bin/bash /usr/bin/libtool --silent --mode=compile /usr/bin/clang -pthread  -O2 -march=k8 -mtune=k8 -fomit-frame-pointer -DHAVE_CONFIG_H -D_REENTRANT -D_GNU_SOURCE   -I./include -I/var/tmp/portage/dev-libs/apr-1.4.5/work/apr-1.4.5/include/arch/unix -I./include/arch/unix -I/var/tmp/portage/dev-libs/apr-1.4.5/work/apr-1.4.5/include/arch/unix -I/var/tmp/portage/dev-libs/apr-1.4.5/work/apr-1.4.5/include  -o passwd/apr_getpass.lo -c passwd/apr_getpass.c && touch passwd/apr_getpass.lo
libtool: compile: unable to infer tagged configuration
libtool: compile: specify a tag with `--tag'
make[1]: *** [passwd/apr_getpass.lo] Error 1
make[1]: Leaving directory `/var/tmp/portage/dev-libs/apr-1.4.5/work/apr-1.4.5'
make: *** [all-recursive] Error 1
[/code]
Back to top
View user's profile Send private message
Neo2
Apprentice
Apprentice


Joined: 25 Sep 2006
Posts: 224
Location: Italy

PostPosted: Tue Dec 20, 2011 9:29 pm    Post subject: Reply with quote

Quote:
Is there a bug opened for listing packages that failed?

Not that I'm aware of, I haven't looked yet though.
I'm sorry but I have little time during the week.
Your problem seems to be with libtool, I don't know much about libtool/clang interaction, it may be a libtool inadequacy, looking only at the error. What are your CC, CPP, CXX, CXXCPP variables? Which version of clang are you running?
_________________
Neo2
Unofficial minimal liveCD for x86/amd64 w/reiser4+truecrypt
Back to top
View user's profile Send private message
devilheart
l33t
l33t


Joined: 17 Mar 2005
Posts: 848
Location: Villach, Austria

PostPosted: Thu Dec 22, 2011 1:25 pm    Post subject: Reply with quote

CC="/usr/bin/clang"
CXX="/usr/bin/clang++"

clang and llvm are both v3.0
Back to top
View user's profile Send private message
Neo2
Apprentice
Apprentice


Joined: 25 Sep 2006
Posts: 224
Location: Italy

PostPosted: Thu Dec 22, 2011 3:24 pm    Post subject: Reply with quote

I tested this also with clang/llvm-9999 on my main system, I get the very same error output.
I don't know libtool well enough to make suppositions, I think you'd better report this as a bug :)
_________________
Neo2
Unofficial minimal liveCD for x86/amd64 w/reiser4+truecrypt
Back to top
View user's profile Send private message
Neo2
Apprentice
Apprentice


Joined: 25 Sep 2006
Posts: 224
Location: Italy

PostPosted: Tue Jan 10, 2012 12:26 pm    Post subject: Reply with quote

For those who have an AMD K10 CPU, I filed a bug and attached a patch (taken from upstream) for that family of processors. The patch allows clang to recognize the "amdfam10" -march flag. The issue was fixed shortly after the 3.0 release, that explains why clang-9999 works without patching.
I'll have little time to work on and test clang until the end of February (university exams coming).
After that I should be able to be much more active in terms of filing and fixing problems with clang.

Cheers,
Neo2
_________________
Neo2
Unofficial minimal liveCD for x86/amd64 w/reiser4+truecrypt
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo Chat All times are GMT
Goto page Previous  1, 2, 3, 4, 5, 6, 7, 8, 9  Next
Page 8 of 9

 
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