Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cc doesn't seem to respect CARGO_TARGET_{TARGET_TRIPLE}_LINKER on Android #555

Closed
JohnTitor opened this issue Oct 22, 2020 · 2 comments
Closed

Comments

@JohnTitor
Copy link
Member

I've found cc >= 1.0.53 doesn't seem to respect CARGO_TARGET_{TARGET_TRIPLE}_LINKER.
In the libc crate, e pass aarch64-linux-android28-clang as CARGO_TARGET_AARCH64_LINUX_ANDROID_LINKER here: https://github.com/rust-lang/libc/blob/4d0643b769a4c1051908419e3cf25e6b46762dea/ci/docker/aarch64-linux-android/Dockerfile#L30-L33
But the test emits this failure (full log: https://github.com/rust-lang/libc/runs/1266042807?check_suite_focus=true):

  running: "aarch64-linux-android21-clang" "-O0" "-DANDROID" "-ffunction-sections" "-fdata-sections" "-fPIC" "-g" "-fno-omit-frame-pointer" "-Wall" "-Wextra" "-Wall" "-Wextra" "-Werror" "-Wno-unused-parameter" "-Wno-type-limits" "-Wno-address-of-packed-member" "-Wno-unknown-warning-option" "-Wno-deprecated-declarations" "-D_GNU_SOURCE" "-o" "/checkout/target/aarch64-linux-android/debug/build/libc-test-1fbfc2c2b96c32dc/out/main.o" "-c" "/checkout/target/aarch64-linux-android/debug/build/libc-test-1fbfc2c2b96c32dc/out/main.c"
  cargo:warning=/checkout/target/aarch64-linux-android/debug/build/libc-test-1fbfc2c2b96c32dc/out/main.c:4442:24: error: use of undeclared identifier 'fmemopen'; did you mean 'freopen'?
  cargo:warning=                return fmemopen;
  cargo:warning=                       ^~~~~~~~
  cargo:warning=                       freopen
  cargo:warning=/android/ndk-aarch64/bin/../sysroot/usr/include/stdio.h:286:7: note: 'freopen' declared here
  cargo:warning=FILE* freopen(const char* __path, const char* __mode, FILE* __fp);
  cargo:warning=      ^

This means the build uses aarch64-linux-android21-clang, i.e., API 21 NDK.

I think #495 is the cause since it's released as 1.0.53, cc @Dushistov.

@alexcrichton
Copy link
Member

AFAIK this crate has never read that env var, it's always expected CC to be set

@JohnTitor
Copy link
Member Author

AFAIK this crate has never read that env var, it's always expected CC to be set

Ahh, yes, cc now reads CC_aarch64_linux_android (i.e. CC_TARGET) only, I guess?
As mentioned in #459, CARGO_TARGET_AARCH64_LINUX_ANDROID_LINKER affected the build with cc previously. And the behavior for that certainly changed between 1.0.52 and 1.0.53.
Thanks for clarifying, I'm going to close this as there's no actionable item here :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants