Embedded Linker (ELD)
ELD is Qualcomm’s open-source, LLVM-based, GNU-compatible linker. It can be used as an alternative to LLD or GNU ld when building Zephyr with an LLVM toolchain (for example Arm Toolchain for Embedded or a host clang). See the ELD user guide for details on ELD itself.
ELD is just a linker (ld.eld); a separate C/C++ toolchain is still
required to compile sources.
Installation
There are three ways to obtain ELD:
Nightly binary release. Prebuilt
ld.eldbinaries are published on the ELD releases page.Build from source. Build ELD against an LLVM tree as described in the ELD README; an integrated
llvm-projectbuild producesld.eldunder the build tree’sbin/directory.Full toolchain via cpullvm. The cpullvm toolchain is a complete LLVM toolchain for Arm, AArch64 and RISC-V embedded targets that bundles both
ld.eldandld.lldalong with clang, the runtime libraries and headers. Prebuilt cpullvm archives are published on its cpullvm releases page for Linux and Windows, and cpullvm 22.1.1 has been tested with Zephyr in the ELD CI.
Options 1 and 2 only provide ld.eld; a separate LLVM toolchain (clang,
runtime libraries and headers) is still needed to build Zephyr.
Verify the installation:
$ ld.eld --version
eld 22.0 (GNU Compatible linker)
ELD 22.0 or later is required.
Usage
ELD is selected through the host/llvm toolchain variant. Point
LLVM_TOOLCHAIN_PATH at the LLVM toolchain (for example a cpullvm
installation, or another toolchain with ld.eld on its bin/ directory
or PATH), then enable ELD by setting
CONFIG_LLVM_USE_ELD to y.
For example:
west build ... -- -DZEPHYR_TOOLCHAIN_VARIANT=host/llvm \
-DLLVM_TOOLCHAIN_PATH=<path-to-llvm-toolchain> \
-DCONFIG_LLVM_USE_ELD=y
See Arm Toolchain for Embedded (ATfE) or Zephyr SDK for more on configuring an LLVM toolchain.