Hide the symbols in the builtins library

When the NDK switches to the compiler-rt builtins, it would be
convenient if the symbols were hidden even without passing
-Wl,--exclude-libs. Keeping the symbols out of app DSO dynsym tables
ensures that apps use their own copies of the builtins, not those from
the platform libc.so/libm.so libs.

On arm32 and 32-bit x86 only, the platform needs to continue exporting
some builtins symbols from libc.so and libm.so, so generate a special
version of the builtins with the symbols exported.

Also: stop outputting a couple copies of libunwind into self.toolchain
that I think aren't needed, because they're only used by the consumers
of the finished toolchain build, not by any toolchain builder:
 - a copy in the runtimes_ndk_cxx directory
 - libunwind-exported.a

Test: ./build.py --no-build windows --no-lto --debug
Change-Id: I44ec79728db92c089e2f39823c35b6f97d24c1ab
1 file changed
tree: 08edae54403d29a43c7290e44782641840086d23
  1. kernel-boot-tests/
  2. patches/
  3. test/
  4. .gitignore
  5. __init__.py
  6. android_llvm_next_flags.go
  7. android_version.py
  8. base_builders.py
  9. bisect_driver.py
  10. build.py
  11. builder_registry.py
  12. builders.py
  13. cherrypick_cl.py
  14. configs.py
  15. constants.py
  16. do_build.py
  17. do_kythe_xref.py
  18. do_test_compiler.py
  19. hosts.py
  20. kythe_xref.py
  21. mapfile.py
  22. merge_from_upstream.py
  23. MODULE_LICENSE_APACHE2
  24. MODULE_LICENSE_BSD_LIKE
  25. MODULE_LICENSE_MIT
  26. OWNERS
  27. paths.py
  28. PREUPLOAD.cfg
  29. py3_utils.py
  30. README.md
  31. source_manager.py
  32. test_compiler.py
  33. toolchains.py
  34. trim_patch_data.py
  35. update-binutils.py
  36. update-prebuilts.py
  37. update_kernel_toolchain.py
  38. utils.py
  39. version.py
  40. win_sdk.py
README.md

Android Clang/LLVM Toolchain

For the latest version of this doc, please make sure to visit: Android Clang/LLVM Toolchain Readme Doc

You can also visit the Android Clang/LLVM Prebuilts Readme Doc for more information about our prebuilt toolchains (and what versions they are based upon).

Build Instructions

$ mkdir llvm-toolchain && cd llvm-toolchain
$ repo init -u https://android.googlesource.com/platform/manifest -b llvm-toolchain
$ repo sync -c
$ python toolchain/llvm_android/build.py

If building on Linux, pass --no-build windows to build.py to skip building Clang for Windows.

If you have an additional llvm tree built and present in your $PATH, then build.py might fail during the Windows build of libcxxabi with the error 'libstdc++ version must be at least 4.8.'. The solution is to remove that path from your $PATH before invoking build.py.

Instructions to rebuild a particular toolchain release

To rebuild a particular toolchain, find the manifest file for that release:

$ $TOOLCHAIN_DIR/bin/clang -v
Android (6317467 based on r365631c1) clang version 9.0.8...

The build number for that toolchain is 6317467 and the manifest is found in $TOOLCHAIN_DIR/manifest_6317467.xml

Rebuild the toolchain with that manifest:

$ mkdir llvm-toolchain && cd llvm-toolchain
$ repo init -u https://android.googlesource.com/platform/manifest -b llvm-toolchain
$ cp $TOOLCHAIN_DIR/manifest_6317467.xml .repo/manifests
$ repo init -m manifest_6317467.xml
$ repo sync -c

# Optional: Apply any LLVM/Clang modifications to toolchain/llvm-project

$ python toolchain/llvm_android/build.py

More Information

We have a public mailing list that you can subscribe to: android-llvm@googlegroups.com