Announcement

Collapse
No announcement yet.

Why Google Chrome Switched To The Clang Compiler On Linux

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • #21
    Originally posted by mlau View Post
    I thought it was only because they can freely update the stdc++ lib that comes with clang. They can't update gcc on their
    ancient ubuntu machines so easily because it would break libstdc++-dependent binaries. Clang comes with its own libstdc++ and they link
    against that.
    gcc comes with its own version of libstdc++, libstdc++ is in fact part of the gcc project and automatically built when you build gcc.

    Besides clang usually links with libstdc++ on linux otherwise you get ABI issues with other C++ libraries, though you may choose to use it if you use no C++ libraries, but it is not common or recommended on linux.
    Last edited by carewolf; 06 January 2015, 08:01 AM.

    Comment


    • #22
      Yeah, it doesn't really make sense to me. I like clang, but I don't hate gcc.

      Maybe they're using some distribution that doesn't package bleeding edge GCC?

      I'll tell you first hand, building GCC manually is arduous. Before building GCC, you have to build a recent binutils, three multi-precision libraries (why do they need THREE libraries that do the SAME THING?), some loop optimization library, and either 1) Manually place the language source code you want to build in specific locations in the core GCC source tree, 2) Download ALL languages in one giant archive file from GNU's super slow website (or its mirrors) (big because of stupidly large gcj that no one uses). Then you have to run the configure script, figuring out how to convince it to use your new binutils, where the locations of all those libraries you built are, how to enable the only languages that matter (hint --enable-languages="c,c++,fortran"). Other obscure options you might need (which always confused the heck out of me) are --sysroot and some other --sysroot-like option (related to making it use the RIGHT binutils and libstdc++).

      Don't believe me? Read it for yourself...


      Basically, building GCC manually is confusing and difficult. Even when you do manage to build it, an easy-to-make mistake in configuration might end up using the system's libstdc++ and headers as well as the system's binutils when you build your own projects.

      Of course, distributions like Gentoo make it easy to use bleeding edge GCC. But distributions like CentOS do not package bleeding edge versions of GCC.

      I use FreeBSD most of the time. My understanding of the situation may be obsolete.

      EDIT:
      Oh yeah, other fun stuff includes lib64 vs lib (some systems I dealt with in the past have a lib64 directory which GCC and binutils don't work nicely with).
      Last edited by nslay; 06 January 2015, 09:07 AM.

      Comment


      • #23
        Originally posted by mcirsta View Post
        You can accuse Google of many things but of keeping things proprietary you really can't I think. MS likes ( do I really need to give examples of proprietary MS tech ? ) to do it and so does Apple ( swift is a close source language ) but Google usually open sources most of the tech. They've made codecs open, Android is also open source ...
        Google probably feels it's easier to take Clang where they want it rather than GCC. I couldn't give a sh*t about Clang for Linux because I think GCC does a good job but if someone is really interested in improving Clang for Windows that would be nice as MinGW is not that good.
        Actually... Android is not open source. Part of Android is.
        Part of MacOSX is also open source. Their kernel and base CLI user space is for example. Part of Safari is open source too.. a large part in fact, heck, in fact, Chrome started because of Safari's work being open source.
        Part of Windows 8.1 is also open source. Heck, .NET is open source too. And their experimental OS singularity too. And a bunch of other things too!

        You cannot run a driverless AOSP version of Android on a Nexus device for example, that is open source using Google products. They don't publish the code. In fact, many programs won't work. Library code being purposefully proprietary that apps use.

        Chrome is also not open source. Chromium is, but it's not exactly the same.

        In a nutshell, Google open sources anything that is beneficial to Google, but never open sources anything that is beneficial to you. That's totally fair and square from them. Apple and MS in fact do the same.
        But let's no call them what they're not...

        Comment


        • #24
          Originally posted by Marc Driftmeyer View Post
          Sorry, but any halfwit can figure out that GCC is becoming a disease with the GPLv3 and beyond.
          Really? The problems with GCC have nothing to do with the license and everything to do with the fact that it's a much older, more mature product than LLVM and it doesn't have as much investment from mega-rich corporate backers like Apple and Google.

          One of the other Phoronix articles this week, http://www.phoronix.com/scan.php?pag...tem&px=MTg3OTQ LLVM is 4 million lines of code, GCC is 14.5 million. Of course LLVM is going to have an edge.

          I really don't get the people who hate GPL licenses. If you release software under a BSD license, Apple, Google, Microsoft, Oracle, and a hundred thousand other companies can take your code and do whatever they want with it, and you have no right to complain, no ability to change it, nothing - and you're fine with that. But if you release software under a BSD license and someone reuses it in a GPL project, the GPL project can take your code, and do whatever they want with it, and you have no right to complain, no ability to change it, nothing beyond the ability to fork the GPL project yourself, except now the appropriation of your code is out in the open instead of hidden, and suddenly you hate it with a fiery passion.

          Or in other words, why can Larry Ellison use your code for his own ends and you don't care, but when Richard Stallman does the same right in front of you, you froth at the mouth?

          Comment


          • #25
            Originally posted by Michael_S View Post
            Really? The problems with GCC have nothing to do with the license and everything to do with the fact that it's a much older, more mature product than LLVM and it doesn't have as much investment from mega-rich corporate backers like Apple and Google.

            One of the other Phoronix articles this week, http://www.phoronix.com/scan.php?pag...tem&px=MTg3OTQ LLVM is 4 million lines of code, GCC is 14.5 million. Of course LLVM is going to have an edge.

            I really don't get the people who hate GPL licenses. If you release software under a BSD license, Apple, Google, Microsoft, Oracle, and a hundred thousand other companies can take your code and do whatever they want with it, and you have no right to complain, no ability to change it, nothing - and you're fine with that. But if you release software under a BSD license and someone reuses it in a GPL project, the GPL project can take your code, and do whatever they want with it, and you have no right to complain, no ability to change it, nothing beyond the ability to fork the GPL project yourself, except now the appropriation of your code is out in the open instead of hidden, and suddenly you hate it with a fiery passion.

            Or in other words, why can Larry Ellison use your code for his own ends and you don't care, but when Richard Stallman does the same right in front of you, you froth at the mouth?
            I release software under permissive license, and I am very happy when it's reused by any project, be it permissive, closed, or copylefted. Each time it is reused, some valuable programmer's time is save, and the society output is improved, which is good.
            The issue I have with GPL is that it is voluntarily less reusable by the biggest consumers of code and producer of software of our modern societies: companies. Of course, it is still better than closed source, which is not reusable at all. But closed source at least has the decency of not calling itself "free".

            GCC/LLVM is a typical example of this: there is obviously a business case for companies to maintain an open source compiler, yet these businesses still had to redevelop a second compiler from the ground. LLVM can be used in any situation GCC can, but not the other way around. In the end, GCC ends up mostly as a wasted effort.

            Comment


            • #26
              Originally posted by erendorn View Post
              I release software under permissive license, and I am very happy when it's reused by any project, be it permissive, closed, or copylefted. Each time it is reused, some valuable programmer's time is save, and the society output is improved, which is good.
              The issue I have with GPL is that it is voluntarily less reusable by the biggest consumers of code and producer of software of our modern societies: companies. Of course, it is still better than closed source, which is not reusable at all. But closed source at least has the decency of not calling itself "free".

              GCC/LLVM is a typical example of this: there is obviously a business case for companies to maintain an open source compiler, yet these businesses still had to redevelop a second compiler from the ground. LLVM can be used in any situation GCC can, but not the other way around. In the end, GCC ends up mostly as a wasted effort.
              BSD license: this thing is free for you to do whatever you want with it
              GPL license: this thing is free for everyone, and you can do whatever you want with it, as long as you don't restrict everyone else's freedom to use it in the future

              That's two different angles on free, but both are free.

              I firmly believe the major BSD-license projects like LLVM only exist because of copyleft competitors. If there was no GCC, Apple would have built its next compiler suite the same way it built the previous one it used before GCC - as a proprietary tool. So even if GCC fades into obscurity, its mere existence benefits everyone. And of course there's nothing to prevent a GPL fork of LLVM to restart the whole process anew.

              Comment


              • #27
                Originally posted by carewolf View Post
                gcc comes with its own version of libstdc++, libstdc++ is in fact part of the gcc project and automatically built when you build gcc.
                Well yes, that was the point: if you update to a new gcc with changed libstdc++ abi, existing binaries built against the older libstdc++ might break.
                Happenend when I updated my gentoo machines from gcc 4.7 to gcc 4.9.
                Clang brings its own libstdc++ on which nothing in the base system links against. Hence it's no deal when the clang cxx abi changes.

                Comment


                • #28
                  Originally posted by mlau View Post
                  Well yes, that was the point: if you update to a new gcc with changed libstdc++ abi, existing binaries built against the older libstdc++ might break.
                  Happenend when I updated my gentoo machines from gcc 4.7 to gcc 4.9.
                  Clang brings its own libstdc++ on which nothing in the base system links against. Hence it's no deal when the clang cxx abi changes.
                  You are thinking of libc++, but no, it still breaks. You can not combine libc++ and libstdc++, the symbols clash the exact same way as two versions of libstdc++ (implementing the same API with the same C++ mangling rules means you get the same clashing symbols). So if you can switch to libc++, you can also switch libstdc++ versions.

                  Comment


                  • #29
                    Originally posted by mlau View Post
                    Well yes, that was the point: if you update to a new gcc with changed libstdc++ abi, existing binaries built against the older libstdc++ might break.
                    Happenend when I updated my gentoo machines from gcc 4.7 to gcc 4.9.
                    Clang brings its own libstdc++ on which nothing in the base system links against. Hence it's no deal when the clang cxx abi changes.
                    So it's not a GCC problem itself, just an artifact of the way the libstdc++ packaged with GCC is also the system one? (Of course, most of the time that kind of default behavior would make sense.)

                    Comment


                    • #30
                      Originally posted by Michael_S View Post
                      BSD license: this thing is free for you to do whatever you want with it
                      GPL license: this thing is free for everyone, and you can do whatever you want with it, as long as you don't restrict everyone else's freedom to use it in the future

                      That's two different angles on free, but both are free.

                      I firmly believe the major BSD-license projects like LLVM only exist because of copyleft competitors. If there was no GCC, Apple would have built its next compiler suite the same way it built the previous one it used before GCC - as a proprietary tool. So even if GCC fades into obscurity, its mere existence benefits everyone. And of course there's nothing to prevent a GPL fork of LLVM to restart the whole process anew.
                      GPL products are usually of much lower quality than BSD code. Compare gnu libc and musl. Musl wins. Compare LLVM and GCC. Much less code in LLVM. tmux vs gnu screen? The BSD always wins. BSD cares about code quality and professional coders use it. Even companies use it. GPL otoh is closer to communism and they believe that everyone should be able to tinker with bad quality code. RMS himself said the top priority is preventing companies from using the tools. Having technical merits is not important for GNU. So it's kind of easy to see why people favor BSD software. For example LLVM has a simple goal to be technically superior to GCC and let companies use it. GCC wants to enforce GPLv3 down your throat and stop Apple from using it.

                      Comment

                      Working...
                      X