LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
Search this Thread
Old 02-24-2012, 07:11 AM   #1
mlpa
Member
 
Registered: May 2008
Location: Aveiro
Distribution: Slackware
Posts: 481

Rep: Reputation: 34
GCC vs LLVM


I saw this news in Phoronix.

I have tried to understand which is better.
I have always used GCC, is there a significant reason to change?
 
Old 02-24-2012, 10:25 AM   #2
bosth
Member
 
Registered: Apr 2011
Posts: 219

Rep: Reputation: 62
Not a Slackware question. There are programming forums.
 
Old 02-24-2012, 02:44 PM   #3
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2014, Slack14.1 DebWheezy, +50+ other Linux OS, for test only.
Posts: 13,519

Rep: Reputation: 2495Reputation: 2495Reputation: 2495Reputation: 2495Reputation: 2495Reputation: 2495Reputation: 2495Reputation: 2495Reputation: 2495Reputation: 2495Reputation: 2495
http://llvm.org/

1) There's a llvm/clang Slackbuild ( Version 2.9 )
http://slackbuilds.org/result/?search=llvm&sv=13.37
LLVM 3.0 : http://llvm.org/releases/download.html#svn
Clang http://clang.llvm.org/

2) Gcc will compile "everything".
LLVM can compile some (the most?) applications / libraries.
Why not try out llvm / clang, to know ?
( export CC=clang CXX=clang++ && <other-command> ).
 
1 members found this post helpful.
Old 02-24-2012, 02:45 PM   #4
Alien Bob
Slackware Contributor
 
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 5,180

Rep: Reputation: Disabled
This is not a programming question per sť.

You could also see it as a philosophical question - everybody grew up with GCC - what will a move to LLVM bring to Linux distributions? I have no doubt that Redhat considers a move away from GCC.

This is just one step in a trend to abandon the platform-agnostic tools of old and push Linux into a direction which will separate it from it's UNIX cousins. Some would call it "refreshment of Linux" but mainly this is a push to get the Linux desktop into a state where it will be commercially exploitable. The big distro vendors are not concerning themselves with compatibility issues - look at how we, Slackware, must struggle to keep our own distro sane.

Their ulterior motive is simply: to earn more money. And **** the hippies.

Eric
 
3 members found this post helpful.
Old 02-24-2012, 03:02 PM   #5
mlpa
Member
 
Registered: May 2008
Location: Aveiro
Distribution: Slackware
Posts: 481

Original Poster
Rep: Reputation: 34
Quote:
Originally Posted by bosth View Post
Not a Slackware question. There are programming forums.
I am not trying to do a programming questions, or looking to change my compiler.

I am only trying to understand, from the point of view from Linux Distro Maintainers is there any major step in using LLVM?
Based on Phonorix Apple use it and Fedora is considering.

After so many time with GCC, and from several post that I read, many program use specific GCC Macros and options, what is the force to change?
And as a Linux user, is this change for the better or worse?
 
Old 02-24-2012, 03:04 PM   #6
mlpa
Member
 
Registered: May 2008
Location: Aveiro
Distribution: Slackware
Posts: 481

Original Poster
Rep: Reputation: 34
Quote:
Originally Posted by knudfl View Post
http://llvm.org/

1) There's a llvm/clang Slackbuild ( Version 2.9 )
http://slackbuilds.org/result/?search=llvm&sv=13.37
LLVM 3.0 : http://llvm.org/releases/download.html#svn
Clang http://clang.llvm.org/

2) Gcc will compile "everything".
LLVM can compile some (the most?) applications / libraries.
Why not try out llvm / clang, to know ?
( export CC=clang CXX=clang++ && <other-command> ).
Thanks for the info.
Maybe if i have time I can write a simple code in C and compile with GCC and CLANG and see the differences.
Namely compilation time, execution time and try different optimizations
 
Old 02-25-2012, 04:16 AM   #7
a4z
Member
 
Registered: Feb 2009
Posts: 299

Rep: Reputation: 120Reputation: 120
that llvm hypes currently several comanies have several motivations to use it as 'their' compiler is on thing

the advantage of llvm/clang is its modular design, so it can be interfaced and used for example to create static code analysis tools, what becomes more and more important

and competition is good, even for gcc

beside that, it is great to use more than one compiler, especially in so exiting times where the new c++11 stuff comes into the compilers
for C++ this is a big win, compaired to the situation of the last years


for me it is realy exiting to see how various tools and compilers work with each other and how they continue brining new features, and I currently use gcc/clang++ and msvc10 to compile my code.

also, there is no real a vs b situation for me , cause my code has to work with all 3 compilers, or 2 for the linux only parts
 
Old 02-27-2012, 02:27 AM   #8
fgcl2k
Member
 
Registered: Jan 2011
Distribution: Slackware 14.0
Posts: 102

Rep: Reputation: 25
Quote:
Originally Posted by Alien Bob View Post
This is just one step in a trend to abandon the platform-agnostic tools of old and push Linux into a direction which will separate it from it's UNIX cousins.
Why do you think that the move to LLVM is a step to separate Linux from its UNIX cousins? The BSDs, for example, are already contemplating to replace gcc, although for licence reasons.
Quote:
Originally Posted by Alien Bob View Post
Some would call it "refreshment of Linux" but mainly this is a push to get the Linux desktop into a state where it will be commercially exploitable. The big distro vendors are not concerning themselves with compatibility issues - look at how we, Slackware, must struggle to keep our own distro sane.
I completely agree with your analysis about the direction that Linux development is taking.
 
