Package Details: makepkg-optimize-mold 29-1

Git Clone URL: (read-only, click to copy)
Package Base: makepkg-optimize-mold
Description: Supplemental build and packaging optimizations for makepkg
Upstream URL:
Keywords: makepkg-optimize makepkg-tweaks mold
Licenses: GPL
Submitter: ptr1337
Maintainer: ptr1337
Last Packager: ptr1337
Votes: 0
Popularity: 0.000000
First Submitted: 2021-12-31 21:48 (UTC)
Last Updated: 2022-06-30 20:58 (UTC)

Dependencies (11)

Required by (0)

Sources (26)

Latest Comments

brikler commented on 2022-07-01 10:38 (UTC) (edited on 2022-07-03 07:51 (UTC) by brikler)

What do you think about the path: ~/.toolchain/llvm

thank you, i like it :)

perhaps jemalloc as optional dependence:

How to build

Be sure to have jemalloc installed, it is used to improve llvm-bolt's memory handling.

edit: to understand this correct: after compilation with BUILDENV bolt and relocs, i must run this script with the option STAGE=1and compile again?

edit2: wrong path in your bolt-scripts: TOPLEV=~/toolchain/llvm

ptr1337 commented on 2022-06-30 20:08 (UTC)

So, bolt should be correctly used now.

ptr1337 commented on 2022-06-30 19:05 (UTC)

@brikler Actually all are correct. These are just the verison's of llvm which where used for building. Actually I would go for the llvm-bolt-14 one, since it is the latest stable version. The -15 version is basically a build from the latest git commit, so does not mean to be stable.

I will sort out the server a bit with the llvm-bolt versions, I did some testing since at kernel building I found some issues but got them sorted out

What you mean how you can verify it ? You mean if clang where optimized by bolt ? Actually I let all time the optimized binary as default in called "clang-14" for example, then the original binary which is called "" and also add the profile (fdata) which where used to optimize the binary. So you can compare for example the compile time of each binary and see the performance difference and also some scripts which are helping in the usage of llvm-bolt.

Take a watch here for more infos about llvm-bolt:

Because the path: I saw the the export PATH command did somehow not correctly work. So I will soon push a new commit which fixes that when enabling options=(bolt).

What do you think about the path: ~/.toolchain/llvm ?


brikler commented on 2022-06-30 14:58 (UTC) (edited on 2022-06-30 18:02 (UTC) by brikler)


1) there are 3 llvm-bolt packages: llvm-bolt.tar.zst, llvm-bolt-13.tar.zst, llvm-bolt-14.tar.zst, and llvm-bolt-15.tar.zstwhat is the correct one?

2) i would prefer ~/toolchain/llvm-bolt as a hidden folder, because ~/ looks cleaner :) but for now, i will follow you

edit how can i verify if he package is optimized, or not?

ptr1337 commented on 2022-06-25 21:36 (UTC)


Just saw myself and its now fixed. Im sorry, next time I should run shellcheck before.


blackout commented on 2022-06-25 18:29 (UTC) (edited on 2022-06-25 18:29 (UTC) by blackout)

@ptr1337 Thanks for your efforts. Today's update gives me

/usr/share/makepkg/buildenv/ line 18: syntax error near unexpected token `;'
/usr/share/makepkg/buildenv/ line 18: `    check_buildoption "mold" "y"; then;'

ptr1337 commented on 2022-06-25 07:12 (UTC)


Sorry for late response. I did updated the patches, if you want to usea bolted toolchain place it to: ~/toolchain/llvm-bolt

You can find here prebolted llvm toolchains:

Simply download and extract it to there.



brikler commented on 2022-06-22 19:56 (UTC) (edited on 2022-06-23 06:10 (UTC) by brikler)


is this export correct? i ask, because it's your ~/

buildenv_bolt() {
  check_buildoption "bolt" "y"; then
  export PATH="/home/ptr1337/Documents/llvm/bin:$PATH"

to save for you i little time, if it is stored in~/Documents:

buildenv_bolt() {
  check_buildoption "bolt" "y"; then
  export PATH="/home/$USER/Documents/llvm/bin:$PATH"

i don't know if this export necessary, but there should be a hint imo

blackout commented on 2022-06-17 06:36 (UTC)

hash check fails for ldflags.conf ... FAILED

ptr1337 commented on 2022-04-29 14:44 (UTC)


No, actually if compiling something with GCC you would need to have GCC-12(-git) or need to patch gcc11 and also compile it on your own first. If you compile something with llvm, you can simply enable it with removing at option from "!mold" to "mold".

You can also use simply your old makepkg.conf, and add at options mold, then its also enabled.

Here you can take a watch at my makepkg.conf:

If you need gcc-git, its precompiled in the repo's which I provide, their you can also find all core and extra packages precompiled in x86-64-v3.

Koppajin commented on 2022-04-26 10:28 (UTC)

Do I need to uncomment anything in the makepkg-optimize.conf or is it good to go? I noticed there are two extra CFLAGS lines that are commented out. (I'm a total noob btw, I know enough to get around) Is this package designed with a completely vanilla makepkg.conf file in mind? I had already tweaked mine tiny bit.

blackout commented on 2022-01-14 18:25 (UTC)

@ptr1337 tested with latest mold-git, works as expected. Thank you for your effort.

ptr1337 commented on 2022-01-12 06:24 (UTC)


Sorry for the late response. The upcomming version of mold will have a fallback, as soon something would link with lto, to lld, ld.bfd. I think the next release will be soon, if using the git, you will face into no problems.

Checksums will be updated!

blackout commented on 2022-01-10 13:46 (UTC) (edited on 2022-01-10 13:46 (UTC) by blackout)

sha1sums block is wrong should be


j1simon commented on 2022-01-09 17:35 (UTC)

fetching devel info...
==> Making package: makepkg-optimize-mold 21-1 (Sun Jan  9 18:34:01 2022)
==> Retrieving sources...
-> Found
-> Found
-> Found
-> Found
-> Found
-> Found
-> Found
-> Found
-> Found
-> Found
-> Found cflags.conf
-> Found cxxflags.conf
-> Found makeflags.conf
-> Found ldflags.conf
-> Found debug-makeflags.conf
-> Found cmake-flags.conf
-> Found buildenv_ext.conf
-> Found destdirs_ext.conf
-> Found pkgopts_ext.conf
-> Found pkgopts-param_ext.conf
-> Found compress-param_max.conf
==> ERROR: Integrity checks (sha1) differ in size from the source array.
error: failed to download sources for 'makepkg-optimize-mold-21-1':
error: packages failed to build: makepkg-optimize-mold-21-1

blackout commented on 2022-01-03 00:40 (UTC) (edited on 2022-01-10 13:46 (UTC) by blackout)

@ptr1337 you should add -fno-lto to moldflags in as long as LTO is not implemented in mold ( this will disable LTO. Otherwise, builds will fail having LTO enabled per default (e.g. flashrom-git)

this should be sufficient

buildenv_mold() {
  if check_buildoption "mold" "y"; then
    CFLAGS+=" -fuse-ld=mold -fno-lto"