Announcement

Collapse
No announcement yet.

LLVM/Clang Can Work Fine As A GCC Replacement For Linux Distributions

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

  • #31
    I can't say I care.
    Especially when things like steam will break if you use something like that.(although I guess you could use flatpak for that).

    Oh I can see now why companies and some specific projects care so much about LLVM now
    image.png
    Last edited by SViN; 05 February 2024, 03:15 PM.

    Comment


    • #32
      Was doing this over five years ago on exherbo. It's valuable work in and of itself, since you inevitably end up exposing bugs in the software, for example code that relies of unwarranted assumptions, i.e. gcc / libstdc++ implementation details that aren't part of the specification

      Comment


      • #33
        Originally posted by SViN View Post
        Oh I can see now why companies and some specific projects care so much about LLVM now
        image.png
        Yes, because clang via llvm actually provided usability features such as autocompletions in IDE's which gcc for a long while refused to implement out of fear that someone else would use gcc in a way they don't like.

        Comment


        • #34
          Originally posted by Daktyl198 View Post

          GCC has a ton of Linux-specific extensions to it's "standard" library. That's why people are surprised, and that's why building the Linux kernel using Clang is almost impossible. macOS doesn't use proprietary extensions to write their kernel.
          impossible? try "commonplace"

          Comment


          • #35
            Originally posted by Daktyl198 View Post

            that's why building the Linux kernel using Clang is almost impossible.
            All it takes is adding "LLVM=1" to the make command used to build the kernel with Clang. Everything else is the same. Of course, assuming llvm, clang, ld.lld are already installed in Linux. Build completes without any errors and the built kernel is completely reliable. Did I understand what you wrote wrong? Apologies if that is the case.

            Comment


            • #36
              Originally posted by Daktyl198 View Post

              GCC has a ton of Linux-specific extensions to it's "standard" library. That's why people are surprised, and that's why building the Linux kernel using Clang is almost impossible. macOS doesn't use proprietary extensions to write their kernel.
              It is easy right now.
              Look at OpenaMandriva spec, here you can find info how they build kernel for both Clang and GCC: https://github.com/OpenMandrivaAssoc...er/kernel.spec

              Comment


              • #37
                Originally posted by mrg666 View Post

                All it takes is adding "LLVM=1" to the make command used to build the kernel with Clang. Everything else is the same. Of course, assuming llvm, clang, ld.lld are already installed in Linux. Build completes without any errors and the built kernel is completely reliable. Did I understand what you wrote wrong? Apologies if that is the case.
                I haven’t kept up. Last I checked in, there was an entire fork of the Linux kernel dedicated to removing proprietary gcc extensions from the kernel so that it would build on clang, and they still hadn’t managed to get it to build without issues/errors. That was a while ago though.

                Comment


                • #38
                  Originally posted by Daktyl198 View Post

                  I haven’t kept up. Last I checked in, there was an entire fork of the Linux kernel dedicated to removing proprietary gcc extensions from the kernel so that it would build on clang, and they still hadn’t managed to get it to build without issues/errors. That was a while ago though.
                  Well, imho, you didn't miss much. It takes much longer to build kernel with llvm. It is waste of time and resources for me, so I prefer good-old gcc.

                  Comment


                  • #39
                    Originally posted by Luke_Wolf View Post
                    While idiomatic code is written "widely different" the languages themselves are not and this meme is stupid.

                    Unless you're using one of a very small handful of unsupported features C code is C++ code.
                    Have yountried to compile complex C code with a C++ compiler?

                    Originally posted by Luke_Wolf View Post
                    Whether you like it or not C is a (albeit not strict) subset of C++ and there's plenty of large codebases out there using C++ as a sort of Super C (Writing C++ as if it was idiomatic C but using C++ features such as Templates rather than macros). Sitting here pretending otherwise is just asinine regardless of your personal language preferences, GCC and Clang don't test code for idiomacy.
                    And here is why C++ gets a bad reputation. I see that code again and again. The big problem with it is that this people map their C knowledge to C++. It doesn't use much contemporary C++ but is tampering with memory on a very low level.

                    Comment


                    • #40
                      Originally posted by darkoverlordofdata View Post
                      Truth be told - I’d switch to C++ today if they could get rid of the need for headers.​
                      They have modules now but I think it will take a decade before all tool chains supporting them.

                      Comment

                      Working...
                      X