Announcement

Collapse
No announcement yet.

FreeBSD 10 To Use Clang Compiler, Deprecate GCC

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

  • #16
    more free-libre compilers == good

    As a developer I am happy to see clang becoming robust enough to be considered a replacement for gcc.

    Competition is good, folks.
    gcc's only competetion (on *nix) for a long time has been proprietary compilers from the likes of intel and IBM.

    ...AND

    There is one area where clang kicks the crap out of gcc:

    COMPILER ERRORS

    No kidding. gcc sometimes gives you a useful error, but often it is meaningless or even misleading.
    I have at times installed clang just to recompile some c++ code where it was failing to compile under gcc and the error was completely incomprehensible.

    gcc is that bad.

    I am a big fan of the GPL, but NiH notwithstanding, clang is a welcome addition.

    Comment


    • #17
      Originally posted by XorEaxEax View Post
      I made my own benchmark script for 7-zip which I ran on a core i7, comparing GCC 4.7 against Clang 3.0, I tested both the synthetic benchmark which is built into 7-zip and also did a real-world benchmark of actually compressing a file (in this case an arch linux ISO, I'm an arch guy, what can I say), here are the results at different optimization levels:
      I suggest you try using profile guided optimization on the GCC build. In extreme cases I noticed a 50%~100% speedup when using PGO, and most people ignore this really great optimization.

      Comment


      • #18
        Originally posted by kiputnik View Post
        I suggest you try using profile guided optimization on the GCC build. In extreme cases I noticed a 50%~100% speedup when using PGO, and most people ignore this really great optimization.
        I know, and I do use it for my own code and sometimes even for benchmarking. However it's not a 'trivial' optimization as it's not just about adding a compiler flag but you also have to run the executable in a profiling stage and then compile again.

        This is also likely why most people don't use it, although of course it can be automated like done in Firefox, x264 etc. And yes it can seriously yield great results in cpu intensive code since it uses gathered runtime information which allows the optimizer to make much better choices concerning loop unrolling, branch prediction etc, of course as always sometimes the gains are big, sometimes barely noticeable which obviously depends on how good the optimizer was at correctly estimating without the benefit of runtime data.

        For this particular test I wanted the flags to be the same (Clang/LLVM doesn't have PGO), and also stick to the standard -Ox flags even though GCC could potentially be faster by enabling further optimizations.

        Comment


        • #19
          Originally posted by kiputnik View Post
          I suggest you try using profile guided optimization on the GCC build. In extreme cases I noticed a 50%~100% speedup when using PGO, and most people ignore this really great optimization.
          I remember my old Lunar Linux (source based distro) box, where only with PGO I was able to watch 720p YouTube videos. No over solution or distribution ever gave me this possiiibility on that machine. But that's not all, the responsiveness of Firefox alone was on a whole new level. I had to wait for 11 hours for the compilation to finish, but it payed back immediately. I just remembered that there was a problem with proprietary NVidia driver, so I had to stick with the nv driver (yes, that old and forgotten one), what makes PGO even that much more awesome.

          Comment


          • #20
            Who care?? this is so sad! FreeBSD just like a idiot crap !!! fortunately I am using Linux + GCC! I feel so welfare!
            Last edited by China_Guy; 05-13-2012, 06:56 AM.

            Comment


            • #21
              Originally posted by allquixotic View Post
              In FreeBSD's case, I think the reason they want Clang/LLVM is because they're license purists. Yes, they seriously would rather take a compiler producing shit for code output (very large and very slow binaries) over a GPLed compiler.
              I believe it's a bit more specific -- BSD guys object to GPL 3. GCC was tolerated while it was GPL 2, but the BSD crowd is quite hostile towards GPL 3.

              Personally, I find it a bit sad that they're content to ride behind Apple and eat their left-overs instead of riding with us Linux folks.

              Comment


              • #22
                Originally posted by pingufunkybeat View Post
                I believe it's a bit more specific -- BSD guys object to GPL 3. GCC was tolerated while it was GPL 2, but the BSD crowd is quite hostile towards GPL 3.

                Personally, I find it a bit sad that they're content to ride behind Apple and eat their left-overs instead of riding with us Linux folks.
                What the hell are you saying? Being a Linux user doesn't bloody means that you have to stick with GCC or anything FSF. LLVM/Clang is licensed in "University of Illinois/NCSA Open Source License" which is BSD-like license and that's a Free software license. I don't want to get into that debate that always pops in about GPL vs BSD.

                All that I can say is that Free as in a freedom (libre) is about choice. And BSD people are using it. I see no problem with that. Also, competition is always good so if this helps to push GCC to improve that's welcome. And I see no problems either if this ends up with Clang replacing GCC in any of the 'base' linux distros (RHEL, Debian, SuSE).

                Comment


                • #23
                  I have no problem with Clang being BSD licensed and I welcome more Free and Open options in terms of compilers.

                  I'm just uneasy with the religious and sectarian motivation for dumping GCC at all costs, spearheaded by Apple and seemingly followed by some BSD folks.

                  Clang is not replacing GCC because it is a better compiler. It is not a better compiler NOW.

                  Comment


                  • #24
                    I'm using Clang on Linux, OpenBSD and Windows.
                    It might be slower than GCC in general, but my code is always faster and smaller with Clang.
                    Also compile errors and warnings are much better in Clang.

                    Why all that trolling about how GCC is superior to Clang?
                    Alternatives are a good thing.
                    Last edited by LightBit; 05-13-2012, 12:12 PM.

                    Comment


                    • #25
                      Originally posted by pingufunkybeat View Post
                      I believe it's a bit more specific -- BSD guys object to GPL 3. GCC was tolerated while it was GPL 2, but the BSD crowd is quite hostile towards GPL 3.

                      Personally, I find it a bit sad that they're content to ride behind Apple and eat their left-overs instead of riding with us Linux folks.
                      They were never with Linux, but with Microsoft and Apple. MS and Apple hate Linux, but they love BSD, because it can't compete in any term.

                      Comment


                      • #26
                        Originally posted by LightBit View Post
                        Why all that trolling about how GCC is superior to Clang?
                        Alternatives are a good thing.
                        There's usually more trolling about GCC and GCC is superior in many things to Clang. Btw. Michael behaves like he was paid by Apple sometimes. He advertises Apple's Clang/llvm, iPhone, he's using OS X, but he's driving a Linux centered site same time. Sounds like hypocrisy to me.

                        Comment


                        • #27
                          Clang - It's like watching kids scramble to get the latest crap-phone.

                          LLVM/Clang is:
                          * still _MUCH_ slower than GCC.
                          * Does not build on nearly as many architectures OS combos as GCC do.
                          * Does not compile a lot of code correctly (even without specific GCC extensions).

                          I will repeat this.

                          LLVM/Clang IS A TOY COMPILER.

                          I do not use compilers to debug them while I try to produce working code.
                          I don't want to shift to something CRAPPIER because it's new.

                          It's like watching kids scramble to get the latest crap-phone only to get screwed by the telcos.

                          Comment


                          • #28
                            As someone who is using gcc and llvm/clang on a daily basis I have to tell you that your post is telling more about you than about llvm. ROFL.

                            Comment


                            • #29
                              Originally posted by kraftman View Post
                              They were never with Linux, but with Microsoft and Apple. MS and Apple hate Linux, but they love BSD, because it can't compete in any term.
                              Maybe, they were never with Linux, because Linux hates BSD. I also don't see how BSD is with Microsoft. Apple and Microsoft love BSD, because of license.

                              Comment


                              • #30
                                Originally posted by pingufunkybeat View Post
                                Personally, I find it a bit sad that they're content to ride behind Apple and eat their left-overs instead of riding with us Linux folks.
                                Next time check your facts. A lot of BSD people are employed by Apple. THEY brought BSD attitude into Apple. THEY are the reason any newly released source code by Apple is not under APSL 1.0 but usually a BSD-like license or Apache License 2 – incl. OpenBSM which is fully BSD-licensed. Those aren't leftovers by Apple, those are active contributions by Apple to the other BSDs.

                                If you don't like “Apple leftovers”, stop using CUPS, WebKit, etc. under Linux.

                                Comment

                                Working...
                                X