Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 7 additions & 18 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,19 @@ endif

# Valid values are: amd64, arm64.
TARGET_ARCH ?= $(NATIVE_ARCH)

ifeq ($(NATIVE_ARCH),$(TARGET_ARCH))
ARCH_PREFIX :=
else ifeq ($(TARGET_ARCH),arm64)
ARCH_PREFIX := aarch64-linux-gnu-
ifeq ($(TARGET_ARCH),arm64)
ARCH_PREFIX := aarch64
else ifeq ($(TARGET_ARCH),amd64)
ARCH_PREFIX := x86_64-linux-gnu-
ARCH_PREFIX := x86_64
else
$(error Unsupported architecture: $(TARGET_ARCH))
endif

export TARGET_ARCH
export CGO_ENABLED = 1
export GOARCH = $(TARGET_ARCH)
export CC = $(ARCH_PREFIX)gcc
export OBJCOPY = $(ARCH_PREFIX)objcopy
export CC = $(ARCH_PREFIX)-linux-gnu-gcc
export OBJCOPY = $(ARCH_PREFIX)-linux-gnu-objcopy

BRANCH = $(shell git rev-parse --abbrev-ref HEAD | tr -d '-' | tr '[:upper:]' '[:lower:]')
COMMIT_SHORT_SHA = $(shell git rev-parse --short=8 HEAD)
Expand Down Expand Up @@ -78,18 +75,10 @@ ebpf-profiler: generate ebpf rust-components
go build $(GO_FLAGS) -tags $(GO_TAGS)

rust-targets:
ifeq ($(TARGET_ARCH),arm64)
rustup target add aarch64-unknown-linux-musl
else ifeq ($(TARGET_ARCH),amd64)
rustup target add x86_64-unknown-linux-musl
endif
rustup target add $(ARCH_PREFIX)-unknown-linux-musl

rust-components: rust-targets
ifeq ($(TARGET_ARCH),arm64)
RUSTFLAGS="--remap-path-prefix $(PWD)=/" cargo build --lib --release --target aarch64-unknown-linux-musl
else ifeq ($(TARGET_ARCH),amd64)
RUSTFLAGS="--remap-path-prefix $(PWD)=/" cargo build --lib --release --target x86_64-unknown-linux-musl
endif
RUSTFLAGS="--remap-path-prefix $(PWD)=/" cargo build --lib --release --target $(ARCH_PREFIX)-unknown-linux-musl

rust-tests: rust-targets
cargo test
Expand Down
2 changes: 1 addition & 1 deletion rust-crates/symblib-capi/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ rust-version.workspace = true
license.workspace = true

[lib]
crate-type = ["staticlib", "cdylib"]
crate-type = ["staticlib"]

[dependencies]
symblib.path = "../symblib"
Expand Down
Binary file modified target/aarch64-unknown-linux-musl/release/libsymblib_capi.a
Binary file not shown.
Binary file modified target/x86_64-unknown-linux-musl/release/libsymblib_capi.a
Binary file not shown.