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

  • pal666
    replied
    Originally posted by NobodyXu View Post
    Gcc is similar that it requires Gold compiler according to https://gcc.gnu.org/wiki/LinkTimeOptimization
    gcc doesn't require gold and gold is not a compiler
    Originally posted by NobodyXu View Post
    And lld being gold compatible, support loading gold ld’s linker plugins.
    now go back and carefully read description of this "feature" which you conveniently skipped

    Leave a comment:


  • NobodyXu
    replied
    Originally posted by pal666 View Post
    gcc has no lld, so lto can't depend on lld. you are confusing llvms's variant of lto with lto
    Gcc is similar that it requires Gold linker according to https://gcc.gnu.org/wiki/LinkTimeOptimization


    To use this feature, you must be using gold as the linker and enable the use of the plugin by compiling with gcc -fuse-linker-plugin. This will shift the responsibility of driving the final stages of compilation from collect2 to gold via the linker plugin.
    And lld being gold compatible, support loading gold ld’s linker plugins.
    Last edited by NobodyXu; 25 December 2021, 07:30 PM.

    Leave a comment:


  • pal666
    replied
    Originally posted by Mark625 View Post
    If your linker output goes straight to /usr/bin or /usr/lib, you have bigger problems to worry about.
    i allow you to run executables from build directory. and if you don't do that, then check for open failure and fallback to rename isn't needed
    Last edited by pal666; 23 December 2021, 07:53 AM.

    Leave a comment:


  • pal666
    replied
    Originally posted by NobodyXu View Post
    llvm has lld, and it is where LTO happens.
    gcc has no lld, so lto can't depend on lld. you are confusing llvms's variant of lto with lto

    Leave a comment:


  • smitty3268
    replied
    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.

    Leave a comment:


  • brad0
    replied
    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.

    Leave a comment:


  • brad0
    replied
    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.

    Leave a comment:


  • Mark625
    replied
    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.

    Leave a comment:


  • NobodyXu
    replied
    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.

    Leave a comment:


  • NobodyXu
    replied
    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.

    Leave a comment:

Working...
X