Want to read Slashdot from your mobile device? Point it at m.slashdot.org and keep reading!

 



Forgot your password?
typodupeerror
×
GNU is Not Unix Open Source Software

LLVM & GCC Compiler Developers To Begin Collaborating 279

An anonymous reader writes "While RMS is opposed to LLVM over its BSD-like license rather than the GPL, LLVM/Clang and GCC developers have agreed to try to start cooperating in an "open compiler initiative" to jointly tackle common issues that plague both compilers and issues that can be better served by working together rather than creating fragmentation between the two popular open-source compilers."
This discussion has been archived. No new comments can be posted.

LLVM & GCC Compiler Developers To Begin Collaborating

Comments Filter:
  • by paxcoder ( 1222556 ) on Saturday February 08, 2014 @06:07PM (#46198863)

    I'm not sure how GCC could benefit from this.
    While theoretically GPL could subsume BSD code produced from the collaboration, I reckon it's more likely that brains are going to migrate rather than code. And I don't see those working on LLVM (for commercial interest) migrating to GCC.
    If I were RMS I'd be worried.

    • by kthreadd ( 1558445 ) on Saturday February 08, 2014 @06:11PM (#46198891)

      Well, just getting both camps into the same room from time to time would be an improvement.

    • by Rosyna ( 80334 ) on Saturday February 08, 2014 @06:13PM (#46198899) Homepage

      I'm pretty sure this is not about sharing code, but about collaborating on needed features via a shared spec. So both compilers implement something a standard way instead of coming up with new features independently.

      • For example?
        Would GCC migrate to LLVM bytecode? What does that give us (except lack of diversity)?
        Not sure what else could these two compilers have in common.

        • by Anonymous Coward on Saturday February 08, 2014 @06:35PM (#46199027)

          For example, the pretty huge list of C and C++ extensions that both gcc and clang implement, and that are invented by the authors of said tools. It's much better that the two talk about it, and come up with one spec that both compilers implement than to have two competing standards that results in code one or other compiler can't deal with.

          • by maxwell demon ( 590494 ) on Saturday February 08, 2014 @07:08PM (#46199191) Journal

            Another thing would be to harmonize the representation of fundamental classes like std::string and std::vector, so those classes can be passed between codes compiled with both compilers, even though the implementation code for those classes might otherwise differ.

            • Well, clang uses the short-string optimization, which cannot be compatible with GCC's libstdc++. (If it were compatible, then GCC would also be using said optimization.) So that's not going to work.
            • The level of micro-optimization that is required of a quality C++ standard library implementation pretty much makes it impossible - you can't use common techniques like pimpl, since that extra allocation/dereference would, in some cases, literally slash perf down in half for something designed to be really fast - ironically, both std::string and std::vector would actually qualify (think about the cost of indexing).

            • by MobyDisk ( 75490 )

              Why do they not use the same std library implementation? LLVM is a compiler, it can compile the same std library code. If the LLVM designers wanted to improve it, it was GPL with the library extension so at first glance it seems like they could have used it.

          • by dbc ( 135354 )

            Yes, exactly. Practical compilers are always compelled to do extensions beyond the language spec, simply because people need to get work done. So if gcc and clang can agree on inter-operability of extensions, that is a huge help. It also is going to be influential in language spec committees when it comes time to drive some of those functions into the spec. Another area for fruitful collaboration that helps people get work done is to drive torward mix-and-match linking. Neither of the above require sha

        • by thoth ( 7907 ) on Saturday February 08, 2014 @06:40PM (#46199045) Journal

          There's a boatload of stuff to agree on for better interop. The language itself (c/c++) says nothing about a lot of stuff people kind of expect these days.

            Language extensions specific to compilers (e.g. __user), toolchains (e.g. llvm is working on lld, a linker, to replace the default system linker), security additions (e.g. if I build a library with gcc and specify stack protection and canaries, none of which are in the language standard, will I be able to link a clang built library and executable and actually have it work), etc.

          • llvm is working on lld, a linker, to replace the default system linker

            Didn't GNU already adopt a modern linker (gold) quite recently?

            • by EvanED ( 569694 )

              Gold isn't default yet, but they are working on it. I very recently built it for an experiment, and presumably used the latest stable version of binutils at the time, and in that I'm pretty sure it didn't even build Gold by default and it definitely didn't install Gold as ld by default.

        • Sanitizers? Just sayin'
    • by thoth ( 7907 ) on Saturday February 08, 2014 @06:29PM (#46198999) Journal

      I was a compiler grad student, and my university had its own intermediate representation it did work with. Back then (mid 90's) there was also SUIF (stanford university intermediate form), something I forget from University of Illinois... there were probably others too. But some big-name CS departments focused on other stuff, databases, operating systems, AI, and weren't necessarily up there in compilers or revealing the details of their intermediate form (not that it's was a secret, merely from academia the algorithm is more important than the intermediate form used).

      Now, my old school adopted LLVM. I recently checked as I'm working with LLVM/Clang and found that quite interesting. I can't even pull up Stanford's SUIF compiler group research page (suif.stanford.edu, maybe I'm just unlucky or it's gone/moved/temporarily down). And LLVM/Clang is from University of Illinois... so yeah, I'm sure they are using it too.

      The benefit to GCC from this is to not become obsolete in 5-10 years, from a steady influx of improved algorithms and tuning from a body of people that can easily contribute. Just from the fact LLVM/Clang is easier to work with, universities using it for their classes/research means that there is a steady crop of undergrads/grads familiar with LLVM/Clang and its set of libraries. They can contribute, and the research community doesn't have to roll its own intermediate form for research algorithm implementation and then throw that out when it comes to implementing the same algorithms in an actual intermediate language that is used in a real compiler. When you're a student, the last thing you want to do when you've got a project due in the semester, or you are trying to write your thesis/dissertation and graduate, is screw with compiler internals that are purposely difficult to work with (GCC).

      Yes, GCC has a core group that has done an excellent job. But they are facing commercial interests improving the LLVM/Clang (i.e. Apple and Obj-C) plus now the OpenCL and OpenMP work going on, and on top of that an ever growing population of former students with skills/knowledge and perhaps the desire to contribute.

      f I were RMS I'd be worried.

      Agreed. Those years he opposed modularizing GCC might have really hurt the project in a way that isn't done being felt yet.

    • RMS is like a typecast actor. He has his role, and plays it unswervingly.
      However, if there are ways to help out the studio, even if he's not in the film, what's the issue?
    • by tlambert ( 566799 ) on Saturday February 08, 2014 @07:16PM (#46199225)

      I'm not sure how GCC could benefit from this.

      You are not reading history.

      GCC moves too damn slow and doesn't include features that developers (and more importantly: the companies which pay developers) want. These days, that includes the changes between the GPLv2 and GPLv3 not being wanted by the people who pay the bills.

      GCC was more or less started in 1984: http://www.gnu.org/gnu/thegnup... [gnu.org]

      GCC was almost replaced by the EGCS fork in 1997, and it took two years before RMS finally gave up on the idea of having the ultimate editorial control over the language implementation, and "blessed" EGCS as the replacement for GCC. When he did that, he gave up on limiting the OSs that the compiler worked on, and limiting the inclusion of things like #pragma (which used to exec "nethack" because RMS didn't like it), and some of the language front ends that are now included, like g77, which RMS didn't want.

      GCC is on the verge of being marginalized again by LLVM; all the sexy compiler work is happening in LLVM, all the bright young minds in the compiler world are going to LLVM because it's a lot easier to make a front end for a new language or a back end for a different processor or embedded controller or virtual machine. LLVM is the "go-to" compiler for academic projects involving compiler research.

      It makes sense; GCC: 1984; +15 years = EGCS: 1999; +15 years = ????: 2014.

      RMS' recent appeal *might* be able to attract a bunch of new ideologues to the GCC project, and have them forsake LLVM work, but more likely course and project requirements for a degree, and after that, an employer, probably mean that LLVM is going to remain the "go-to" compiler for the new blood.

      The idea that GCC can leverage some of the new blood by making it easier for them to work with code in both contexts, rather than leaving GCC in the ashbin of history, is about the *only* way to give GCC the transfusion of new blood it's going to need to survive another 15 years.

      It also couldn't hurt to expand the number of (or replace) members of the "GCC steering committee" so that GCC can get a little more forward momentum. You can get forward momentum one of two ways: (1) more specific impulse, or (2) take off the parking brake.

      • by AmiMoJo ( 196126 ) *

        On the other hand as a commercial programmer I like the fact that GCC is mature and very stable. I write for microcontrollers mostly, and don't really want major changes coming on a regular basis.

        Also it seems that GCC usually produces faster executables, at least the last time I checked, so even if you do care more about performance it would seem to be the (free) compiler of choice.

    • Comment removed (Score:5, Insightful)

      by account_deleted ( 4530225 ) on Saturday February 08, 2014 @09:40PM (#46199779)
      Comment removed based on user account deletion
      • The history of computer software and hardware design has been all about managing complexity in order to do more things with less people since the beginning.

        As for your little tirade against the GPLv3 you have no clue about what the license changes mean. The only substantial difference is that anyone who distributes GPLv3 code *must* give the recipients a royalty free license to any patents they own that are required to be able to use that particular product. I do not think that is particularly onerous. In f

      • by richlv ( 778496 )

        could you please clarify what's the problem with gplv3 in the context of gcc ?
        a genuine question, i'm not aware of the details in this specific case - it's not like they host modified gcc or something...

        also, fuck beta :)

        • Comment removed (Score:4, Insightful)

          by account_deleted ( 4530225 ) on Sunday February 09, 2014 @07:05AM (#46201771)
          Comment removed based on user account deletion
          • by theCoder ( 23772 )

            Of course, any code that requires a patent license to run isn't exactly free software either. And no free software project "with a brain" should accept code that opens up users to legal liability.

            If companies like Apple and Google really are rejecting GPL v3 because of patent issues, that makes me think they want to use their patents against users of the software they are purporting to be "free." Are users of the LLVM compiler going to wake up one day to a lawsuit from one of these companies alleging pate

        • could you please clarify what's the problem with gplv3 in the context of gcc ?
          a genuine question, i'm not aware of the details in this specific case - it's not like they host modified gcc or something...

          Just as an example: Apple uses a compiler _at runtime_ to compile OpenGL and OpenCL to the hardware. They use LLVM for that. If your favourite game is running on MacOS X or iOS, and it uses OpenGL, LLVM is built into the app (or more likely into the graphics driver). _That_ isn't possible with gcc without releasing the whole graphics driver. And that's something Apple doesn't want to do.

          Note that with GPL 2 license, what Apple wanted to do was fine. Now it isn't. The problem for gcc is that compiler writ

          • Just as an example: Apple uses a compiler _at runtime_ to compile OpenGL and OpenCL to the hardware. They use LLVM for that. If your favourite game is running on MacOS X or iOS, and it uses OpenGL, LLVM is built into the app (or more likely into the graphics driver). _That_ isn't possible with gcc without releasing the whole graphics driver. And that's something Apple doesn't want to do.

            Note that with GPL 2 license, what Apple wanted to do was fine. Now it isn't.

            No that would be in complete violation of GPL

    • by Hatta ( 162192 )

      While theoretically GPL could subsume BSD code produced from the collaboration

      Yeah, ask Theo DeRaadt [slashdot.org] about that.

  • by Anonymous Coward on Saturday February 08, 2014 @06:07PM (#46198869)

    The GPL is not for everyone or every company, get over it.

    The BSD[MIT/APACHE/ZLIB] licence is the only real free open source license. In a perfect world we wouldn't need licences at all and everyone wouldn't have a hissyfit every time someone borrowed code from someone.

    • by paxcoder ( 1222556 ) on Saturday February 08, 2014 @06:14PM (#46198905)

      RMS knows that (and has made statements to that effect): GPL exists precisely because it's not a perfect world.
      While you may call it a freedom, "freedom" to kill would not be a beneficial one.
      Speaking metaphorically, that's what BSD license grants you: A way to murder free software in the black hole of proprietary software.
      Do companies contribute back? Sure, some do, some of the things. But everything else is competition.
      And therein lies the real difference: GPL is against proprietary software, it aims to provide free software to everyone. BSD isn't and doesn't.
      Kinda like free vs open.
      TL;DR: No.

      • by Anonymous Coward on Saturday February 08, 2014 @06:31PM (#46199007)

        Do companies contribute back? Sure, some do, some of the things. But everything else is competition.

        I would be very interested in seeing real statistics on this, because my experiences with companies using BSD style licensed code in their software suggests the exact opposite. There are a number of reasons to use open source software in your project, the chief among them being "not reinventing the wheel". The problem is, the moment you generate your own proprietary fork, you're back to reinventing the wheel. Chances are, you made the changes because the software in question didn't quite do what you wanted it to do, or to fix a bug. Great, so now you've got your own branch, and every time you update this software with the latest "official" version for whatever reason (including perhaps, not reinventing the wheel for some new feature) you have to apply your patches and changes, and hope that the patches you built against version X are still valid against version Y.

        In my experience, the only time companies don't give back is when they've made such massive changes that they would be maintaining their own branch anyway. And with changes that large, it's extremely unlikely the main branch would ever integrate them all back in, which means the company is maintaining their own fork, regardless of whether or not they've released the code. Now, you can argue (as RMS does) that regardless, the important thing is whether the new code is open, not whether it's ever merged back, but there are considerations to be had as well. Forks split and consume development resources. Different projects all doing the same thing slightly differently create more work for people trying to target those projects, such that writing new useful software that takes advantage of other available resources either requires multiple code paths to handle each resource (think vendor specific CSS tags but worse) or can't be meaningfully built without someone writing additional code.

        • I can tell you, I've branched an open source project before, fixed some bugs, and released it for my company without merging back the changes. Why? Because my boss felt it would be a competitive advantage. So every once in a while I did a merge. No big deal, the software community at large lost, but I got paid.
        • by Alef ( 605149 )

          Another advantage of keeping involved and contributing back is that you get to influence the direction in which the upstream project goes (if the maintainers aren't too obstinate). And through that you make better use of the work produced by people you don't have to pay. Also, contributing a patch back lets you exploit the quality assurance provided by the project, be it explicit or implicit in the fact that your patch will be used and tested in practice by a lot of more people.

          I'd say it makes business sen

      • Re: (Score:3, Interesting)

        by Anonymous Coward

        Speaking metaphorically, that's what BSD license grants you: A way to murder free software in the black hole of proprietary software.

        I find it hilarious that you use this analogy in a thread talking about a BSD licensed compiler (clang) that Apple wrote, and then fully open sourced more freely than the competition..

        • A BSD licensed compiler that an University of Illinois student wrote, which eventually got hired by Apple to continue working on it in order to replace the GCC compiler Apple used to use before.

      • Re: (Score:2, Insightful)

        BSD = "I don't care WHAT the hell you do with this code"

        GPL = "You better give some something back buddy if you want to use this"
        • by paxcoder ( 1222556 ) on Saturday February 08, 2014 @08:29PM (#46199543)

          Actually, no. You may use GPL'd code any way you like (that's freedom 0) and share with others (freedom 2). You can likewise modify the software any way you like (freedom 1). And all this time, you need not release source code. The condition to release the source only kicks in with freedom to distribute your changes (freedom 3), so only when there is a third person involved with your derivative you have to grant them the same freedoms you've been given by the original author.
          In fact, this was a problem with SaaS: You could've modified free software, and run it in the back on your servers, and say that you're simply providing a service to the end user, and since he's not getting the modified program, he doesn't get to have its source either. This is what AGPL is designed to address, and thus it's mostly used for web software. So with AGPL, as soon as you use a program, whether you have a copy, or are executing it online, you get access to the source.

        • by mark-t ( 151149 ) <markt AT nerdflat DOT com> on Saturday February 08, 2014 @08:39PM (#46199583) Journal

          Neither the BSD nor the GPL remove (not can they remove) the aspect that copyright requires that a person must get permission from the original copyright holder if they are creating a derivative work of something copyrighted. In that light, both the BSD and GPL licenses essentially state that everyone who adheres to the terms of the license is free to create derivative works, thereby effectively granting such permission... but still only to people who adhere to the terms of the license.

          Of course, the terms of the BSD license are pretty lax in comparison to the GPL... the former being not much beyond keeping the copyright notices in header files intact, while the latter license requires that the derivative work be released under the same license.

      • Re: (Score:3, Interesting)

        by tlhIngan ( 30335 )

        RMS knows that (and has made statements to that effect): GPL exists precisely because it's not a perfect world.
        While you may call it a freedom, "freedom" to kill would not be a beneficial one.
        Speaking metaphorically, that's what BSD license grants you: A way to murder free software in the black hole of proprietary software.
        Do companies contribute back? Sure, some do, some of the things. But everything else is competition.
        And therein lies the real difference: GPL is against proprietary software, it aims to p

        • Sure. Ask the Wine developers why they switched from BSD to LGPL.

        • You know what? EVERY GPL advocate says "Companies will steal your BSD code!!!!!! NOOOO!!! BAD!!!!" But you know what really irks people? GPL does exactly the same thing. You see, GPL projects can take code from BSD projects, but that BSD project cannot take any improvements the GPL project makes.

          So the GPL argument that BSD is bad because the code can be taken and relicensed is bad because BSD code can be taken and relicensed? I love your logic! :D

    • by kthreadd ( 1558445 ) on Saturday February 08, 2014 @06:15PM (#46198915)

      One of the areas where the licensing of gcc have been very successful is within embedded hardware. Gcc has gained a high reputation within this field which has lead to adoption by several vendors of embedded systems. These firms are not known for their generosity or cooperability, so without the GPL it is unlikely that the changes they needed had been contributed back upstream. This is of course only speculation, but I would say that the GPL has overall been advantages to gcc.

      • Re: (Score:3, Interesting)

        by Anonymous Coward

        I agree with this sentiment but you also have to conciser the number of ideas, projects and companies that never even leave the ground because they aren't willing to entertain the idea of including GPL licensed code because it means they would have to open up the source of their entire project. I think this is a point that most devs that defend GPL to the death fail to conciser.
        GPL is a giant viscous legal thorn bush for ANY developer who has ANY reason they can't or don't want to release the source of thei

        • by pe1rxq ( 141710 )

          You are trying to sell the wrong thing.
          Software is not scarce, the only way to sell it like it is scarce is by artificially making it so. That is what closed source software (or like you mentioned patents) do.

          Making mony with GPL licensed code is not that hard, (many others are doing it), but you have to sell the thing that is truly scarce: Your time and knowledge.
          Have them pay you to make it or improve it, or sell support.

        • by martin-boundary ( 547041 ) on Saturday February 08, 2014 @08:38PM (#46199579)
          On the contrary, that point is exactly *why* we GPL advocates advocate it. We don't want to enable companies which have no intention whatsoever to be part of the community. They're free to do everything themselves, and good luck to them. But giving them a leg up to get off the ground just so they can be selfish assholes with their ideas? Why should we? And yes, sharing your *ideas* and *implementations* is what we mean by being part of the community. If this isn't for you, then don't let the door hit you on the way out, thanks.
          • On the contrary, that point is exactly *why* we GPL advocates advocate it. We don't want to enable companies which have no intention whatsoever to be part of the community. They're free to do everything themselves, and good luck to them. But giving them a leg up to get off the ground just so they can be selfish assholes with their ideas? Why should we? And yes, sharing your *ideas* and *implementations* is what we mean by being part of the community. If this isn't for you, then don't let the door hit you on the way out, thanks.

            hm I see your point, but i don't have a problem with enabling companies to be selfish.
            You only exclude the entrepreneurs by being viral. The large companies will jump in and be selfish because they already have teams they can dedicate to being selfish and rolling their own if they want. They'll just use BSD or something.
            The entrepreneurs create new technologies, so excluding them just kills new smaller markets that larger companies wouldn't have entered anyways.
            Maybe it's not a big deal and maybe its good w

          • But giving them a leg up to get off the ground just so they can be selfish assholes with their ideas? Why should we?

            Well, that's a matter of opinion, but many of us would hold that it's better for the ecosystem as a whole if you do.

            There are two fundamentally different ways to look at this (with nuances coming later):
            1) The greatest good comes from allowing anyone to stand on anyone's shoulders.
            2) The greatest good comes from having more people scrambling to climb on top.

            Even if you think that the two can coexist, there's still the question of which you believe will lead to the greatest good and whether or not you would

        • GPL is a giant viscous legal thorn bush for ANY developer who has ANY reason they can't or don't want to release the source of their code

          Well yeah, actually, that is the point.

    • Re: (Score:3, Insightful)

      by Anonymous Coward

      The GPL guarantees that if you have access to the binary you have access to the source. BSD/etc do not. In other words: BSD gives you the "freedom" to restrict others freedom. That isn't something people on the free software front consider positive.

      Maybe it's you who should get over the fact rms believes in free software. You're entitled to your opinion, he's entitled to his. It isn't like he's pointing a free 3D-printed gun to your face and forcing you to write GPL'd code to extend emacs.

    • by caseih ( 160668 )

      It all depends on your definition of freedom. I don't believe Linux would have the diversity of corporate backing without the GPL. The GPL is what allows IBM, Google, RedHat, and other heavy weights the freedom to collaborate for mutual benefit while still being competitors. Every contributor and developer operates on an equal legal footing with the GPL. The BSD works fine for many people, and for companies, like Apple. But Apple definitely is not collaborating on core OS X proper with other companies.

    • So called 'permissive licenses' are a joke. Clauses in them are utterly useless. While GPL aims to prevent the use of copyright for destructive purposes. If such prevention is unneeded for various reasons then you're better off skipping 'permissive' licenses in favor of WTFPL which at least doesn't pretend to be something serious.
  • I bet this works great for the GCC devs.

    Unless they're going to work under the BSD license, LLVM will be screwed over because they aren't going to include GPL code into LLVM.

    • by sjames ( 1099 )

      Isn't that what they chose by selecting the BSD license? t least it won't disappear into a black hole where they can't even look at the improvements like when their code gets used in a proprietary program.

      Of course, since they are different code bases they would probably need their own implementation anyway.

  • Build compatibility (Score:5, Interesting)

    by TheloniousToady ( 3343045 ) on Saturday February 08, 2014 @06:46PM (#46199079)

    Having read TFA, this collaboration appears to be partly about build compatibility. So far, it sounds like LLVM/Clang has been imitating GCC options. But what happens when one or the other of them adds a new option or feature? That might break builds designed for the other one. So, it sounds like the two groups would like to start communicating and coordinating so that both systems can be compatible at a build level in the future. Implicit in this is that both would continue to exist as independent entities and that build compatibility would be a primary goal for both. Perhaps some deeper form of technical collaboration might even be possible in the future.

    Then again, I may have that all wrong. I know nothing about it except what I learned from reading TFA. If that causes a problem, I'll try not to do it again.

    • Having read TFA, this collaboration appears to be partly about build compatibility. So far, it sounds like LLVM/Clang has been imitating GCC options.

      Apple used to have something called LLVM-GCC. I think it's still there so things like make, or other things that assume GCC still work, but at least in their Xcode tools they no longer support LLVM-GCC.

  • Good move.

    While forking is a necessary fact to develop a new idea (even into the original community), merging (at lead idea) is even more necessary long term consequence to avoid fragmentation. The most dangerous thing for open source communities is to start to see others projects and communities as futile and without interesting for learning something.

    Desktop related projects should really start to go into that direction now.

You are always doing something marginal when the boss drops by your desk.

Working...