Package Details: makepkg-optimize-mold 30-2

Git Clone URL: https://aur.archlinux.org/makepkg-optimize-mold.git (read-only, click to copy)
Package Base: makepkg-optimize-mold
Description: Supplemental build and packaging optimizations for makepkg
Upstream URL: https://wiki.archlinux.org/index.php/Makepkg-optimize
Keywords: makepkg-optimize makepkg-tweaks mold
Licenses: GPL-1.0-only
Submitter: ptr1337
Maintainer: ptr1337
Last Packager: ptr1337
Votes: 6
Popularity: 1.37
First Submitted: 2021-12-31 21:48 (UTC)
Last Updated: 2024-08-24 12:42 (UTC)

Dependencies (11)

Required by (0)

Sources (26)

Latest Comments

1 2 3 4 Next › Last »

ninetailedtori commented on 2026-01-08 18:51 (UTC)

I suspect something changed in terms of makepkg patching, and so it can't understand it for some reason. Not too sure why, but I might have to take a peek at it again.

veganvelociraptr commented on 2026-01-04 15:00 (UTC)

@ninetailedtori, I have the same problem. It used to work before but I guess something changed in Arch a few weeks ago. Haven't look much into it yet.

ninetailedtori commented on 2025-12-19 01:08 (UTC)

Hiya, throwing ==> ERROR: BUILDENV array contains unknown option '<option>' with all options in this package. Anyone know what I've f-ed up?

Tjuh commented on 2025-09-12 14:22 (UTC)

Cool, glad to help ;)

brikler commented on 2025-09-12 09:49 (UTC)

thank you again @Tjuh i was able to solve my problem by using bash instead fish

Tjuh commented on 2025-09-11 19:02 (UTC)

Also symlinked lld to point to ld; sudo ln /usr/bin/ld.lld /usr/bin/ld

Tjuh commented on 2025-09-11 18:40 (UTC)

Check out my makepkg.conf for suggestions;

#!/hint/bash
# shellcheck disable=2034

DLAGENTS=('file::/usr/bin/curl -qgC - -o %o %u'
          'ftp::/usr/bin/curl -qgfC - --ftp-pasv --retry 3 --retry-delay 3 -o %o %u'
          'http::/usr/bin/curl -qgb "" -fLC - --retry 3 --retry-delay 3 -o %o %u'
          'https::/usr/bin/curl -qgb "" -fLC - --retry 3 --retry-delay 3 -o %o %u'
          'rsync::/usr/bin/rsync --no-motd -z %u %o'
          'scp::/usr/bin/scp -C %u %o')
VCSCLIENTS=('bzr::breezy'
            'fossil::fossil'
            'git::git'
            'hg::mercurial'
            'svn::subversion')

CARCH="x86_64"
CHOST="x86_64-pc-linux-gnu"
PACKAGECARCH="x86_64_v3"

CFLAGS="-v -march=znver3 -Ofast -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -ffp-contract=fast -munsafe-fp-atomics -mtgsplit -fplugin=LLVMPolly.so --param=ssp-buffer-size=4 -DNDEBUG -fPIC -falign-functions=32 -fcoroutines -fdata-sections -fexperimental-library -ffunction-sections -flto=thin -fmerge-all-constants -fopenmp -fopenmp-cuda-mode -fopenmp-enable-irbuilder -fopenmp-extensions -fopenmp-optimistic-collapse -funroll-loops -fvisibility-inlines-hidden -fwhole-program-vtables -mprefer-vector-width=256 -mrelax-all -mllvm -polly -mllvm -polly-num-threads=16 -mllvm -polly-omp-backend=LLVM -mllvm -polly-parallel -mllvm -polly-position=before-vectorizer -mllvm -polly-scheduling-chunksize=1 -mllvm -polly-scheduling=dynamic -mllvm -polly-vectorizer=stripmine -mllvm -polly-process-unprofitable -mllvm -polly-use-llvm-names -pthread -stdlib=libc++ -w -fno-threadsafe-statics -Wno-incompatible-pointer-types -Wno-sign-conversion -Wno-sizeof-pointer-memaccess -Wno-unused-function -Wno-unused-parameter -Wno-error -fno-finite-math-only"
CXXFLAGS="$CFLAGS -std=gnu++23"
LDFLAGS="-Wl,-O2,--sort-common,--as-needed,-zrelro,-znow,-zpack-relative-relocs,--emit-relocs,--gc-sections,--hash-style=gnu,--icf=safe,--ignore-data-address-equality,--ignore-function-address-equality,--optimize-bb-jumps,--print-gc-sections,--print-icf-sections,--strip-debug,--trace,--verbose,--thinlto-cache-dir=/tmp,--thinlto-jobs=16,-lmimalloc,-lomp,-lpthread,-zifunc-noplt,-znotext,-zmax-page-size=0x4000,-zseparate-code,-zseparate-loadable-segments,-zshstk,-lm"
MAKEFLAGS="-j16"
NINJAFLAGS="-j16"

