aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTreehugger Robot <android-test-infra-autosubmit@system.gserviceaccount.com>2024-04-10 23:09:10 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2024-04-10 23:09:10 +0000
commit4562abcce689870a26f79e884e585faf99100339 (patch)
treefd0adc4fe36a14ef4969c2cbffdfd30988a3254b
parentf41dd0c52791f69faea48f26fb3b00cf9a938d4b (diff)
parentc2a6900904efb8840a150751900b634f9cb41abd (diff)
downloadndk-4562abcce689870a26f79e884e585faf99100339.tar.gz
Merge "Remove superfluous libraries." into main
-rw-r--r--docs/changelogs/Changelog-r27.md2
-rwxr-xr-xndk/checkbuild.py22
2 files changed, 17 insertions, 7 deletions
diff --git a/docs/changelogs/Changelog-r27.md b/docs/changelogs/Changelog-r27.md
index 5ed2f964f..d7af2fa3e 100644
--- a/docs/changelogs/Changelog-r27.md
+++ b/docs/changelogs/Changelog-r27.md
@@ -65,6 +65,8 @@ directly, see the [build system maintainers guide].
should consult the [build system maintainers guide].
* Symlinks are now properly preserved in the macOS App Bundle. The NDK installed
via that method is now the same size as the one installed via the SDK manager.
+* The unsupported libclang, libclang-cpp, libLLVM, and libLTO libraries were
+ removed to save space.
[Issue 1728]: https://github.com/android/ndk/issues/1728
[Issue 1853]: https://github.com/android/ndk/issues/1853
diff --git a/ndk/checkbuild.py b/ndk/checkbuild.py
index c6fc7beb5..c3ac9b979 100755
--- a/ndk/checkbuild.py
+++ b/ndk/checkbuild.py
@@ -577,15 +577,23 @@ class Clang(ndk.builds.Module):
continue
if file.name == "lldb-server":
subprocess.check_call([str(strip_cmd), str(file)])
- if (
- file.name.startswith("libLLVM.")
- or file.name.startswith("libclang.")
- or file.name.startswith("libclang-cpp.")
- or file.name.startswith("libLTO.")
- or file.name.startswith("liblldb.")
- ):
+ if file.name.startswith("libLTO.") or file.name.startswith("liblldb."):
subprocess.check_call([str(strip_cmd), "--strip-unneeded", str(file)])
+ # These exist for plugin support and library use, but neither of those
+ # are supported workflows for the NDK, so they're just dead weight.
+ #
+ # They don't exist on Windows though.
+ if self.host is not Host.Windows64:
+ lib_ext = ".dylib" if self.host is Host.Darwin else ".so"
+ (install_path / "lib" / "libclang").with_suffix(lib_ext).unlink()
+ (install_path / "lib" / "libclang-cpp").with_suffix(lib_ext).unlink()
+ (install_path / "lib" / "libLLVM").with_suffix(lib_ext).unlink()
+ (install_path / "lib" / "libLTO").with_suffix(lib_ext).unlink()
+ if self.host is Host.Linux:
+ for library in (install_path / "lib").glob("libLLVM-*"):
+ library.unlink()
+
for lib in (install_path / "lib").iterdir():
broken_symlinks = {
"libc++abi.so.1.0",