Beta
×

Welcome to the Slashdot Beta site -- learn more here. Use the link in the footer or click here to return to the Classic version of Slashdot.

Thank you!

Before you choose to head back to the Classic look of the site, we'd appreciate it if you share your thoughts on the Beta; your feedback is what drives our ongoing development.

Beta is different and we value you taking the time to try it out. Please take a look at the changes we've made in Beta and  learn more about it. Thanks for reading, and for making the site better!

FreeBSD Throws the Clang/LLVM Switch: Future Releases Use LLVM

Unknown Lamer posted about 2 years ago | from the rms-weeps-quietly dept.

Unix 360

An anonymous reader writes "Brooks Davis has announced that the FreeBSD Project has now officially switched to Clang/LLVM as C/C++ compiler. This follows several years of preparation, feeding back improvements to the Clang and LLVM source code bases, and nightly builds of FreeBSD using LLVM over two years. Future snapshots and all major FreeBSD releases will ship compiled with LLVM by default!"

cancel ×

360 comments

Sorry! There are no comments related to the filter you selected.

WOW (-1)

Anonymous Coward | about 2 years ago | (#41908035)

who cares

Re:WOW (1)

Anonymous Coward | about 2 years ago | (#41908091)

Most likely the BSD maintainers and developers out there.... bout thats less then 0.00001% of 7+billion people. I'm going to guess anywhere between 1-1000 =)

Re:WOW (1)

ByOhTek (1181381) | about 2 years ago | (#41908387)

and the FreeBSD users, we bring it to a bit larger number than that. Probably still only 10s of thousands...

Re:WOW (0)

Anonymous Coward | about 2 years ago | (#41908667)

People interested in Clang/LLVM might be interested in this even if they don't use BSD too. This would give more exposure and sources of contributions.

Re:WOW (3, Informative)

gnasher719 (869701) | about 2 years ago | (#41908997)

Most likely the BSD maintainers and developers out there.... bout thats less then 0.00001% of 7+billion people. I'm going to guess anywhere between 1-1000 =)

Now add in all the Mac and iOS developers and the number increases just slightly. MacOS X 10.8 is completely built using Clang + LLVM. OpenGL uses LLVM. OpenCL uses LLVM.

speedily compiled post (0, Insightful)

Anonymous Coward | about 2 years ago | (#41908051)

as you can see...

Grin (3, Funny)

Whiteox (919863) | about 2 years ago | (#41908065)

I'm just so HAPPY!

Re:Grin (1)

fm6 (162816) | about 2 years ago | (#41908121)

For us non-BSD muggles, please explain why.

Re:Grin (0)

Anonymous Coward | about 2 years ago | (#41908233)

Because he meditates a lot.

Re:Grin (1, Informative)

Anonymous Coward | about 2 years ago | (#41908315)

For us non-BSD muggles, please explain why.

Basic alphabet fetish. After all, "BSD", the abbreviation for "Berkeley Software Distribution", is more letters than the abbreviation for "Linux", which would just be "L". Thus, it only follows that "LLVM" appeals to him more than the simple "GCC", which is only three letters, and thus old and stupid.

Re:Grin (5, Informative)

Anonymous Coward | about 2 years ago | (#41908335)

This explains it well: http://unix.stackexchange.com/a/49970/7345

Re:Grin (5, Informative)

ByOhTek (1181381) | about 2 years ago | (#41908421)

Generally a lot of BSD users don't like the GPL, and getting rid of a GPLed compiler makes them quite happy.

Also, although I've heard a lot about the inner workings of GCC being rather intertwined and convoluted, whereas LLVM is simpler to work with and modify (not sure how true this is).

Re:Grin (5, Interesting)

Creepy (93888) | about 2 years ago | (#41908777)

It isn't necessarily an issue with the GPL (aside from 3 being invasive, which I personally have an issue with and so do the lawyers I work with) - I have a problem with Stallman's (aka RMS) model, which says charge for hardware and give the software with source away for free.

I worked for a CAD software company (we were bought by a huge multinational conglomerate, so I technically still work for them, but I moved around and rarely touch CAD these days). In our former incarnation, we sold exactly no hardware and were bundled with exactly zero hardware, but ran on pretty much every platform imaginable (9 at one point, but much fewer now, since our customers are mostly moving to Linux or Windows). Giving away our software (not to mention the source code) would be a really bad business model, but to appease those in RMS's dream world, we'd need to find hardware partners and give it away for free with the hardware and be paid by the hardware vendor - but since we have to give away source, we'd more than likely use an in-house developed proprietary language to make porting as difficult as possible. This, in fact, is a BAD and not very open business model - if we'd been bought by our current owner, we'd almost certainly be proprietary software for their hardware and not run on platforms like Linux or even Windows. This happens in the console world all the time - when Microsoft bought Bungie, they basically shafted what Bungie was known for - mac games (and took a year to release Halo on Windows/Mac to keep it XBox exclusive as long as possible to the ire of Steve Jobs - later releases became XBox exclusive). If you think that is a good thing, great for you - I don't. Incidentally, the part of the company I work for has an open data model as well - that makes it easy for customers to switch, but we are doing our jobs well because few actually do.

I've been at odds with RMS over this for years...

Re:Grin (4, Insightful)

Anonymous Coward | about 2 years ago | (#41908957)

With BSD software, not only are you giving away the source code, but you are giving it away with even fewer restrictions than with GPL.

What's that you say? You want to take the software that other people have released and use it in your closed source product? Well then of course you like BSD software better. But you can obviously see why many people who write the open software prefer a GPL style.

Re:Grin (3, Insightful)

Zenin (266666) | about 2 years ago | (#41909201)

With BSD software, not only are you giving away the source code, but you are giving it away with even fewer restrictions than with GPL.

But you're not forced to give all of it away, as you effectively are with the GPL.

If you've created something that you'd like to give back to the community, you can. -And it's very often in your own best interests to do so. If however, you've created something that, at least for now, you'd prefer not to give away, well you're free to do that instead.

The BSD model has proven that you don't need to twist peoples arms to get them to give back generously to the community. It's proven that people can have the freedom to choose whatever business model they feel is best for them, and the community still benefits greatly. Often more so then a GPL model.

GPL... Among many freedoms it takes away, it destroys the freedom to select a business model of your choice. And worse, the few business models that the GPL does allow for are intrinsically very, very bad on the whole. You're either forcing odd hardware/software partnerships like the poster above, or you're relying upon creating sloppy software and weak documentation in order to ensure a market for your "support services". The later, IMHO, is a primary cause behind the quality issues that have forever plagued GPL software quality, design, and documentation.

Re:Grin (1)

fnj (64210) | about 2 years ago | (#41908843)

It has little to do with "liking" or "disliking" the GPL. It has more to do with the GPL being incompatible with BSD's own license (and just about any other license). It's true there is a compile firewall with gcc, but it is still a less than ideal situation. BSD is also going to bring out a GPL-free C++11 stack.

Re:Grin (5, Informative)

DeathFromSomewhere (940915) | about 2 years ago | (#41909127)

is there a reason for not making the front ends dynamic libraries which could be linked by any program that wants to parse source code?

Quoth the Stallman himself:

One of our main goals for GCC is to prevent any parts of it from being used together with non-free software. Thus, we have deliberately avoided many things that might possibly have the effect of facilitating such usage, even if that consequence wasn't a certainty. We're looking for new methods now to try to prevent this, and the outcome of this search would be very important in our decision of what to do.

Not only is the poor design true, it was very intentional. This is why we need the LLVM project. KDevelop and such shouldn't have to write their own compiler front ends to get feature parity with Visual Studio; but right now they do.

Re:Grin (1)

Nadir (805) | about 2 years ago | (#41908605)

Because he's free from Free

What's the clear advantage of LLVM? (1)

Anonymous Coward | about 2 years ago | (#41908075)

I know of LLVM, but haven't used it, and it really seems like very few hardcore Linux/OSS devs have a clue about it. Is there really a clear advantage, or is it just an excuse to write a new compiler to solve a problem that doesn't exist?

For now, I'm quite happy with GCC, but could be convinced otherwise with a compelling argument.

Not GPL, and suitable for JIT (4, Informative)

tepples (727027) | about 2 years ago | (#41908109)

For one thing, LLVM isn't copylefted, making it available for use as part of non-free software. (There are some major categories of software that for economic reasons cannot be released as free software; I can explain in more detail if you wish.) For another, it's designed to allow just-in-time compilation of bytecode, such as what might be seen in a Flash, Java, .NET, or JavaScript VM, in addition to standard ahead-of-time compilation of source code into native code.

Re:Not GPL, and suitable for JIT (2)

X0563511 (793323) | about 2 years ago | (#41908163)

So, written a bit more flexibly, and licensed a bit more flexibly :)

Nothing wrong with having a "competitor" (it isn't, but anyway you get what I am saying) from either perspective. Gives both a reason to strive to improve.

Re:Not GPL, and suitable for JIT (-1)

Anonymous Coward | about 2 years ago | (#41908207)

Yes please explain the economic reasons why "some major categories of software ... cannot be released as free software", and more importantly, why anyone who makes Free Software should care about them. Why do the FreeBSD people care about people who don't want to make Free Software?

Re:Not GPL, and suitable for JIT (1)

Anonymous Coward | about 2 years ago | (#41908389)

Yes please explain the economic reasons why "some major categories of software ... cannot be released as free software"

Anyone that sells C/C++ code analysis software as a business?

Re:Not GPL, and suitable for JIT (-1)

Anonymous Coward | about 2 years ago | (#41908413)

Well just think about it for a minute, the best software in *EVERY* category is actually closed source sometimes with some BSD code used where it saves time. OS X, iOS, Photoshop, Autocad, the list goes on and on. Ultimately closed source software is a superior form of software development and the communistic GPL simply stands in the way of it incorporating the best ideas to improve the *closed* model of development even further. The only reason the GPL exists is because some people think that software developers should not have the right to profit from their own work, and this is morally wrong.

Re:Not GPL, and suitable for JIT (0)

Anonymous Coward | about 2 years ago | (#41908429)

"Why do the FreeBSD people care about people who don't want to make Free Software?"

That made me laugh. If you know anything at all about BSD, you'd know that the BSD community cares deeply for people who want to make non-free software. That's kind of the entire point.

Re:Not GPL, and suitable for JIT (1)

Anonymous Coward | about 2 years ago | (#41908675)

Firstly, FreeBSD cares about it's permissive license, as such, no GPLv3 software in the base system.

FreeBSD gets a lot of its support and user base from the fact that is can be used to drive the creation of commercial products. The goal of the FreeBSD project is to make good, free software,not to force anyone else to also make free software.

Re:Not GPL, and suitable for JIT (3, Insightful)

pmontra (738736) | about 2 years ago | (#41908867)

These are not exactly the terms of GPL and BSD but:

GPL is for people and companies that think "I wrote this software [together with X, Y and Z] and if somebody else makes it better they must share it with all the world, as I did."

BSD is for people and companies that think "I wrote this software [together with X, Y and Z] and I accept the loss that somebody else makes it better and keep it for themselves because I want to have the option of getting somebody's else software, make it better and keep it for me without sharing it back."

I think we can argue forever on the ethic merits of the two approaches (I feel in the GPL camp). Anyway both GPL and BSD make economic sense and we won't be talking about them if they didn't, one or both would be dead long time ago. If a company wants to include some big secret in its code, it must go BSD and occasionally regrets it can't use some GPL code and rant about it. Sometimes the GPL people rant about not being able to include BSD code in their projects.

Re:Not GPL, and suitable for JIT (3, Insightful)

TheMMaster (527904) | about 2 years ago | (#41909011)

Actually it is much simpler than that;

GPL is designed to protect users' interests
BSD is designed to protect developers' interests

Re:Not GPL, and suitable for JIT (-1)

Anonymous Coward | about 2 years ago | (#41909087)

Sort of.

GPL is for people and companies that think that "I wrote this software [together win X, Y and Z], and you can make use of it -- but only if you do the exact same thing, and allow me to incorporate any changes you make for everyone else to use as well AND you can't make money off of it and quite often you can't use it commercially"

BSD is for people and companies that think "I wrote this software [together with X, Y and Z] and anyone can reuse it for the betterment of man-kind as a whole in any project by anyone for any reason AND you can use it in commercial closed source projects".

As a programmer who actually likes to see his code being reused by other programmers, I find it hard to get behind the GPL. I work for companies that make money, and I try to give as much as I take, contributing time and enhancements to projects that allow other programmers to do their jobs better and faster. As such, I'll never work on GPL licensed stuff, but I'll happily help BSD licensed projects.

Re:Not GPL, and suitable for JIT (1)

Millennium (2451) | about 2 years ago | (#41908217)

Could you elaborate on the "economic reasons" certain categories cannot be released as free software?

Also, LLVM isn't actually designed for JIT: some people have managed to make it work, but not without problems. GCC isn't designed for JIT either, of course; it's outside the problem space of both.

Re:Not GPL, and suitable for JIT (1)

lindi (634828) | about 2 years ago | (#41908403)

At least for me "lli" works much more reliably than "lli -force-interpreter" (that disables the JIT).

Genres of non-free software (2)

tepples (727027) | about 2 years ago | (#41908475)

Could you elaborate on the "economic reasons" certain categories cannot be released as free software?

Certainly. I've started on this essay [pineight.com] .

Re:Genres of non-free software (1)

emj (15659) | about 2 years ago | (#41908895)

None of these, games, DRM crippled video players, tax software need to be proprietary. You even mention why: what would these software packages be without their WAD files, tax definition files and encryption keys.

Free software could leak cleartext or keys (3, Insightful)

tepples (727027) | about 2 years ago | (#41909027)

You even mention why: what would these software packages be without their WAD files, tax definition files and encryption keys.

A video game licensed as free software could be modified to leak the decrypted WAD files. Furthermore, console makers forbid use of a copylefted engine [slashdot.org] . This means a copylefted game can't run on consoles, which means it can't use the large monitor and multiple gamepads that the player already owns for the console but wouldn't consider buying for a PC. (There are some major genres of video games that for economic reasons cannot be released as PC exclusives; I can explain in more detail if you wish.)

A DRM crippled video player licensed as free software could be modified to leak the decryption keys, something that Disney, Fox, Paramount, Sony, Universal, and Warner Bros. forbid.

A tax program licensed as free software could be modified to leak the decrypted tax definition files.

"economic reasons" (4, Interesting)

tlambert (566799) | about 2 years ago | (#41908751)

A lot of graphics software infringes on existing patents, but that isn't a reason you can state without risking treble damages in a lawsuit, so most of the graphics driver writers tend to just look the other way and hum as they dance past that particular graveyard. Practically, it's impossible to write genuinely competitive graphics code without infringing some East Texas idiot's patent.

There are also cases where code has specific strategic value to a company, and they want to amortize the cost of development over some period of time before they let their competitors use the code. For example, the Soft Updates code that Kirk McKusick, Julian Elisher, and I worked on for FreeBSD was licensed under a free-for-non-commercial-use license for a period of two years before we opened it up for general use. This was to allow us to recoup the investment on developing the code by allowing us to run our hardware without a UPS, while everyone else in the market had to have a UPS to deal with power failure and recovery. If you don't have it, you have to treat a power failure as a kernel panic and do a full fsck in order to return your disk to a known good state, since you can't otherwise guarantee that it wasn't a crash followed by a triple fault, which might have written bad data to some portion of the disk. So all the competing border router/SOHO server devices had to have batteries, which increased their cost relative to our product. It's one of the reasons IBM bought our company.

Yeah, it'd be great if some idiot were to spend 10 years of their free time neglecting their families so that all this stuff could be free, but no one really wants to be that idiot: people work on free software for love, and they work on the hard problems and productization in exchange for money, since no one is going to do scut work for free unless they're a masochist (if you happen to know one, though, I have a project or two they could tackle if they really wanted to suffer).

Re:"economic reasons" (0)

Microlith (54737) | about 2 years ago | (#41909105)

Yeah, it'd be great if some idiot were to spend 10 years of their free time neglecting their families so that all this stuff could be free, but no one really wants to be that idiot

And as usual, a BSD proponent includes some sort of ignorant insult. Your commentary was good until this bit.

Re:Not GPL, and suitable for JIT (1)

gnasher719 (869701) | about 2 years ago | (#41909037)

Also, LLVM isn't actually designed for JIT: some people have managed to make it work, but not without problems. GCC isn't designed for JIT either, of course; it's outside the problem space of both.

WTF? Apple's first use of LLVM was as a JIT for OpenGL. When compiling OpenGL to code for various graphics cards became a maintenance nightmare, they used LLVM: OpenGL compiles to the internal representation of LLVM, same code for all graphics cards, and LLVM compiles to code for the graphics card, all at runtime.

Re:Not GPL, and suitable for JIT (-1)

Anonymous Coward | about 2 years ago | (#41908355)

Proving once more that BSD zealots are just as politically fundamentalist as GPL zealots. I'm glad you folks have at least moved on to admitting it.

Re:Not GPL, and suitable for JIT (-1)

Anonymous Coward | about 2 years ago | (#41908715)

Although I can't say for certain as you haven't specified what your "economic reasons" are, I expect something like the LGPL would address nearly all issues just as well.

Having its roots in a university project, I understanding why LLVM got the license it did. Historically speaking though, we have seen that GCC has befitted from having a license which forces companies to contribute back.

For example, we wouldn't have an Objective C compiler if NeXT hadn't been forced to release it in order to comply with the GPL.

http://wiki.gnustep.org/index.php/ObjC2_FAQ

Re:Not GPL, and suitable for JIT (4, Informative)

TheRaven64 (641858) | about 2 years ago | (#41908873)

For example, we wouldn't have an Objective C compiler if NeXT hadn't been forced to release it in order to comply with the GPL.

Speaking as the person who wrote and maintains the GNUstep libobjc and the clang support for it: Bullshit. The GPL forced NeXT to open source half of the implementation (the compiler support, not the runtime), and their implementation was such a pile of crap that it set back GCC's support for a long time. Open source support for Objective-C in clang is so much better than in GCC that it's not even worth comparing the two.

Re:Not GPL, and suitable for JIT (1)

jedidiah (1196) | about 2 years ago | (#41908785)

> There are some major categories of software that for economic reasons cannot be released as free software

Yet despite of this the world has survived for a rather long time using a Copyleft compiler without the heads of any Robber Barons exploding.

It's kind of on par with GNU finally using it's own kernel after 20 or so years instead of using the Linux kernel. It's interesting but far less significant than some might want to assert. We managed to get along quite well without it.

Re:What's the clear advantage of LLVM? (5, Informative)

Poeli (573204) | about 2 years ago | (#41908143)

The reason FreeBSD switches to clang/LLVM is the license: BSD instead of GPLv3.

You should give clang a try. The LLVM has a much cleaner api then gcc and the error message's are also more readeable. In terms of speed, the difference is shrinking with each release.

Re:What's the clear advantage of LLVM? (1, Interesting)

Anonymous Coward | about 2 years ago | (#41908253)

That would be bad for us. Clang is in the order of 10 times faster than GCC (compilation speed) and the generated binary is 1% faster than GCC (so essentially the same but saves hours of compile-time per day on 50MB+ C-files).

Re:What's the clear advantage of LLVM? (0)

Anonymous Coward | about 2 years ago | (#41908357)

> Clang is in the order of 10 times faster than GCC (compilation speed)

Not on C++. It's faster, but clearly not by an order of magniture.

Re:What's the clear advantage of LLVM? (0)

UnknownSoldier (67820) | about 2 years ago | (#41908415)

If your compiles are taking more then a few minutes you are doing it wrong.

You DO know about Bulk / Unity builds right?
http://buffered.io/posts/the-magic-of-unity-builds [buffered.io]

Of course there is no magic silver bullet but if you haven't given them a go, try it.

Another option is to switch from hard drives to SSDs since that handles the bottleneck at its source: time spent seeking to a track.

YMMV

Oblg.
http://xkcd.com/303/ [xkcd.com]

Re:What's the clear advantage of LLVM? (1)

Anonymous Coward | about 2 years ago | (#41908419)

That 1% is case specific. On the benchmarks it is about 10% slower in some specific cases. So bench it first. It is getting better but not across the board...

Also there are non significant amounts of software currently that llvm can not compile. The linux kernel being one of them. This is being fixed, but 'not quite there yet'.

Re:What's the clear advantage of LLVM? (2, Informative)

KiloByte (825081) | about 2 years ago | (#41909051)

Clang is in the order of 10 times faster than GCC (compilation speed) and the generated binary is 1% faster than GCC (so essentially the same but saves hours of compile-time per day on 50MB+ C-files).

Bullshit. It's compilation is at most 1/3 faster, and on most cases I checked, the result executes between 5-25% slower. The former seems to be pretty constant everywhere, the latter strongly depends on the code base in question, with huge outliers both ways.

Re:What's the clear advantage of LLVM? (4, Informative)

alexgieg (948359) | about 2 years ago | (#41908179)

I know of LLVM, but haven't used it, and it really seems like very few hardcore Linux/OSS devs have a clue about it. Is there really a clear advantage, or is it just an excuse to write a new compiler to solve a problem that doesn't exist?

The actual reason, from what I remember, is licensing. They want to build a fully BSD-licensed OS from the ground up, with zero dependence on GPL-licensed stuff.

Re:What's the clear advantage of LLVM? (2)

evilviper (135110) | about 2 years ago | (#41909221)

They want to build a fully BSD-licensed OS from the ground up, with zero dependence on GPL-licensed stuff.

Not really true. Everyone was pretty comfortable living along-side GPLv2-licensed software for many, many years. But NOT the new GPLv3. Organizations all over the place are running away, screaming, from anything using that extra-restrictive and incompatible license. The FSF, developing the GPLv3 license, has done more to promote BSD/MITX licensed software than anyone else could have ever hoped to.

Some companies just keep their older, GPLv2 licensed software as long as they can, but in compilers in particular, age and lack of development is a liability, so they eventually have to go out and look for more liberally licensed projects that will make a reasonable replacement. Hence LLVM has seen a flood of development effort.

Secondly, with the change from gcc-2.x to gcc-3.x and now 4.x, compile times have climbed significantly, in favor of optimization. Even if you turn off all the options you can, you're talking about a substantially longer build time. Not an issue for your final compile for public consumption, but during development, where folks want to quickly compile an test, it's a real nuisance, which numerous develops have been complaining about.

Apple, FreeBSD and many others went for LLVM. OpenBSD went for PCC instead.

Re:What's the clear advantage of LLVM? (5, Interesting)

sribe (304414) | about 2 years ago | (#41908181)

I know of LLVM, but haven't used it, and it really seems like very few hardcore Linux/OSS devs have a clue about it. Is there really a clear advantage, or is it just an excuse to write a new compiler to solve a problem that doesn't exist?

Much better modularization, so that the tokenizer used by the compiler is easily available to other tools, so that your editor does not have to (try to) re-implement all the intricacies of C++ syntax, so that parse tree & symbolic info is available to your IDE, so that it does not have to try to re-implement parsing of all the intricacies of C++ templates & namespaces in order to give you cross-referencing or even re-factoring functions (not to mention support for a debugger that can actually figure out types in a complex inheritance hierarchy).

Re:What's the clear advantage of LLVM? (1)

StripedCow (776465) | about 2 years ago | (#41908515)

But the tokenizer and parser for an IDE have to work incrementally (parsing as you type), making them wholly different beasts.

Re:What's the clear advantage of LLVM? (0)

Anonymous Coward | about 2 years ago | (#41908805)

So, build the incremental one and use that in your compiler. What's the big deal?

dom

Re:What's the clear advantage of LLVM? (1)

Brian Feldman (350) | about 2 years ago | (#41908855)

I don't believe that you can make a claim like that if you do not have experience in the incremental parser code of an IDE.

Re:What's the clear advantage of LLVM? (1)

gnasher719 (869701) | about 2 years ago | (#41909065)

But the tokenizer and parser for an IDE have to work incrementally (parsing as you type), making them wholly different beasts.

No need to work incrementally, as long as you just work _fast_. That's what you have fast processors for, to recompile after every keystroke.

Re:What's the clear advantage of LLVM? (2)

Gerald (9696) | about 2 years ago | (#41908457)

It has a pretty good static analyzer.

Re:What's the clear advantage of LLVM? (1)

staalmannen (1705340) | about 2 years ago | (#41908789)

You should definitely try compiling something with LLVM/Clang sometime. The error messages that you get are quite nice and stuff normally compiles much faster compared to similar optimization level with GCC. For a source-based distribution like FreeBSD or Gentoo that might be a nice boon. Some developers (the Chromium ones if I am not mistaken) have switched to LLVM/Clang for their development, but they still ship the final binaries built with GCC.

Re:What's the clear advantage of LLVM? (0)

Anonymous Coward | about 2 years ago | (#41908917)

Well, there is the licensing argument, but I won't touch that.

LLVM is superior because it has an ultra-modern optimizer. It simply produces better code. This is its advantage - and also its disadvantage. To achieve these aims, it is painfully strict about "undefined behaviour" in ANSI C. A lot of things that you probably think are fine, are actually "undefined" in ANSI C, and LLVM will do whatever the hell it pleases in those areas. So, taking LLVM can be a bit of a PITA.

Re:What's the clear advantage of LLVM? (5, Informative)

fnj (64210) | about 2 years ago | (#41909175)

I don't see anybody addressing this question adequately. Here goes for a start.

1) g++ has simply awful error messages for template code. clang++ has MUCH more helpful error messages. Of not quite so much importance, all clang/clang++ error messages are significantly better than those of gcc/g++. Looks like clang++ has spurred g++ to improve error messages in 4.8 though. They NEEDED to be improved.

2) clang++ 3.1 has significantly better C++11 support than g++ 4.7:
      Rvalue refs for *this
      Alignment support
      Strong compare-exchange
      Bidirectional fences
      Atomics in signal handlers
      Also borrows from C99 one very significant enhancement: C99 designated initializers

References:
clang: Expressive Diagnostics [llvm.org]
C++0x/C++11 Support in GCC [gnu.org]
C++98 and C++11 Support in Clang [llvm.org]

Why switch at all? (0)

Anonymous Coward | about 2 years ago | (#41908081)

Never really understood the motivation for switching away from GCC. Please enlighten me.

Re:Why switch at all? (1, Informative)

Anonymous Coward | about 2 years ago | (#41908101)

Never really understood the motivation for switching away from GCC. Please enlighten me.

being bsd people, they don't like the gpl.

Re:Why switch at all? (0)

Anonymous Coward | about 2 years ago | (#41908267)

Nothing has stunted the computer/software industries more than the introduction of the 8086 and the GPL.

Re:Why switch at all? (1)

tuppe666 (904118) | about 2 years ago | (#41908627)

Nothing has stunted the computer/software industries more than the introduction of the 8086 and the GPL.

Having lived with the the safe Duopoly of Microsoft/Apple [Years of IE6 was only part of the problem] dominate everything absolutely for so long. Other than providing a viable competitor, where commercial companies have failed to compete, and are swallowed up by these larger companies as the bundle all the profitable software I fail to see their relevance. The only effective competitor seems to have been GPL for obvious reason [its almost immune...although buying off key people and handing out free hardware doesn't hurt ;)], some may argue BSD...which is a nobler licence, but its kind of ironic in this thread, having seen how Apple's adoption of BSD as a one way suck has affected the BSD distributions. In reality New Apple has admittedly been worse taking advantage of the Patent system [the new threat to computing], and its closed garden, dirty back-room deals with content suppliers...And Ballmer is creating A New Microsoft in its image whatever you thing of that. I won't mention Google...which is leading computing which has a whole lot of issues associated with it [or Facebook, Amazon etc etc]

Lets face it GPL only is...was!? a threat to the safe Duopoly; the thing that has stunted the industry as they always do, but the reality is it wasn't enough of one.

Re:Why switch at all? (1)

lister king of smeg (2481612) | about 2 years ago | (#41908799)

Odd how the most used *nix is GPLed -Linux
odd how veteran companies from the unix war (oracle, ibm, hp,) are pushing the use of LInux and other GPLed software.

maybe they figured out that sharing is best but if that were it they could have simply shared and setteled on a BSD. Or they realize that working where there competitor can't simply fork and close at will is best for everyone involved thus settling on a GPL licensed stack

Re:Why switch at all? (1)

KingMotley (944240) | about 2 years ago | (#41909235)

Odd how the most used *nix is GPLed -Linux

You'd need a reference for that. I would submit that BSD code is more prevalent than GPL in actual use by an order of magnitude or better.

Every copy of windows has BSD code in it (No, not the tcp/ip stack). But libraries to do things like zipping files, displaying GIFs, etc etc. Mac OS and iOS is based on BSD as well. Even linux has BSD code in it. So does the PS3, Xbox 360, and FreeNAS.

Re:Why switch at all? (0)

Anonymous Coward | about 2 years ago | (#41909101)

Says the person who has never written a line of real code in their life, and does not know how microprocessors work.

Re:Why switch at all? (1)

Anonymous Coward | about 2 years ago | (#41908193)

Clang have a really nice error/warning output, so it's easier to debug your code (try to install clang on your distribution and compile some programs, its really pretty and useful).

But the motivation to switch on FreeBSD is mainly another one: LLVM is licensed on BSD license, while GCC uses GPLv3. Since FreeBSD uses BSD too, the use of LLVM make it easier to bundle compiler binaries with the distribution.

Re:Why switch at all? (5, Informative)

Cinder6 (894572) | about 2 years ago | (#41908527)

Could check this article: http://clang.llvm.org/comparison.html [llvm.org]

Apple made the switch a while back in Xcode. The end result was much better debugging and refactoring capabilities.

Re:Why switch at all? (0)

Anonymous Coward | about 2 years ago | (#41909067)

0. Using a BSD-licensed compiler for FreeBSD is a no brainer is it not?
1. It compiles shit way faster.
2. It has much better error messages.
3. Its source code does not look like the inside of a particle collider after a beam aiming accident, unlike the gcc source code.
4. It is designed in a modular way as a collection of APIs instead of a monolithic black box.

Is time for a big FreeBsd celebration (0, Funny)

Anonymous Coward | about 2 years ago | (#41908137)

The 10 users rejoice.

Don't knock it until you've tried it (3, Interesting)

Viol8 (599362) | about 2 years ago | (#41908411)

FreeBSD might not be anywhere near as popular as linux but its a damn good system, and whats more there arn't endless ever-so-slightly incompatable distributions of it. Ok, its never going to threaten Linux but its good to have a proper alternative free Unix system available that is actually interested in its end users and isn't just a pet project of the devs (unlike certain other BSDs I could mention).

Re:Don't knock it until you've tried it (0)

Anonymous Coward | about 2 years ago | (#41909173)

OK I won't knock it if you stop spreading FUD about Linux.

Any one of at least the top 5 Linux distros alone would be more popular than FreeBSD (Android, RHEL, SLES, Debian, Ubuntu).

So if you're going to develop for a particular platform, and wanted to reach the most users in one port, you would certainly pick Linux over FreeBSD.

Your FUD about distros is about as useful as me making up some shit about endless significantly-more-incompatible free BSD forks.

Re:Is time for a big FreeBsd celebration (1)

Provocateur (133110) | about 2 years ago | (#41908455)

Actually, 9 of them did. One of them had to be the designated driver. He had a car, you know.

Re:Is time for a big FreeBsd celebration (1)

fostware (551290) | about 2 years ago | (#41908557)

Thanks for the clarification.

For a moment there I thought the AC was counting in binary

excellent! (0)

Anonymous Coward | about 2 years ago | (#41908145)

OpenBSD should be next!

Re:excellent! (1)

staalmannen (1705340) | about 2 years ago | (#41908835)

If I remember correctly, OpenBSD was looking at PCC as alternative compiler. It would in a way fit their philosophy better considering that it is simpler/cleaner and pure C, so C++ does not have to become a systems dependency. In fact, PCC has also made some rather nice advances lately, like building a FreeBSD kernel, and there is always the challenge of building a Linux kernel with pcc (http://bsdfund.org/bundle/).

I should know this, but... (0)

mcgrew (92797) | about 2 years ago | (#41908215)

Why did they change and what difference does it make to the programmer or user?

RTFA? Are you kidding me?

Re:I should know this, but... (0)

Anonymous Coward | about 2 years ago | (#41908359)

http://clang.llvm.org/comparison.html

If you'd excuse my french... (-1)

Anonymous Coward | about 2 years ago | (#41908239)

Fuck you GCC! I now can ay it freely and fuck GPL for that matter!

Re:If you'd excuse my french... (-1)

Anonymous Coward | about 2 years ago | (#41908399)

"Fuck" isn't French though. "Scandaleux" is, not that it means what you want to say.

Also, you may want to fuck the GPL, but I actaully did fuck your dad in the arse.

Re:If you'd excuse my french... (-1)

Anonymous Coward | about 2 years ago | (#41908445)

but I actaully did fuck your dad in the arse

Did you enjoy my sloppy seconds?

Re:If you'd excuse my french... (0)

tuppe666 (904118) | about 2 years ago | (#41908653)

Fuck you GCC! I now can ay it freely and fuck GPL for that matter!

Steve Jobs it that you ?

Re:If you'd excuse my french... (0)

Anonymous Coward | about 2 years ago | (#41909147)

No. He's dead, Jim. I mean, tuppe666.

Re:If you'd excuse my french... (1)

Creepy (93888) | about 2 years ago | (#41909031)

The FSF has always granted an exception for compiling non-GPL3 software, but they don't like it. Others (like me) have feared they may pull such licensing sometime in the future, so having an alternative is a good thing - we shouldn't put too much power in the control of one relatively radical group.

Having a strong competitor to GCC (4, Insightful)

stox (131684) | about 2 years ago | (#41908529)

will drive GCC to a far greater degree than without a competitor. This is good for all involved.

Re:Having a strong competitor to GCC (1)

arendjr (673589) | about 2 years ago | (#41908649)

If both were proprietary software, I'd agree, but given they're open-source, I don't think so.

GCC is an open-source project. How are they going to hire extra developers to keep the edge over LLVM? And to what end? Once LLVM takes over the crown I believe it makes more sense for a lot of GCC developers to just continue their work on LLVM instead, and GCC will shrink to irrelevance. But it's still good for all involved, as everybody gets a better compiler :)

(And yes, I know, this might not happen for a long time, and GCC supports many more languages than LLVM, but I do think over time LLVM will become more dominant...)

Re:Having a strong competitor to GCC (1)

tuppe666 (904118) | about 2 years ago | (#41908767)

No its just good for your agenda, although the heavy involvement of Apple without the support of a tit-for-tat license is going to major offputting for many developers. The irony of FreeBSD switching to Clang/LLVM is not lost on me. Personally the thought of a two-level development of a browser quite disturbing.

The reality is GCC still moves forward, and Clang/LLVM has a long way to catch up, perhaps if develops stopped developing Clang/LLVM for that everyone would again getter a btter browser, and everyone would be on an equal playing field. ;)

but like I say I prefer a world where some do not get a better browser than others :(

Re:Having a strong competitor to GCC (1)

arendjr (673589) | about 2 years ago | (#41909009)

My agenda has no stake in this debate other than me wanting to have a good open-source C++ compiler available.

Why your mumbling about browsers is beyond me, but maybe I'm the one missing something...

Re:Having a strong competitor to GCC (1)

Microlith (54737) | about 2 years ago | (#41908823)

How are they going to hire extra developers to keep the edge over LLVM?

How have they gotten this far? It's not like GCC is struggling to keep pace in development.

Once LLVM takes over the crown I believe it makes more sense for a lot of GCC developers to just continue their work on LLVM instead, and GCC will shrink to irrelevance.

Why would a GCC developer move to LLVM? Do you believe that all of the developers on the project are so opportunistic that they would simply jump to a different compiler? I suspect more than a few are also GPL supporters.

But it's still good for all involved, as everybody gets a better compiler :)

Well, better for some people. I suspect that the first fallout of any industry shift to LLVM will be that the public compiler will be significantly lacking in optimizations while the expensive, proprietary versions will have all the good optimizations.

Re:Having a strong competitor to GCC (1)

Anonymous Coward | about 2 years ago | (#41909071)

I suspect that the first fallout of any industry shift to LLVM will be that the public compiler will be significantly lacking in optimizations while the expensive, proprietary versions will have all the good optimizations.

So GPL supporters are spreading FUD now? Bravo, guys, bravo!

Firstly, by "any industry shift to LLVM", do you mean something like, say, XCode using LLVM+CLang as the default compiler for all projects?

And secondly, what "expensive, proprietary version"? This does not exist - you have invented it, for the purpose of anti-BSD rhetoric. This is a paranoid possibility in your Stallman-dizzied head, not an actual fork. Apple, for instance, roll all the LLVM+CLang fixes back into mainline. Even though they don't have to. Look, people can act morally without religion!

It's not like GCC is struggling to keep pace in development.

And thirdly, the reason Apple moved to LLVM is because it has a better optimizer than GCC. It produces better code. Those of us who struggled with gcc 3.x for years waiting for them to put in some even vaguely modern compiler construction techniques are having a good old laugh at the idea that GCC doesn't struggle to keep pace. And we are never - never - going back to GCC, when we can avoid doing so.

Re:Having a strong competitor to GCC (4, Insightful)

Microlith (54737) | about 2 years ago | (#41909143)

XCode using LLVM+CLang as the default compiler for all projects?

That's hardly an industry shift and you know it.

And secondly, what "expensive, proprietary version"? This does not exist - you have invented it, for the purpose of anti-BSD rhetoric.

So we're going to ignore all of the proprietary, seat-licensed compilers out there?

This is a paranoid possibility in your Stallman-dizzied head, not an actual fork.

Quick! Into the name-calling and ad-hominem!

Apple, for instance, roll all the LLVM+CLang fixes back into mainline.

Do they? Unless you're on their compiler team you can't possibly know this.

I believe the phrase "you mad" applies very, very well to your spittle-flecked rant here.

Re:Having a strong competitor to GCC (4, Insightful)

serviscope_minor (664417) | about 2 years ago | (#41909083)

Well, better for some people. I suspect that the first fallout of any industry shift to LLVM will be that the public compiler will be significantly lacking in optimizations while the expensive, proprietary versions will have all the good optimizations.

Not just that.

I remember the bad old days where every venduh and his dog had their own "extra proprietary super awseome dongle controlled extra awesome super cool" compiler.

Vendors of hardware *LOVE* proprietary compilers. And by love, I mean love to break in mysterious and subtle ways.

Once gcc took off in the embedded world, life got a lot better since many of the cheaper vendors would just use as close to stock gcc as possible (though usually with a little bit of extra internal compiler errors added), rather than some extra super proprietary extra messed up version.

This isn't a business issue. There is no sane business case for taking a commercial compiler front end and a commercial compiler back end, filling it with extra bugs and shipping it. But hardware vendors love to believe that they have an awesome proprietary advantage in software for some reason. Even though they sell hardware. They don't, of course. I'd just say "whatever" except that turns rapidly into invective if one is forced to use their "tools".

Once GCC came along, they believed that they no longer had such an advantage (presumably) so they stopped introducing their extra proprietary bugs into compilers, and limited themselves to a few extra miscellaneous bugs. But it was still mostly gcc and still mostly worked.

If LLVM comes to dominate, the hardware vendors will jump right back on that attitude and make the life of the humble developer hell again.

This isn't a religious, or philosophical issue. It's a "hardware vendors are mental" issue.

Re:Having a strong competitor to GCC (1)

arendjr (673589) | about 2 years ago | (#41909093)

Well, it seems to me the major forces driving the development of a compiler are the chip manufacturers and the developers of operating system. Both have an intrinsic desire to have a good compiler available to them. But what vested interest do they have that this compiler be GCC? If at some point in the future LLVM were to be become the one generating the most efficient code, and if the LLVM codebase is the more maintainable one, then why not switch?

And both chip manufacturers and OS developers seem to have a common goal of making their optimizations available to as many developers as possible. It does not seem to be in their interest to make their optimized versions prioprietary. After all, the compiler is not their money maker, it's simply a prerequisite of getting developers to support their OS or CPU in the first place!

You're right any GPL purists will likely stick to GCC, but personally I doubt they make up the majority of the GCC community.

Re:Having a strong competitor to GCC (0)

Anonymous Coward | about 2 years ago | (#41909013)

Change their license?

Re:Having a strong competitor to GCC (2)

lister king of smeg (2481612) | about 2 years ago | (#41908821)

or GCC will simply grab the better code and GPL it leaving it with another lesser competator

LLVM stands for.... (2)

RedHat Rocky (94208) | about 2 years ago | (#41908623)

Low Level Virtual Machine. However, has little to do with what it is now: http://en.wikipedia.org/wiki/LLVM [wikipedia.org]

Rename needed, certainly, it is.

Carry on.

Great news (0)

Anonymous Coward | about 2 years ago | (#41908727)

I'm a big fan of the Clang compiler. Mostly because of its warning and error messages. Often I find GCC spits out really cryptic messages and, in a few cases, it has given me incorrect warnings. I've also found GCC really inconsistent. ie Code which compiles and runs fine with GCC 4.6 won't build properly with GCC 4.7. Clang offers more consistency, the error messages and compiler warnings are beautifully written and I've found its performance (and the performance of its builds) about on par with GCC's. The liberal license is a nice bonus, but mainly Clang is just a much nicer compiler with which to work.

And thousands of Orthodox Stallmanites (0)

Anonymous Coward | about 2 years ago | (#41908765)

screamed out in terror. I feel something terrible has happened.
Or maybe RMS just took a bath.

Good job, guys! (2)

Brian Feldman (350) | about 2 years ago | (#41908773)

I have been happily using clang++ at work for a while now and am thankful for the efforts in creating a real world-class open-source compiler suite! Glad to see FreeBSD become ever-freer!

Freeeeeddddddddooooooommmmmm!!!! (0)

Anonymous Coward | about 2 years ago | (#41908999)

Down with restrictive licenses! :)

Types of freedom (0)

Meneth (872868) | about 2 years ago | (#41909075)

The GPL protects the user's rights and the Free software engineer's rights.

The BSD license protects the closed-source programmer's rights.

So why would anyone prefer BSD? Because they're on the payroll of closed-source companies.

Load More Comments
Slashdot Login

Need an Account?

Forgot your password?