Announcement

Collapse
No announcement yet.

Mold 2.32 Released With Increased LLVM LLD Compatibility, Faster Identical Code Folding

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

  • Mold 2.32 Released With Increased LLVM LLD Compatibility, Faster Identical Code Folding

    Phoronix: Mold 2.32 Released With Increased LLVM LLD Compatibility, Faster Identical Code Folding

    Mold 2.32 is out as the newest feature release for this high speed code linker that rivals LLVM LLD and GNU Gold...

    Phoronix, Linux Hardware Reviews, Linux hardware benchmarks, Linux server benchmarks, Linux benchmarking, Desktop Linux, Linux performance, Open Source graphics, Linux How To, Ubuntu benchmarks, Ubuntu hardware, Phoronix Test Suite

  • #2
    Do anybody here in the forum using mold?
    making it really a difference, if you create your program?

    The time-comparisons looking great.
    For example linking clang needs with GNU ld 42.07 second, with GNU gold 33.13 seconds, with LLVM lld 5.20 seconds and with Mold 1.35 seconds.
    Sounds really greate.
    But if the compilation needs for example 10 hours, then it makes (nearly) no difference, if the linking needs 5 seconds or one second. And I think then it makes also no difference if it needs 45 seconds. Then the time-wasting part have to be searched on an other part of the process.

    Ok, it makes more sense if you don't build a complete program new. If you developing a program and all parts are compiled and only a part will be new compiled and then all again linked.
    But helps it then really much? Or needs then the compiling still in the most cases a lot of more time then the linking at the end?

    And if it really increases the build-speed, makes it then more sence, to develop platform-independent programs (for example written with Qt or GTK+) on Linux, where Mold exists, then for example on Windows, where currently no Mold exits?

    Comment


    • #3
      Originally posted by theuserbl View Post
      Do anybody here in the forum using mold?
      making it really a difference, if you create your program?
      It makes linking fast if you developing applications, because if you change only few translation units, linking gets dominant. If you compile the whole program, the difference should be much smaller. For LTO there should be no differences.

      I use it extensively for TDD.

      Comment


      • #4
        With Mold 2.32 comes support for faster Identical Code Folding (ICF) as a means of finding identical functions and merging them to reduce the size of the output file.Identical Code Folding with Mold has been found to be very helpful for template-heavy C++ programs.
        I wonder if Rust also benefits from this?

        Comment


        • #5
          Gentoo users will love this!

          Comment


          • #6
            This is for Arch when you building packages, AUR etc.

            Code:
            #########################################################################
            # ARCHITECTURE, COMPILE FLAGS
            #########################################################################
            #
            CARCH="x86_64"
            CHOST="x86_64-pc-linux-gnu"
            
            #-- Compiler and Linker Flags
            #CPPFLAGS=""
            CFLAGS="-march=native -O3 -pipe -fno-plt -fexceptions \
                    -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security \
                    -fstack-clash-protection -fcf-protection \
                    -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer"
            CXXFLAGS="$CFLAGS -Wp,-D_GLIBCXX_ASSERTIONS"
            LDFLAGS="-Wl,-O1 -Wl,--sort-common -Wl,--as-needed -Wl,-z,relro -Wl,-z,now \
                     -Wl,-z,pack-relative-relocs,-fuse-ld=mold"
            LTOFLAGS="-flto=auto"
            RUSTFLAGS="-C opt-level=2 -C target-cpu=native -Cforce-frame-pointers=yes"
            #-- Make Flags: change this for DistCC/SMP systems
            MAKEFLAGS="-j$(nproc)"
            #-- Debugging flags
            DEBUG_CFLAGS="-g"
            DEBUG_CXXFLAGS="$DEBUG_CFLAGS"
            #DEBUG_RUSTFLAGS="-C debuginfo=2"​
            Also disable package compression for faster builds/installs

            Code:
            #########################################################################
            # EXTENSION DEFAULTS
            #########################################################################
            #
            #PKGEXT='.pkg.tar.zst'
            #SRCEXT='.src.tar.gz'
            
            # Disable compression
            PKGEXT='.pkg.tar'
            SRCEXT='.src.tar'​

            Comment


            • #7
              Originally posted by Shtirlic View Post
              This is for Arch when you building packages
              Fedora users cried their eyes out over fno-omit-frame-pointer

              Arch Linux sneaked it in a couple of weeks ago and no one bats an eye
              > This RFC proposes to add -fno-omit-frame-pointer and > -mno-omit-leaf-frame-pointer to the default compilation flags > to improve the effectiveness of profiling and debugging tools. See https://rfc.archlinux.page/0026-fno-omit-frame-pointer/


              Michael

              Comment


              • #8
                Using on Gentoo since a couple of years.

                Comment


                • #9
                  Originally posted by dralley View Post

                  I wonder if Rust also benefits from this?
                  I use Mold with Rust and it’s quite fast. For one of my projects on my Power9 system, it makes the compile time go from 5-7 minutes to one minute. It’s why I sponsor Mold.

                  Comment


                  • #10
                    Originally posted by rjzak View Post

                    I use Mold with Rust and it’s quite fast. For one of my projects on my Power9 system, it makes the compile time go from 5-7 minutes to one minute. It’s why I sponsor Mold.
                    Of course in general, I meant the specific feature in question

                    Comment

                    Working...
                    X