Conversation
When cross building riscv64, we need to specify ARCH=riscv so that this can set to $(SRCARCH) and can find the asm headers correctly. Also install Clang and related libs. Signed-off-by: Leo Yan <leo.yan@arm.com>
Install Clang/LLVM and host packages. Remove the prefix
${CROSS_COMPILE} from clang.
Signed-off-by: Leo Yan <leo.yan@arm.com>
Install Clang/LLVM and host packages. Remove the prefix
${CROSS_COMPILE} from clang.
Signed-off-by: Leo Yan <leo.yan@arm.com>
Install Clang/LLVM and host packages. Remove the prefix
${CROSS_COMPILE} from clang.
Signed-off-by: Leo Yan <leo.yan@arm.com>
Install Clang/LLVM and host packages. Remove the prefix
${CROSS_COMPILE} from clang.
Signed-off-by: Leo Yan <leo.yan@arm.com>
5088142 to
b837a98
Compare
Don't unset TARGET variable as it is used later. Signed-off-by: Leo Yan <leo.yan@arm.com>
b837a98 to
84e39fa
Compare
|
Hey, have you looked at the produced binaries? I'm not understanding how installing the host compilers and the host devel packages will end up producing a binary for the target arch, can you please elaborate? |
|
Hi @acmel , As claimed in [1]: "... Clang/LLVM is natively a cross-compiler, meaning that one set of programs can compile to all targets by setting the -target option." So we don't need to install extra arch specific Clang/LLVM packages, as the official Clang/LLVM can support cross compilation. I can confirm after using Clang for cross compilation arm64, I can get the binary info: |
|
Ok, that covers the clang, so since rx_and_build.sh already passes ARCH, no need to have the CROSS_COMPILE prefix for the clang binary, excellent. But is ubuntu multi-lib in the sense that the devel packages have the .so files for all target architectures? |
|
Reading that clang.llvm.org doc on x-compilation, this part: and: |
Ubuntu's multi-arch libraries can be used by both GCC and Clang. For example, if installed libtraceevent:arm64 on Ubuntu, then whether we build perf with The |
|
Just note for Android build: So far we can use Clang provided by Android NDK to build perf binary. If build with static linkage, we should have no concern for running perf on Android. On the other hand, except the Clang/LLVM is included in Android NDK package, it also contains sysroot and libs: Because Android NDK does not provide pkgconfig, so we cannot smoothly link these libs. Later we might consider to improve this a bit if have requirement. |
When cross building riscv64, we need to specify ARCH=riscv so that this can set to $(SRCARCH) and can find the asm headers correctly.
Also install Clang and related libs.