[PATCH] D57733: gn build: Upgrade to NDK r19.

Peter Collingbourne via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 4 20:53:56 PST 2019


pcc marked an inline comment as done.
pcc added a comment.

In D57733#1384600 <https://reviews.llvm.org/D57733#1384600>, @thakis wrote:

> 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).



================
Comment at: llvm/utils/gn/build/toolchain/target_flags.gni:11
+    "--sysroot=$android_ndk_path/toolchains/llvm/prebuilt/linux-x86_64/sysroot",
+    "-B$android_ndk_path/toolchains/llvm/prebuilt/linux-x86_64",
   ]
----------------
thakis wrote:
> What do we need the -B for btw? We use integrated-as and everything, right?
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?


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D57733/new/

https://reviews.llvm.org/D57733





More information about the llvm-commits mailing list