Cross-compile C++ project for ARM64 with bazel - linux

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?

Related

How can I cross compile an arm linux target project on windows?

I want to use arm-linux-gnueabi-gcc on windows.
How can I get this toolchain to work on my windows 10 OS?

Cross-compiling Rust project fails due to missing libraries

I'm trying to cross compile a Rust project from x86-64 to armv7 (Raspberry Pi 3B+). That project uses the cxx for some of its functionality.
I set up the toolchain, installed the armv7-unknown-linux-gnueabihf target with rustup, and after some trial and error, I copied the required header files to /usr/arm-none-linux-gnueabihf/include. I also copied the /usr/lib/arm-linux-gnueabihf directory from a live Raspbian to /usr/arm-none-linux-gnueabihf/lib.
Then I executed cargo build --target armv7-unknown-linux-gnueabihf. That gives me the following error: https://pastebin.com/2LVZnQMQ.
I then made sure that libc.so.6 is in /usr/arm-none-linux-gnueabihf/lib and libc_nonshared.a is in /usr/arm-linux-gnueabihf/. That did not solve the issue.
I am lost as to what more the linker wants. What else do I need to copy to successfully compare the binary?

How to Build Skia in Mac OS

I'm beginner to Skia. So Just tried to build Skia in my machine ( macOS High Sierra 10.13.6 ).
I just followed the instructions Build.
Downloaded depot_tools
Downloaded Skia from git
bin/gn gen out/Static --args='is_official_build=false'
python2 tools/git-sync-deps
ninja -C out/Static
i did these instructions. But my xcode (version 9.2) doesnt support -std=c++17 so i replaced with -std=c++1z in all places.
But it throws error
Error
Please help to build skia for mac, and how to xcode project from this?
Skia makes use of C++17 language features (compiles with -std=c++17 flag) and thus requires a C++17 compatible compiler.
You'd better to update your xcode version.
Mac users may want to pass --ide=xcode to bin/gn gen to generate an Xcode project
You can check this.How to build skia

cross-compiling x264 for ARM

I'm novice in cross-compiling and just started to cross-compile packages on my linux machine (amd64) for host (NAS) with ARMv5 (linux kernel 2.6.31.8). I installed crosstool-ng and with it created toolchain for compilation for ARM. According to some tutorials online I succeeded to compile x264 package. But now when I try to run it, I was given the following error message
./x264: /lib/libm.so.6: version 'GLIBC_2.15' not found (required by ./x264)
Ok now I see that I need libm library but what it is and how to compile x264 with it?
From the error message: the version of x264 you built requires version of glibc 2.15. The Glibc is built as part of your cross compilation toolchain (through crosstool-ng).
You need to build a new toolchain with the same version of glibc found on your NAS root filesystem (or compatible).
(edited after #NotLikeThat comment)

CMake - SDL - Statically linked

I have an application that I build on both windows and linux using cmake. I want to distribute my linux version, but can't find a way via cmake to make it statically compile/include SDL. I'd rather not assume/require any users have SDL already installed.

Resources