Old 02-29-2012, 11:09 AM   #9
the3dfxdude
Member
 
Registered: May 2007
Posts: 315

Rep: Reputation: 84
Some people may not know this, but gcc has been replaced before. At least by a fork of itself.

http://en.wikipedia.org/wiki/GNU_Com...tion#EGCS_fork

Maybe this is not as drastic as moving to a new compiler code base, but this could shed light why LLVM is getting new attention. Many times, forks or replacements are written, not so much for technical reasons, but control of the code base. (Don't get me wrong, the project leads may make technical decisions different than their competing project, to "improve" things)

So EGCS is an example of developers not happy of the management of GCC, going out on their own, and eventually being the leader. This led back to remerging the code bases under the new leadership (or at least being called the defacto GCC). So GCC is one big happy family again right?

LLVM could prove to be successful that it becomes a standard, but I will wait and see. I do have it installed for my Mesa driver.

Not every competing faction succeeds. Take again Red Hat and GCC, which produced the ill-fated GCC 2.96 (an unofficial fork of GCC 2.95). Unfortunately it was popular among some commercial vendors using Red Hat, and I've finally just got off a vendor produced program myself which required those C++ libs by just finally rewriting a new program for my company in the last 6 months.
 
Old 02-29-2012, 12:23 PM   #10
Martinus2u
Member
 
Registered: Apr 2010
Distribution: Slackware
Posts: 342

Rep: Reputation: 55
Quote:
Originally Posted by Alien Bob View Post
You could also see it as a philosophical question - everybody grew up with GCC - what will a move to LLVM bring to Linux distributions?
I grew up with Pure C (formerly Turbo C) on m68k hardware which compiled 20 times faster than GCC and produced similarly well optimised code (since then optimisation has improved no doubt). I believe the speed difference between CLANG and GCC is similar. That alone makes it worth it.
 
Old 02-29-2012, 12:26 PM   #11
Alien Bob
Slackware Contributor
 
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 5,180

Rep: Reputation: Disabled
Martinus2u ... you also wrote software on Atari? How funny, I did this too.
I must have my Pure C floppies still, somewhere, but I only run Atari emulators these days, having done away with the 1040ST and the TT long ago.

Eric
 
Old 02-29-2012, 02:34 PM   #12
Martinus2u
Member
 
Registered: Apr 2010
Distribution: Slackware
Posts: 342

Rep: Reputation: 55
Quote:
Originally Posted by Alien Bob View Post
Martinus2u ... you also wrote software on Atari? How funny, I did this too.
I must have my Pure C floppies still, somewhere, but I only run Atari emulators these days, having done away with the 1040ST and the TT long ago.

Eric
hehe, yes, i wrote mostly small utilities, that sometimes got me a few bucks from computer magazines. I had one of the first mega ST with a whooping 4 MB. Later I upgraded to 68020 and 68030 cpus which means I had to go heavily into hardware design. I also contributed to linux 68k. There is still one occurrence of my old e-mail adress left in the vanilla kernel to this day.

but all that is history now. I sometimes play with vice, the c 64 emulator.
 
Old 03-06-2012, 08:26 AM   #13
mlpa
Member
 
Registered: May 2008
Location: Aveiro
Distribution: Slackware
Posts: 481

Original Poster
Rep: Reputation: 34
As it seems Debian are also thinking in trying out LLVM compiler, here.
 
Old 03-18-2012, 03:34 PM   #14
haziz
Member
 
Registered: Jan 2012
Location: /dev/null
Distribution: Slackware, Fedora, Debian, Centos, Ubuntu
Posts: 60

Rep: Reputation: 1
LLVM/Clang: It's Great for Students!

I don't know how it would fit for distribution maintainers; it is attractive to companies trying to make money since it's "BSD" stye license (U. of Chicago license I think) is probably easier to use for financial gain than the GPL though many companies have proved you could profit with GPLed software. Probably why Apple is pushing it in favor of GCC.

I am a student currently studying C and Unix systems programming and I must say that for me Clang has been a godsend and that is mainly because it's warning and error messages are infinitely easier to understand than those of GCC. It also will usually accurately highlight and literally "point to" your errors. I just find it much more user friendly. I am using it from the CLI in a GNU/linux box, so this is not due to a particular implementation in an IDE.
 
Old 03-20-2012, 12:05 AM   #15
ReaperX7
Senior Member
 
Registered: Jul 2011
Distribution: LFS-SVN, Slackware-14.1, PCBSD-10.0
Posts: 2,790
Blog Entries: 15

Rep: Reputation: 729Reputation: 729Reputation: 729Reputation: 729Reputation: 729Reputation: 729Reputation: 729
The only thing I've ever used LLVM for was to compile Mesa to support 3D acceleration for various video cards using Gallium3D.

It's just another compiler for another purpose. GCC is and will always be the defacto open source compiler not just for Linux but for many open source projects.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: GCC 4.6, LLVM/Clang 3.0, Open64 Benchmarks LXer Syndicated Linux News 0 11-07-2011 12:50 PM
LXer: Compiler Benchmarks Of GCC, LLVM-GCC, DragonEgg, Clang LXer Syndicated Linux News 0 11-08-2010 05:11 PM
LXer: Benchmarking LLVM & Clang Against GCC 4.5 LXer Syndicated Linux News 0 04-21-2010 02:30 PM
What is LLVM? MTK358 Programming 2 03-22-2010 05:55 AM
LXer: GCC vs. LLVM-GCC Benchmarks LXer Syndicated Linux News 0 09-04-2009 12:10 PM


All times are GMT -5. The time now is 04:06 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration