This is an archive of the discontinued LLVM Phabricator instance.

gn build: Upgrade to NDK r19.
ClosedPublic

Authored by pcc on Feb 4 2019, 7:33 PM.

Details

Summary

NDK r19 includes a sysroot that can be used directly by the compiler
without creating a standalone toolchain, so we just need a handful
of flags to point Clang there.

Diff Detail

Repository
rL LLVM

Event Timeline

pcc created this revision.Feb 4 2019, 7:33 PM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 4 2019, 7:33 PM
thakis accepted this revision.Feb 4 2019, 8:29 PM

Nice!

Do you know if we do this in chrome already?

llvm/utils/gn/build/toolchain/target_flags.gni
11 ↗(On Diff #185222)

What do we need the -B for btw? We use integrated-as and everything, right?

This revision is now accepted and ready to land.Feb 4 2019, 8:29 PM
pcc marked an inline comment as done.Feb 4 2019, 8:53 PM

Nice!

Do you know if we do this in chrome already?

Chrome is on r16 and doesn't use standalone toolchains, and I believe that it's doing something very similar to what we used to be doing here (e.g. https://cs.chromium.org/chromium/src/build/config/android/config.gni?type=cs&q=4%5C.9%5C.x&sq=package:chromium&g=0&l=319 to find libgcc).

llvm/utils/gn/build/toolchain/target_flags.gni
11 ↗(On Diff #185222)

The -B is needed to let the driver find libgcc which lives in a target-specific directory under toolchains/llvm/prebuilt/linux-x86_64/lib/gcc. I don't think it's used for anything else.

It looks it would have also worked to put libgcc in the sysroot (e.g. the aarch64 one could have lived in toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/lib/aarch64-linux-android), then there would be no need to pass -B as well. In fact if I try copying libgcc there and remove the -B here then I can still compile and link things and check-hwasan still passes. @danalbert do you know why it wasn't done that way?

This revision was automatically updated to reflect the committed changes.