Announcement

Collapse
No announcement yet.

Mold 1.0 Released As A Modern High-Speed Linker Alternative To GNU Gold, LLVM LLD

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

  • #21
    Originally posted by NobodyXu View Post
    LTO linking isn’t exactly compilatiom.
    It is running optimization passes in the linker.
    That’s why it is called Link Time Optimization since it is run in the linker.
    no, it's running optimization passes in the compiler.
    Originally posted by NobodyXu View Post
    Here is an article from LLVM explaning design of LTO, https://llvm.org/docs/LinkTimeOptimization.html it explicitly mentions that LTO is run in the linker:
    llvm didn't have any linker at all when gcc already had lto, so you should check gcc docs

    Comment


    • #22
      Originally posted by cl333r View Post
      Does the linker play a role in app startup time?
      no, it doesn't

      Comment


      • #23
        Originally posted by cl333r View Post
        Does the linker play a role in app startup time? I mean is it "linking" anything when the OS is executing an application or only during compilation time?
        No that's the loader's job. In the olden days I think they used to be the same thing (linker and loader in one).

        Comment


        • #24
          i can only welcome development of fast linker and usage of c++20. but its claims need grain of salt. most of its speedup comes from multithreading which only works for last job in build. and it doesn't support make jobserver, i.e. it will happily run 100 linkers each using 100 cores on 100 core machine during parallel build with many links. also it overwrites binaries in place(instead of create new + rename) if open for writing succeeds. well, open fails only for running executables, but not for their libraries, overwriting used library will certainly crash running executables using it.

          Comment


          • #25
            Originally posted by pal666 View Post
            no, it's running optimization passes in the compiler.
            llvm didn't have any linker at all when gcc already had lto, so you should check gcc docs
            llvm has lld, and it is where LTO happens.

            In fact, if you are using thinLTO (a parallelised LTO invented by llvm), it will not work unless “-fuse-ld=lld” is passed to clang so that it will use lld instead of the default gold ld installed on your system.

            Comment


            • #26
              Originally posted by carewolf View Post

              Yeah, the compiler run in the linker. In other words done by the compiler. And it is optimizations, but mainly it is compilation. Turning intermediate code into binary code.
              Well, can’t say I disagree with that.

              LLVM basically build libLLVM.so as a dynamic library and linked the lld against it so that they can use the optimization passes and codegen passes from it.

              Comment


              • #27
                Originally posted by pal666 View Post
                ... also it overwrites binaries in place(instead of create new + rename) if open for writing succeeds. well, open fails only for running executables, but not for their libraries, overwriting used library will certainly crash running executables using it.
                If your linker output goes straight to /usr/bin or /usr/lib, you have bigger problems to worry about.

                Comment


                • #28
                  Originally posted by cl333r View Post
                  Does the linker play a role in app startup time? I mean is it "linking" anything when the OS is executing an application or only during compilation time?
                  That is the job of the dynamic linker.

                  Comment


                  • #29
                    Originally posted by mlau View Post
                    You can't build anything with fancy linker scripts either, from the issue tracker:
                    So, still a ways to go to be a replacement for LLD.

                    Comment


                    • #30
                      Originally posted by brad0 View Post

                      So, still a ways to go to be a replacement for LLD.
                      I think this is currently more intended for rapid development/debugging sessions by developers. Cases where you'd be compiling in debug mode.

                      Then for release you'd switch to one of the existing linkers.

                      Comment

                      Working...
                      X