Slashdot Mirror


LLVM and Clang 3.4 Are Out

An anonymous reader writes that the LLVM compiler framework and Clang C++ compiler hit 3.4 "With C++14 draft fully implemented in Clang and libc++. Read more in LLVM and Clang release notes." Also of note: "This is expected to be the last release of LLVM which compiles using a C++98 toolchain. We expect to start using some C++11 features in LLVM and other sub-projects starting after this release. That said, we are committed to supporting a reasonable set of modern C++ toolchains as the host compiler on all of the platforms. This will at least include Visual Studio 2012 on Windows, and Clang 3.1 or GCC 4.7.x on Mac and Linux. The final set of compilers (and the C++11 features they support) is not set in stone, but we wanted users of LLVM to have a heads up that the next release will involve a substantial change in the host toolchain requirements."

36 of 118 comments (clear)

  1. pretty quick on the C++14 support by Trepidity · · Score: 3, Interesting

    Does that make it the first compiler with full draft C++14 support? GCC is making progress but not there yet.

    1. Re:pretty quick on the C++14 support by Trepidity · · Score: 3, Insightful

      From a technical perspective I like LLVM, but I don't get the appeal of your 2nd point. Why should I work for free on a project in order to enable companies to make proprietary extensions to it that they won't release back to the community? The GPL makes me more willing to contribute to projects, because it ensures that everyone plays fair, so to speak: I'm adding my contributions, and if you find the results valuable and extend my work, you should do likewise.

    2. Re:pretty quick on the C++14 support by serviscope_minor · · Score: 5, Interesting

      Yet another good readon for everyone to drop GCC and move on to the future. GCC is obsolete in pretty much every aspect,

      Pure FUD. Who the hell modded this up. It's just plain trolling. GCC and LLVM are neck and neck, with GCC winning in the quality of the optimizer. I've also had compiler crashes much more recently with LLVM than with GCC, so it seems that GCC is also somewhat more battle hardened.


      and the non-permissive license makes it hard to use for other purposes than simple command-line compilation compared to LLVM which can be integrated in many different products.

      Only if you want to make your other tool non-free. Otherwise GCC works just fine.

      --
      SJW n. One who posts facts.
    3. Re:pretty quick on the C++14 support by Anonymous Coward · · Score: 4, Insightful

      The BSD folks tend to argue that things work out in the end anyway. Useful contributions find their way back, and when they don't then at least someone got some good code out of it. There are few exceptions, in general you can't force anyone to contribute back. Very few projects are that good. The only thing you achieve is that your code is used in less places.

    4. Re:pretty quick on the C++14 support by jandrese · · Score: 4, Interesting

      He's referring to integrating the compiler into your IDE. GCC makes this intentionally difficult, which is a big reason why there is no Visual Studio equivalent system that uses GCC. CLANG/LLVM is designed much more openly and should allow developers to really reach (and exceed) feature parity with Visual Studio.

      --

      I read the internet for the articles.
    5. Re:pretty quick on the C++14 support by Anonymous Coward · · Score: 3, Informative

      Only if you want to make your other tool non-free. Otherwise GCC works just fine.

      You don't have to go as far as non-free. Projects that are non-GPLv3+ can't easily integrate with it. Even free software projects would benefit if GCC was at least LGPL since that allows code linking.

    6. Re:pretty quick on the C++14 support by Anonymous Coward · · Score: 2, Insightful

      Why should I work for free on a project in order to enable companies to make proprietary extensions to it that they won't release back to the community?

      You shouldn't, but you should also not see it as a deterrent. Those companies will never release anything back to the community regardless of license.
      Yes, while unlikely they might be able to make some more profit thanks to whatever you contribute but that is irrelevant since it doesn't actually harm you or the project.
      On the other hand the way they think is that their source code is the most important thing they have and they will never make it public. Those companies will rather try to roll their own compiler than contribute to an open source project. By using a more permissive license you do not get more contributors in the form of programmers but I highly doubt that you get less either. What you do get is more contributors in the form of debugging and bug reporting.

    7. Re:pretty quick on the C++14 support by Anonymous Coward · · Score: 2

      XCode?

    8. Re:pretty quick on the C++14 support by angel'o'sphere · · Score: 2

      Most people who program the whole day rather have a beer at home ...

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
    9. Re:pretty quick on the C++14 support by postmortem · · Score: 2

      Huh? QCreator, Netbeans and Eclipse C/C++ IDEs are fully integrated with GCC, including both debugging and compilation.

    10. Re:pretty quick on the C++14 support by jandrese · · Score: 4, Informative

      What they can't do is micro-compile snippets of code to find errors, do auto-completion, etc...

      I'll let the clang guys explain it better.

      --

      I read the internet for the articles.
    11. Re:pretty quick on the C++14 support by kthreadd · · Score: 2

      I'm sure it was Apple that stopped Apple from contributing to GCC. I'm thankful that they contributed to LLVM by developing Clang, but it was entirely their own choice to not contribute to GCC after 4.2.1.

    12. Re:pretty quick on the C++14 support by gnasher719 · · Score: 3, Informative

      I'm sure it was Apple that stopped Apple from contributing to GCC. I'm thankful that they contributed to LLVM by developing Clang, but it was entirely their own choice to not contribute to GCC after 4.2.1.

      It was an intentional change in the license that made it impossible for Apple to do some of the things they wanted to do.

    13. Re:pretty quick on the C++14 support by Above · · Score: 5, Insightful

      There actually is a good reason.

      Let's say a company invents a proprietary bit of silicon, and wants a compiler for it. They may likely chose one that requires them not to spill the beans on their proprietary hardware in the process. So yes, it's true, you don't get the benefit of their "special sauce", but you were never going to get it anyway, so there is no loss.

      However, that same company now has a lot of people using the code. It takes time and money to track separate changes, so if they find a bug in code not specific to their proprietary stuff they are likely to fix it, and submit it upstream so they don't have to maintain it going forward. That code will benefit you.

      So basically, the people who find the GPL odious will never use gcc, and will find some alternative. Given those people have fully closed options (license Intel's compiler, or Microsoft's), or use something like LLVM. With the LLVM model they can submit fixes to their non-secret sauce upstream, as well as get others to help fix problems they find in the non-secret sauce part.

      TL;DL, if you choose gcc or LLVM you're never getting their secret sauce, but if you choose LLVM you get more help on the non-secret sauce parts.

      That is the real essence of the "BSD License" philosophy. You may or may not agree.

    14. Re:pretty quick on the C++14 support by am+2k · · Score: 5, Informative

      Huh? QCreator, Netbeans and Eclipse C/C++ IDEs are fully integrated with GCC, including both debugging and compilation.

      What Xcode can do is integrate llvm with autocompletion. For example, if you do a switch statement on an enum-value, it autocompletes the possible enum constants after you type "case". After the first entry, it automatically removes the constants you already used from the list of possibilities.

      Xcode also does perfect autocompletion (method names, parameter types, etc.) of types derived from C++ templates, which simply isn't possible without compiling the file. This even works as you change the same file those templates are declared in.

      Other things include the analyzer, which tells you about issues that arise on certain input conditions. When you click on an issue, Xcode visually displays the flow through the program to arrive at the undesired end result using arrows.

    15. Re:pretty quick on the C++14 support by WilyCoder · · Score: 2

      please, PLEASE say secret sauce one more time

    16. Re:pretty quick on the C++14 support by kthreadd · · Score: 2

      No, that is not the same thing. The runtime library exception is for the parts of gcc that gcc includes in your program when it builds it. The actual binary that the compiler produces. This is limited to certain headers and library routines. It does not give you access to the inner workings of the compiler.

    17. Re:pretty quick on the C++14 support by HeckRuler · · Score: 4, Insightful

      Ah yes, all those people running BSD... All those people.
      Which, hey, if you include Apples OSX, is a hell of a lot of people. So yes, let us bask in all that effort that Apple has done for the open source community.

      Very few [open/free] projects are that good.

      Well with that sort of QUANTITY, you can't expect them all to be stellar.

      The only thing you achieve is that your code is used in less places.

      But those are places that you can actually use rather than the proprietary walled garden constrictive license which make for the sort of thing where you don't actually own the things you own. It also makes for a platform which is dead in the water and has no legs. And it's usually expensive.

      I don't care if a few businessmen shy away from the code I throw out there under an free license. They most certainly wouldn't have helped me.

    18. Re:pretty quick on the C++14 support by jo_ham · · Score: 3, Insightful

      A free software license does not limit what you can do with the code. For all intents and purposes Apple could have released their code under GPLv3+ and they would have been fine. I totally understand why they choose not to do that, but it was Apples choice to do it; they could have done different if they really, really, really wanted to.

      And then shipped it together as a bundle with Xcode? The GPLv3 specifically prevents them doing that, and it was deliberately written that way. The GPLv3 absolutely limits what you can do with that code. It is a very restrictively and carefully written licence in certain very key areas (not that this is necessarily a bad thing if you want such a thing - and there are valid reasons for it existing).

      So, no Apple couldn't have done that "if they really wanted to", without making the whole of Xcode open source.

      That's not really "choice" and "freedom" is it? That's what this comes down to - the GPL protects the freedom of the *code* whereas the BSD licence protects the freedom of the *users and/or developers* of that code.

    19. Re: pretty quick on the C++14 support by Bill_the_Engineer · · Score: 3, Insightful

      The problem with your argument being that Apple sponsors the clang and llvm project. I'm sure they put in more money than you, and we still enjoy the use of the BSD code.

      --
      These comments are my own and do not necessarily reflect the views or opinions of my employer or colleagues...
    20. Re:pretty quick on the C++14 support by peppepz · · Score: 3, Informative

      Please update your FUD. GCC has supported a plugin architecture since 2010. You can use any GPL-compatible license for your plugin. This includes BSD, and in fact, there's a LLVM plugin for gcc.

    21. Re:pretty quick on the C++14 support by phantomfive · · Score: 3, Interesting

      And then shipped it together as a bundle with Xcode? The GPLv3 specifically prevents them doing that, and it was deliberately written that way.

      Wait, how does GPLv3 prevent them from shipping it in a bundle with Xcode? I'm pretty sure that's allowed under GPL3, but Apple didn't like the patent clauses.

      --
      "First they came for the slanderers and i said nothing."
    22. Re:pretty quick on the C++14 support by gnasher719 · · Score: 2

      No, if I release content into the public domain, a downstream user can still add proprietary extensions to it, and then sue reusers who use that fork without a icense. I'd like to license my software under a license that allows downstream users to do anything they want, except sue another downstream user.

      So what if the next downstream user doesn't conform to the license by suing someone, what are you going to do? Sue them?

      This is seriously a difficult problem. When you give your software to soeone else, you can either give them a license, or enter a contract. If there is a contract then you can actually force them to do something (like force them not to sue somebody else), but you may have to go to court to force them. If there is a license, then you can't force them to do anything. You can take them to court for copyright infringement if they don't conform to the license; that's how GPL works.

    23. Re:pretty quick on the C++14 support by vakuona · · Score: 2

      As I understand it, it is not possible to integrate GCC into Xcode in the same way as LLVM is without having to license Xcode as GPLv3 or some other compatible license. For example, Xcode uses (if I am not mistaken) the LLVM/CLang API. I don't think GCC has one, and if it had one, I don't think Apple could use it without having to change their Xcode license.

    24. Re:pretty quick on the C++14 support by Anonymous Coward · · Score: 2, Interesting

      As an Xcode user I would definitely appreciate it if they released Xcode under GPL. Can't tell you the number of times I sworn about bugs in Xcode, taken the time to file the bug report just to get it closed immediately because it was a duplicate of some existing bug that I'm not allowed to see and then wait months or even years for a fix. Yes this is so important for me that I would happily jump in and fix the bugs myself. I have absolutely no interest in Xcode remaining closed source. None.

    25. Re:pretty quick on the C++14 support by postmortem · · Score: 3, Informative
    26. Re:pretty quick on the C++14 support by Guy+Harris · · Score: 2

      LLVM / Clang's acceptance of patent encumbered code from Apple, Qualcomm, and others makes LLVM technically unlawful to use for anyone who doesn't have a cross license agreement with these corporations.

      The LLVM Developer Policy page section on patents says:

      If you or your employer own the rights to a patent and would like to contribute code to LLVM that relies on it, we require that the copyright owner sign an agreement that allows any other user of LLVM to freely use your patent. Please contact the oversight group for more details.

      Are you saying that Apple, Qualcomm, and others have not signed such an agreement? Or are you saying that such an agreement isn't sufficient to allow anyone who doesn't have a cross-license agreement with the patent holders to use LLVM?

    27. Re: pretty quick on the C++14 support by AvitarX · · Score: 2

      Can users of gpl software be sued? I thought only distributers ( I guess with web apps thats murkey though)

      --
      Wow, sent an e-mail as suggested when clicking on "use classic" banner, and got a fast response that addressed my msg
    28. Re:pretty quick on the C++14 support by Goaway · · Score: 2

      For all intents and purposes Apple could have released their code under GPLv3+ and they would have been fine.

      Not really. They, like many other companies, were not comfortable with the language about patents in GPL3, and did not want to take on the extra legal risk it involves.

    29. Re:pretty quick on the C++14 support by jo_ham · · Score: 2

      And then shipped it together as a bundle with Xcode? The GPLv3 specifically prevents them doing that, and it was deliberately written that way.

      Wait, how does GPLv3 prevent them from shipping it in a bundle with Xcode? I'm pretty sure that's allowed under GPL3, but Apple didn't like the patent clauses.

      The anti-Tivo clause, written exactly because of the perceived "weakness" of GPLv2 (insofar as it allowed more freedom to the sorts of developers that the writers of the GPL dislike) that enabled closed-sourced pieces of code and hardware that are part of a product to be kept back, while the (now essentially less useful without the closed bit) code could be released following the letter of the licence.

      Xcode is not open source, but parts of it are. Given the way that the compiler is heavily integrated into it, using a GPLv3 licenced one would simply be infeasible, given that the whole of the source is not available.

    30. Re:pretty quick on the C++14 support by peppepz · · Score: 2
      It's not a matter of the existence of the BSD license. The key is the license of the most competitive project. Keep looking at Android as an example: Google dislike the GPL, so if some BSD kernel was on par with Linux for embedded devices, they would certainly have chosen that kernel instead. And we wouldn't even get device vendors to release the kernels.

      Look at the Darwin kernel as another real-world example. Its source as released by Apple doesn't even boot nowadays, so the open source community around the Darwin kernel is very small if any.

  2. Re:How to always skip Slashdot Beta by Anonymous Coward · · Score: 2, Informative

    thanks alot, the beta is awful

  3. The One True Way by zakkudo · · Score: 2

    I honestly don't think that GCC was made for you, Anonymous Coward. But that is also why it's nice that there are various options in the open source community...

    I personally love command line compilation with gcc. Command line being a first class citizen means it's command line interface won't atrophy into a toy.

  4. Code Completion? Static Analysis? by glennrrr · · Score: 4, Informative

    What's the code-completion situation in GCC these days, or the static analyzer situation? (I don't know.) Apple went with Clang at least in part because of not being able to get those features out of GCC without making Xcode GPL3 compliant, but I'd guess that an IDE with a compatible license might have a better shot at getting that information out of GCC. Code completion and static analysis are 2 of the great features of Xcode; I wouldn't want to go back to tools that didn't have either.

    1. Re:Code Completion? Static Analysis? by Anonymous Coward · · Score: 2, Informative

      I don't have any evidence that GCC was deliberately architected to prevent any functionality from being implemented - do you? I don't believe projects like this are ever designed to impose such kinds of restrictions - it's not Microsoft, it's GNU.

      A great deal of thought goes into the GCC license and GCC APIs that are exposed to third parties. Have a look at this and this. It is true that GCC has been designed and licensed to prevent integration with proprietary tools; Stallman et al. will not tolerate having GCC wired into some proprietary, closed source IDE and that fact guides their decisions about what APIs GCC provides and how GCC is licensed.

      The `proprietary' part was left out by the GP and others that make the claim that GCC is designed to prevent third party integration.

  5. Not really obsolete by aaaaaaargh! · · Score: 2

    For example, I'm sometimes programming in Ada, which clang doesn't really compile (at least when I looked last time). Moreover, gcc with -O2 or -O3 produces faster executables on my machine.