facebook / buck

A fast build system that encourages the creation of small, reusable modules over a variety of platforms and languages.
https://buck.build
Apache License 2.0
8.56k stars 1.16k forks source link

GCC Toolchain Path Incorrect Post R22 NDK #2700

Open GEMISIS opened 2 years ago

GEMISIS commented 2 years ago

After R22 of the NDK, the NDK is clang only for build it seems? Per https://github.com/android/ndk/issues/1375 this means that the GCC toolchains that are attempting to be found no longer are (specifically at https://github.com/facebook/buck/blob/5444652af489563ddaf595a634341dd14fd41399/src/com/facebook/buck/android/toolchain/ndk/impl/NdkCxxPlatforms.java#L1250-L1253 this causes error using newer toolchains than R22).

GEMISIS commented 2 years ago

Looks like my original bug was an issue with my paths, but there is still an issue in that GCC related tools are being linked in the toolchain, which are no longer included with the NDK after R22.

GEMISIS commented 2 years ago

Actually, looks at this again, it may also be that it's failing before getting to what my original comment was discussing?

Per https://github.com/android/ndk/issues/1407, the sysroot path for NDK is now contained in /toolchains/llvm/prebuilt//sysroot instead of the top level directory. This means that buck is looking in the wrong spot for the sysroot directory at https://github.com/facebook/buck/blob/5444652af489563ddaf595a634341dd14fd41399/src/com/facebook/buck/android/toolchain/ndk/impl/NdkCxxPlatforms.java#L1209

It seems that NDK support may not have been kept up to date?

GEMISIS commented 2 years ago

Yeah, it looks like in the NdkCxxPlatforms.java file, there's a lot of updates that need to happen for more recent versions of the NDK, as everything after R19 is completely broken. The latest I've managed to get building on Windows is NDK version 19.2.5345600.

LegNeato commented 2 years ago

https://github.com/facebook/buck/pull/2685