diff --git a/src/agent/.cargo/config b/src/agent/.cargo/config new file mode 100644 index 0000000000..7a843e5d72 --- /dev/null +++ b/src/agent/.cargo/config @@ -0,0 +1,15 @@ +## Copyright (c) 2020 ARM Limited +## +## SPDX-License-Identifier: Apache-2.0 +## + +[target.aarch64-unknown-linux-musl] +## Only setting linker with `aarch64-linux-musl-gcc`, the +## `rust-agent` could be totally statically linked. +linker = "aarch64-linux-musl-gcc" + +## The __addtf3, __subtf3 and __multf3 symbols are used by aarch64-musl, +## but are not provided by rust compiler-builtins. +## For now, the only functional workaround accepted by rust communities +## is to get them from libgcc. +rustflags = [ "-C", "link-arg=-lgcc" ] diff --git a/src/agent/src/linux_abi.rs b/src/agent/src/linux_abi.rs index 69edb20d9d..f0cdc7a302 100644 --- a/src/agent/src/linux_abi.rs +++ b/src/agent/src/linux_abi.rs @@ -16,7 +16,7 @@ pub const SYSFS_PCI_BUS_RESCAN_FILE: &str = "/sys/bus/pci/rescan"; target_arch = "x86" ))] pub const PCI_ROOT_BUS_PATH: &str = "/devices/pci0000:00"; -#[cfg(target_arch = "arm")] +#[cfg(target_arch = "aarch64")] pub const PCI_ROOT_BUS_PATH: &str = "/devices/platform/4010000000.pcie/pci0000:00"; pub const SYSFS_CPU_ONLINE_PATH: &str = "/sys/devices/system/cpu";