forked from kiss-community/repo
mold: 0.9.3
See the README file. --- READMEs like this one are something I want to add to each package. This solves the lack of a description for each package as well as the disconnect between Wiki pages and the software itself. The website can leverage these files to provide full documentation for each package. This will also make 'kiss help <pkg>' work.
This commit is contained in:
parent
b19abcfaef
commit
970b16ac31
70
extra/mold/README
Normal file
70
extra/mold/README
Normal file
@ -0,0 +1,70 @@
|
||||
Mold
|
||||
________________________________________________________________________________
|
||||
|
||||
mold is a multi-threaded, high-performance linker that is several times faster
|
||||
than the industry-standard ones, namely, GNU ld, GNU gold or LLVM lld. It is
|
||||
developed as a drop-in replacement for these linkers and command-line compatible
|
||||
with them with a few exceptions.
|
||||
|
||||
|
||||
Caveats
|
||||
________________________________________________________________________________
|
||||
|
||||
* mold can not yet link the kernel.
|
||||
* LTO is not yet supported (so refrain from using it)
|
||||
|
||||
If a package fails to link with mold, open an issue at $/kisslinux/repo and
|
||||
(until it is fixed) revert to using your previous linker for said package.
|
||||
|
||||
|
||||
Usage
|
||||
________________________________________________________________________________
|
||||
|
||||
The linker is typically located at /usr/bin/ld and is invoked by the compiler.
|
||||
To use mold as the system linker, one of the following methods must be used.
|
||||
|
||||
1. Use the alternatives system to set mold as the system linker.
|
||||
|
||||
+------------------------------------------------------------------------------+
|
||||
| |
|
||||
| $ kiss a mold /usr/bin/ld |
|
||||
| |
|
||||
+------------------------------------------------------------------------------+
|
||||
|
||||
2. Add --ld-path to CFLAGS/CXXFLAGS (Clang > 12.0)
|
||||
|
||||
+------------------------------------------------------------------------------+
|
||||
| |
|
||||
| $ export CFLAGS="$CFLAGS -ld-path=/usr/bin/mold" |
|
||||
| $ export CXXFLAGS="$CXXFLAGS -ld-path=/usr/bin/mold" |
|
||||
| |
|
||||
+------------------------------------------------------------------------------+
|
||||
|
||||
3. Add -B to CFLAGS/CXXFLAGS (GCC)
|
||||
|
||||
+------------------------------------------------------------------------------+
|
||||
| |
|
||||
| $ export CFLAGS="$CFLAGS -B/usr/lib/mold" |
|
||||
| $ export CXXFLAGS="$CXXFLAGS -B/usr/lib/mold" |
|
||||
| |
|
||||
+------------------------------------------------------------------------------+
|
||||
|
||||
|
||||
Verification
|
||||
________________________________________________________________________________
|
||||
|
||||
To verify that mold is being used, disable binary stripping (KISS_STRIP=0) and
|
||||
run the following command on a newly build executable. If 'mold' appears in the
|
||||
output, everything is setup correctly.
|
||||
|
||||
+------------------------------------------------------------------------------+
|
||||
| |
|
||||
| $ readelf -p .comment /path/to/exe |
|
||||
| |
|
||||
+------------------------------------------------------------------------------+
|
||||
|
||||
|
||||
Further Reading
|
||||
________________________________________________________________________________
|
||||
|
||||
* $/rui314/mold
|
26
extra/mold/build
Executable file
26
extra/mold/build
Executable file
@ -0,0 +1,26 @@
|
||||
#!/bin/sh -e
|
||||
#
|
||||
# This build system is a little funky. I want to contribute upstream to get the
|
||||
# whole thing buildable with Makefiles (no Cmake).
|
||||
|
||||
make -C xxhash
|
||||
|
||||
# Point mold to the local xxhash.
|
||||
export CXXFLAGS="-L$PWD/xxhash -I$PWD/xxhash $CXXFLAGS"
|
||||
|
||||
# Prevent the build system from overwriting CC/CXX.
|
||||
sed /clang/d Makefile > _
|
||||
mv -f _ Makefile
|
||||
|
||||
# CMAKE_GENERATOR must be set to force usage of Makefiles. The build system
|
||||
# calls cmake and proceeds to assume that Makefiles will be used with it.
|
||||
make CMAKE_GENERATOR= LDFLAGS="$LDFLAGS -static"
|
||||
make install
|
||||
|
||||
# Create a symbolic link so users can use mold as the linker system-wide
|
||||
# (without need for special CFLAGS/CXXFLAGS).
|
||||
ln -s mold "$1/usr/bin/ld"
|
||||
|
||||
# To tell GCC to use mold we must put a symlink to it in a directory and set it
|
||||
# to search for the linker within.
|
||||
ln -s ../../bin/mold "$1/usr/lib/mold/ld"
|
2
extra/mold/checksums
Normal file
2
extra/mold/checksums
Normal file
@ -0,0 +1,2 @@
|
||||
bb4dea1e6b04ef989ffd4bd32c91a4f03fcd4853c849a9d0aae2a28e56aaa99f
|
||||
7054c3ebd169c97b64a92d7b994ab63c70dd53a06974f1f630ab782c28db0f4f
|
3
extra/mold/depends
Normal file
3
extra/mold/depends
Normal file
@ -0,0 +1,3 @@
|
||||
cmake make
|
||||
openssl make
|
||||
zlib make
|
2
extra/mold/sources
Normal file
2
extra/mold/sources
Normal file
@ -0,0 +1,2 @@
|
||||
https://github.com/rui314/mold/archive/refs/tags/vVERSION.tar.gz
|
||||
https://github.com/Cyan4973/xxHash/archive/refs/tags/v0.8.0.tar.gz xxhash
|
1
extra/mold/version
Normal file
1
extra/mold/version
Normal file
@ -0,0 +1 @@
|
||||
0.9.3 1
|
Loading…
Reference in New Issue
Block a user