Skip to content

cross-compile for ARM #365

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 17 commits into
base: main
Choose a base branch
from
Draft

cross-compile for ARM #365

wants to merge 17 commits into from

Conversation

harp-intel
Copy link
Contributor

Use the Go compiler's cross-compilation feature to build perfspect for aarch64.

Much more to-do, e.g., build binary resources for aarch64.

Signed-off-by: Harper, Jason M <jason.m.harper@intel.com>
harp-intel added 16 commits June 4, 2025 15:57
Signed-off-by: Harper, Jason M <jason.m.harper@intel.com>
Signed-off-by: Harper, Jason M <jason.m.harper@intel.com>
Signed-off-by: Harper, Jason M <jason.m.harper@intel.com>
Signed-off-by: Harper, Jason M <jason.m.harper@intel.com>
Signed-off-by: Harper, Jason M <jason.m.harper@intel.com>
Signed-off-by: Harper, Jason M <jason.m.harper@intel.com>
Signed-off-by: Harper, Jason M <jason.m.harper@intel.com>
Signed-off-by: Harper, Jason M <jason.m.harper@intel.com>
Signed-off-by: Harper, Jason M <jason.m.harper@intel.com>
Signed-off-by: Harper, Jason M <jason.m.harper@intel.com>
Signed-off-by: Harper, Jason M <jason.m.harper@intel.com>
Signed-off-by: Harper, Jason M <jason.m.harper@intel.com>
Signed-off-by: Harper, Jason M <jason.m.harper@intel.com>
Signed-off-by: Harper, Jason M <jason.m.harper@intel.com>
@echiugoog
Copy link
Contributor

LGTM, this minimizes needing an ARM host for building

@harp-intel
Copy link
Contributor Author

harp-intel commented Jun 5, 2025

LGTM, this minimizes needing an ARM host for building

That's the idea. Was able to get Linux perf built (cross-compiled) but still considering options for the other tools, e.g., use QEMU or spin up an ARM VM on AWS or GCP.

@echiugoog
Copy link
Contributor

I'm going through the other tools, might not be too bad... dmidecode was pretty simple to cross-compile, something like echiugoog@5414e3e

@@ -168,7 +168,7 @@ perf:
cd linux_perf/tools/perf && make LDFLAGS="-static --static" BUILD_BPF_SKEL=1 NO_JVMTI=1
mkdir -p bin
cp linux_perf/tools/perf/perf bin/
strip --strip-unneeded bin/perf
-strip --strip-unneeded bin/perf || true
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For aarch64, you can use aarch64-linux-gnu-strip

@echiugoog
Copy link
Contributor

For tools, what do you think of this approach? https://github.com/echiugoog/PerfSpect/tree/tools-cross-compile-arm

@harp-intel
Copy link
Contributor Author

For tools, what do you think of this approach? https://github.com/echiugoog/PerfSpect/tree/tools-cross-compile-arm

I like it. Thanks. Just need to make sure the build container is configured with the required cross-compile packages.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants