Zig Version
0.13.0-dev.46+3648d7df1
Steps to Reproduce and Observed Behavior
step1. export CC environment variable to cross compile
export CC="$HOME/android-ndk-r26d/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android21-clang"
step2. create a simple C source file test.c
#include <stdio.h>
int main() {
puts("Hello zig!");
return 0;
}
step3. build test.c for build machine
my build machine target triple is x86_64-unknown-linux-gnu
this will report error: unable to create compilation: LibCRuntimeNotFound
Note: this is a common case that we need two compilers, one for native build, another one for target build, to distinguish
these two, we usually use BUILD_CC or CC_FOR_BUILD to point to compiler for native build, use CC for target build, but zig doesn't distinguish these two.
Expected Behavior
zig could find it's own C runtime.
Zig Version
0.13.0-dev.46+3648d7df1
Steps to Reproduce and Observed Behavior
step1. export CC environment variable to cross compile
step2. create a simple C source file test.c
step3. build test.c for build machine
my build machine target triple is
x86_64-unknown-linux-gnuthis will report
error: unable to create compilation: LibCRuntimeNotFoundNote: this is a common case that we need two compilers, one for native build, another one for target build, to distinguish
these two, we usually use
BUILD_CCorCC_FOR_BUILDto point to compiler for native build, useCCfor target build, but zig doesn't distinguish these two.Expected Behavior
zig could find it's own C runtime.