C Cross compiling for ARM processor

I want to cross-compile applications for ARM processor on AMD host.
Do i have to recompile clang/llvm & (g)lib(c) with options to do so ?
Idem to setup a compilation toolchain ?
What for meson&automake&autoconf ?
 
Do i have to recompile clang/llvm & (g)lib(c) with options to do so ?
Idem to setup a compilation toolchain ?
Not necessary for recompilation of clang. Only 2 steps you need to do so:

Code:
$ # Example for arm64
$ export SYSROOT="/tmp/sysroot/arm64" TARGET="aarch64-unknown-freebsd"
$
$
$ # 1. Download `sysroot`
$ curl -LSs https://download.freebsd.org/ftp/releases/arm64/13.0-RELEASE/base.txz | \
>   tar Jxf - --include './usr/include/*' --include './usr/lib/*' --include './lib/*' -C ${SYSROOT}
$
$
$ # 2. Compile with the correct arguments
$ clang --target=${TARGET} --sysroot=${SYSROOT} -o foo foo.c
$ clang++ --target=${TARGET} --sysroot=${SYSROOT} -stdlib=libc++ -o bar bar.cpp

Please follow this post written by Marco Cilloni for more details.
 
If i understood correctly i use my default compiler but i say to compile to this "target".
And for the linker i have to download the "target stuff".
 
Back
Top