Skip to content

Commit 3f8e636

Browse files
committed
RISCV: Add CMake variable to set the system library directory
RISCV installs place the libraries inside a folder that is named after the ABI, so we need to prompt CMake to search there.
1 parent be6a14c commit 3f8e636

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/BuildToolchains.jl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,14 @@ function toolchain_file(bt::CMake, p::AbstractPlatform, host_platform::AbstractP
9494
set(CMAKE_SYSROOT /opt/$(aatarget)/$(aatarget)/sys-root/)
9595
"""
9696
end
97+
98+
if arch(p) == "riscv64"
99+
# RISCV libraries are in a subdirectory corresponding to the ABI of the processor
100+
file *= """
101+
set(CMAKE_SYSTEM_LIBRARY_PATH \${CMAKE_SYSROOT}/usr/lib64/lp64d)
102+
"""
103+
end
104+
97105
file *= """
98106
set(CMAKE_INSTALL_PREFIX \$ENV{prefix})
99107

0 commit comments

Comments
 (0)