#BUILDDIR="/tmp/makepkg"
BUILDENV=(color !check !sign)
OPTIONS=(!strip !docs !emptydirs !libtool !staticlibs)
INTEGRITY_CHECK=(sha256)
DOC_DIRS=(usr/share/{doc,gtk-doc,locale,metainfo,zsh,man,vim,ffmpeg,lua-examples,backgrounds,themes,licenses})

LOGDEST="/home/tjuh/logs"
PKGDEST="/home/tjuh/packages"
SRCDEST="/home/tjuh/sources"

PACKAGER="Tjuh <tjuh@proton.me>"
COMPRESSZST=(zstd -c -z -vv --ultra -22 -T16 -)
PKGEXT=".pkg.tar.zst"
SRCEXT=".src.tar.gz"
GITFLAGS="--filter=tree:0"
chrt -iap 0 $$

brikler commented on 2025-09-11 12:17 (UTC) (edited on 2025-09-11 12:22 (UTC) by brikler)

thank you @Tjuh

it seems it is a bit more complicated :(

stderr: cc: error: unrecognized command-line option ‘-mllvm’
cc: error: unrecognized command-line option ‘-polly’
cc: error: unrecognized command-line option ‘-mllvm’
cc: error: unrecognized command-line option ‘-polly-num-threads=8’
cc: error: unrecognized command-line option ‘-mllvm’
cc: error: unrecognized command-line option ‘-polly-parallel’
cc: error: unrecognized command-line option ‘-Xclang’ 

/usr/share/makepkg/buildenv/graphite.sh:

buildenv_graphite() {
    if check_buildoption "graphite" "y" || check_buildoption "polly" "y"; then
        graphiteflags=" -lgomp -mllvm -polly -mllvm -polly-num-threads=$(getconf _NPROCESSORS_ONLN) -mllvm -polly-parallel"
        check_buildoption "polly" "y" && \
            graphiteflags+=" -Xclang -load -fplugin=LLVMPolly.so"
        check_buildoption "graphite" "y" && \
            graphiteflags=" -fgraphite-identity -floop-interchange -floop-nest-optimize -floop-parallelize-all -ftree-loop-distribution -ftree-parallelize-loops=$(getconf _NPROCESSORS_ONLN) -ftree-vectorize"

        CFLAGS+="$graphiteflags"
        CXXFLAGS+="$graphiteflags"
    fi

Tjuh commented on 2025-09-04 17:49 (UTC)

Install polly and use this -fplugin=LLVMPolly.so instead of -Xclang -load -Xclang LLVMPolly.so. Also that PGO script doesn't work with Clang, only GCC.

brikler commented on 2025-08-07 14:57 (UTC) (edited on 2025-08-07 14:58 (UTC) by brikler)

hi,

it seems something isn't ok with makepkg-optimize-mold :( and pgo also doesn't work

error: unable to load plugin 'LLVMPolly.so': 'LLVMPolly.so: cannot open shared object file: No such file or directory'
clang (LLVM option parsing): Unknown command line argument '-polly'.  Try: 'clang (LLVM option parsing) --help'
clang (LLVM option parsing): Did you mean '--color'?
clang (LLVM option parsing): Unknown command line argument '-polly-num-threads=8'.  Try: 'clang (LLVM option parsing) --help'
clang (LLVM option parsing): Did you mean '--xcore-max-threads=8'?
clang (LLVM option parsing): Unknown command line argument '-polly-parallel'.  Try: 'clang (LLVM option parsing) --help'
clang (LLVM option parsing): Did you mean '--enable-pre'?
make[1]: *** [<builtin>: conn_bomb] Error 1
make[1]: *** Waiting for unfinished jobs....

clang -march=native -O2 -pipe -pthread -lgomp -mllvm -polly -mllvm -polly-num-threads=8 -mllvm -polly-parallel -Xclang -load -Xclang LLVMPolly.so -flto=auto -fprofile-generate -fprofile-dir=/home/tom/compile/bpftune-git/bpftune-git.gen -lpthread -Wl,-O1 -Wl,--sort-common -Wl,--as-needed -Wl,-z,relro -Wl,-z,now -Wl,-z,pack-relative-relocs -flto=auto -lgcov --coverage conn_bomb.c -o conn_bomb