mirror of
https://github.com/kanidm/kanidm.git
synced 2025-04-21 09:45:39 +02:00
Use lld by default on linux (#3477)
Some checks failed
Linting checks / clippy (push) Has been cancelled
Linting checks / fmt (push) Has been cancelled
Spell Check / codespell (push) Has been cancelled
Container - Kanidm / Set image tag values (push) Has been cancelled
Container - Kanidmd / Set image tag values (push) Has been cancelled
Container - Radiusd / Set image tag values (push) Has been cancelled
Javascript Linting / javascript_lint (push) Has been cancelled
Javascript Linting / javascript_fmt (push) Has been cancelled
GitHub Pages / pre_deploy (push) Has been cancelled
GitHub Pages / docs_master (push) Has been cancelled
PyKanidm tests / tests (push) Has been cancelled
Linux Build and Test / rust_build (push) Has been cancelled
Linux Build and Test / rust_build_next (beta) (push) Has been cancelled
Linux Build and Test / rust_build_next (nightly) (push) Has been cancelled
Linux Build and Test / run_release (push) Has been cancelled
Windows Build and Test / windows_build_kanidm (push) Has been cancelled
Container - Kanidm / Build kanidm Docker image (push) Has been cancelled
Container - Kanidm / Push kanidm Docker image (push) Has been cancelled
Container - Kanidmd / Build kanidmd Docker image (push) Has been cancelled
Container - Kanidmd / Push kanidmd Docker image (push) Has been cancelled
Container - Radiusd / Build radius Docker image (push) Has been cancelled
Container - Radiusd / Push radius Docker image (push) Has been cancelled
GitHub Pages / fanout (${{ needs.pre_deploy.outputs.latest}}) (push) Has been cancelled
GitHub Pages / deploy (push) Has been cancelled
Some checks failed
Linting checks / clippy (push) Has been cancelled
Linting checks / fmt (push) Has been cancelled
Spell Check / codespell (push) Has been cancelled
Container - Kanidm / Set image tag values (push) Has been cancelled
Container - Kanidmd / Set image tag values (push) Has been cancelled
Container - Radiusd / Set image tag values (push) Has been cancelled
Javascript Linting / javascript_lint (push) Has been cancelled
Javascript Linting / javascript_fmt (push) Has been cancelled
GitHub Pages / pre_deploy (push) Has been cancelled
GitHub Pages / docs_master (push) Has been cancelled
PyKanidm tests / tests (push) Has been cancelled
Linux Build and Test / rust_build (push) Has been cancelled
Linux Build and Test / rust_build_next (beta) (push) Has been cancelled
Linux Build and Test / rust_build_next (nightly) (push) Has been cancelled
Linux Build and Test / run_release (push) Has been cancelled
Windows Build and Test / windows_build_kanidm (push) Has been cancelled
Container - Kanidm / Build kanidm Docker image (push) Has been cancelled
Container - Kanidm / Push kanidm Docker image (push) Has been cancelled
Container - Kanidmd / Build kanidmd Docker image (push) Has been cancelled
Container - Kanidmd / Push kanidmd Docker image (push) Has been cancelled
Container - Radiusd / Build radius Docker image (push) Has been cancelled
Container - Radiusd / Push radius Docker image (push) Has been cancelled
GitHub Pages / fanout (${{ needs.pre_deploy.outputs.latest}}) (push) Has been cancelled
GitHub Pages / deploy (push) Has been cancelled
* 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
|
||||
|
||||
> 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:
|
||||
|
||||
```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.
|
||||
|
||||
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:
|
||||
|
||||
```bash
|
||||
|
@ -123,25 +118,16 @@ export CC="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
|
||||
|
||||
> 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 also need some system libraries to build this:
|
||||
|
||||
```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:
|
||||
|
@ -152,12 +138,14 @@ perl-FindBin perl-File-Compare
|
|||
|
||||
### 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 will also need some system libraries to build this, which can be installed by running:
|
||||
|
||||
```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.
|
||||
|
|
Loading…
Reference in a new issue