user3428154
user3428154

Reputation: 1364

Cross-compile C++ project for ARM64 with bazel

I'm trying to cross-compile hello-world C++ project with bezel for ARM64 device. I work with Linux/Ubuntu x86_64 as a built-host-PC. I'm following the Building a C++ Project.

I can build the project for host-PC.

bazel build //main:hello-world

Now I'm trying to cross-compile this project for ARM64 device as

bazel build --cpu=aarch64 //main:hello-world

I used different configuration for --cpu=arm64, --cpu=aarch64, --cpu=arm64-v8a and it does not wrok.

I'd model the environment as a platform to automatically select the appropriate toolchain installed via "crossbuild-essential-arm64" package for build action.

The cross-compilation build is done on PC-host - host platform - and executed there - execution platform - so the platforms are the same, but the - target platform - is different where the hello-world C++ project will run.

How to cross-compile the C++ project for arm64 target with bazel using --platforms properly?

Upvotes: 4

Views: 4143

Answers (0)

Related Questions