mirror of
https://github.com/kanidm/kanidm.git
synced 2025-04-16 07:15:38 +02:00
Use lld by default on linux (#3477)
* Use lld by default on linux --------- Co-authored-by: James Hodgkinson <james@terminaloutcomes.com>
This commit is contained in:
parent
25c1c1573e
commit
e98d60a962
11
.cargo/config.toml
Normal file
11
.cargo/config.toml
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
# The default ld from glibc is impossibly slow and consumes huge amounts of
|
||||||
|
# memory. We use lld by default which often is twice as fast for significantly
|
||||||
|
# less ram consumption.
|
||||||
|
|
||||||
|
[target.x86_64-unknown-linux-gnu]
|
||||||
|
linker = "clang"
|
||||||
|
rustflags = ["-C", "link-arg=-fuse-ld=lld", "-Ctarget-cpu=native"]
|
||||||
|
|
||||||
|
[target.aarch64-unknown-linux-gnu]
|
||||||
|
linker = "clang"
|
||||||
|
rustflags = ["-C", "link-arg=-fuse-ld=lld", "-Ctarget-cpu=native"]
|
|
@ -100,21 +100,16 @@ You will need [rustup](https://rustup.rs/) to install a Rust toolchain.
|
||||||
|
|
||||||
### SUSE / OpenSUSE
|
### SUSE / OpenSUSE
|
||||||
|
|
||||||
|
> NOTE: clang and lld are required to build Kanidm due to performance issues with GCC/ld
|
||||||
|
|
||||||
You will need to install rustup and our build dependencies with:
|
You will need to install rustup and our build dependencies with:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
zypper in rustup git libudev-devel sqlite3-devel libopenssl-3-devel libselinux-devel pam-devel systemd-devel tpm2-0-tss-devel
|
zypper in rustup git libudev-devel sqlite3-devel libopenssl-3-devel libselinux-devel \
|
||||||
|
pam-devel systemd-devel tpm2-0-tss-devel clang lld make sccache
|
||||||
```
|
```
|
||||||
|
|
||||||
You can then use rustup to complete the setup of the toolchain.
|
You can then use rustup to complete the setup of the toolchain.
|
||||||
|
|
||||||
In some cases you may need to build other vendored components, or use an alternate linker. In these
|
|
||||||
cases we advise you to also install.
|
|
||||||
|
|
||||||
```bash
|
|
||||||
zypper in clang lld make sccache
|
|
||||||
```
|
|
||||||
|
|
||||||
You should also adjust your environment with:
|
You should also adjust your environment with:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
@ -123,25 +118,16 @@ export CC="sccache /usr/bin/clang"
|
||||||
export CXX="sccache /usr/bin/clang++"
|
export CXX="sccache /usr/bin/clang++"
|
||||||
```
|
```
|
||||||
|
|
||||||
And add the following to a cargo config of your choice (such as ~/.cargo/config), adjusting for cpu
|
|
||||||
arch
|
|
||||||
|
|
||||||
```toml
|
|
||||||
[target.aarch64-unknown-linux-gnu]
|
|
||||||
linker = "clang"
|
|
||||||
rustflags = [
|
|
||||||
"-C", "link-arg=-fuse-ld=lld",
|
|
||||||
]
|
|
||||||
```
|
|
||||||
|
|
||||||
### Fedora
|
### Fedora
|
||||||
|
|
||||||
|
> NOTE: clang and lld are required to build Kanidm due to performance issues with GCC/ld
|
||||||
|
|
||||||
You will need [rustup](https://rustup.rs/) to install a Rust toolchain.
|
You will need [rustup](https://rustup.rs/) to install a Rust toolchain.
|
||||||
|
|
||||||
You will also need some system libraries to build this:
|
You will also need some system libraries to build this:
|
||||||
|
|
||||||
```text
|
```text
|
||||||
systemd-devel sqlite-devel openssl-devel pam-devel
|
systemd-devel sqlite-devel openssl-devel pam-devel clang lld
|
||||||
```
|
```
|
||||||
|
|
||||||
Building the Web UI requires additional packages:
|
Building the Web UI requires additional packages:
|
||||||
|
@ -152,12 +138,14 @@ perl-FindBin perl-File-Compare
|
||||||
|
|
||||||
### Ubuntu
|
### Ubuntu
|
||||||
|
|
||||||
|
> NOTE: clang and lld are required to build Kanidm due to performance issues with GCC/ld
|
||||||
|
|
||||||
You need [rustup](https://rustup.rs/) to install a Rust toolchain.
|
You need [rustup](https://rustup.rs/) to install a Rust toolchain.
|
||||||
|
|
||||||
You will also need some system libraries to build this, which can be installed by running:
|
You will also need some system libraries to build this, which can be installed by running:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
sudo apt-get install libudev-dev libssl-dev libsystemd-dev pkg-config libpam0g-dev
|
sudo apt-get install libudev-dev libssl-dev libsystemd-dev pkg-config libpam0g-dev clang lld
|
||||||
```
|
```
|
||||||
|
|
||||||
Tested with Ubuntu 20.04 and 22.04.
|
Tested with Ubuntu 20.04 and 22.04.
|
||||||
|
|
Loading…
Reference in a new issue