Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5d23bc28 authored by Colin Cross's avatar Colin Cross Committed by Colin Cross
Browse files

Use single module for clang runtime libraries

The clang prebuilts now provide a single module with per-architecture
variants instead of a module per architecture.

Bug: 220019988
Test: m checkbuild
(cherry picked from commit 386ee59a)
Merged-In: I39e2cf8ae14edf8510276dab38011afaef85822c
Change-Id: I3e579002d6509e9e3ef214e007b62260cbeb438c
parents 1a62a36c fc0df95d
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1415,7 +1415,7 @@ func (a *apexBundle) AddSanitizerDependencies(ctx android.BottomUpMutatorContext
		for _, target := range ctx.MultiTargets() {
			if target.Arch.ArchType.Multilib == "lib64" {
				addDependenciesForNativeModules(ctx, ApexNativeDependencies{
					Native_shared_libs: []string{"libclang_rt.hwasan-aarch64-android"},
					Native_shared_libs: []string{"libclang_rt.hwasan"},
					Tests:              nil,
					Jni_libs:           nil,
					Binaries:           nil,
+6 −4
Original line number Diff line number Diff line
@@ -1415,13 +1415,14 @@ func TestRuntimeApexShouldInstallHwasanIfLibcDependsOnIt(t *testing.T) {
		}

		cc_prebuilt_library_shared {
			name: "libclang_rt.hwasan-aarch64-android",
			name: "libclang_rt.hwasan",
			no_libcrt: true,
			nocrt: true,
			stl: "none",
			system_shared_libs: [],
			srcs: [""],
			stubs: { versions: ["1"] },
			stem: "libclang_rt.hwasan-aarch64-android",

			sanitize: {
				never: true,
@@ -1434,7 +1435,7 @@ func TestRuntimeApexShouldInstallHwasanIfLibcDependsOnIt(t *testing.T) {
		"lib64/bionic/libclang_rt.hwasan-aarch64-android.so",
	})

	hwasan := ctx.ModuleForTests("libclang_rt.hwasan-aarch64-android", "android_arm64_armv8-a_shared")
	hwasan := ctx.ModuleForTests("libclang_rt.hwasan", "android_arm64_armv8-a_shared")

	installed := hwasan.Description("install libclang_rt.hwasan")
	ensureContains(t, installed.Output.String(), "/system/lib64/bootstrap/libclang_rt.hwasan-aarch64-android.so")
@@ -1462,13 +1463,14 @@ func TestRuntimeApexShouldInstallHwasanIfHwaddressSanitized(t *testing.T) {
		}

		cc_prebuilt_library_shared {
			name: "libclang_rt.hwasan-aarch64-android",
			name: "libclang_rt.hwasan",
			no_libcrt: true,
			nocrt: true,
			stl: "none",
			system_shared_libs: [],
			srcs: [""],
			stubs: { versions: ["1"] },
			stem: "libclang_rt.hwasan-aarch64-android",

			sanitize: {
				never: true,
@@ -1482,7 +1484,7 @@ func TestRuntimeApexShouldInstallHwasanIfHwaddressSanitized(t *testing.T) {
		"lib64/bionic/libclang_rt.hwasan-aarch64-android.so",
	})

	hwasan := ctx.ModuleForTests("libclang_rt.hwasan-aarch64-android", "android_arm64_armv8-a_shared")
	hwasan := ctx.ModuleForTests("libclang_rt.hwasan", "android_arm64_armv8-a_shared")

	installed := hwasan.Description("install libclang_rt.hwasan")
	ensureContains(t, installed.Output.String(), "/system/lib64/bootstrap/libclang_rt.hwasan-aarch64-android.so")
+1 −1
Original line number Diff line number Diff line
@@ -1383,7 +1383,7 @@ func isBionic(name string) bool {
}

func InstallToBootstrap(name string, config android.Config) bool {
	if name == "libclang_rt.hwasan-aarch64-android" {
	if name == "libclang_rt.hwasan" {
		return true
	}
	return isBionic(name)
+2 −2
Original line number Diff line number Diff line
@@ -2944,13 +2944,13 @@ func TestStaticLibDepExport(t *testing.T) {
	// Check the shared version of lib2.
	variant := "android_arm64_armv8-a_shared"
	module := ctx.ModuleForTests("lib2", variant).Module().(*Module)
	checkStaticLibs(t, []string{"lib1", "libc++demangle", "libclang_rt.builtins-aarch64-android"}, module)
	checkStaticLibs(t, []string{"lib1", "libc++demangle", "libclang_rt.builtins"}, module)

	// Check the static version of lib2.
	variant = "android_arm64_armv8-a_static"
	module = ctx.ModuleForTests("lib2", variant).Module().(*Module)
	// libc++_static is linked additionally.
	checkStaticLibs(t, []string{"lib1", "libc++_static", "libc++demangle", "libclang_rt.builtins-aarch64-android"}, module)
	checkStaticLibs(t, []string{"lib1", "libc++_static", "libc++demangle", "libclang_rt.builtins"}, module)
}

var compilerFlagsTestCases = []struct {
+1 −8
Original line number Diff line number Diff line
@@ -227,14 +227,7 @@ func addPrefix(list []string, prefix string) []string {
}

func LibclangRuntimeLibrary(t Toolchain, library string) string {
	arch := t.LibclangRuntimeLibraryArch()
	if arch == "" {
		return ""
	}
	if !t.Bionic() {
		return "libclang_rt." + library + "-" + arch
	}
	return "libclang_rt." + library + "-" + arch + "-android"
	return "libclang_rt." + library
}

func BuiltinsRuntimeLibrary(t Toolchain) string {
Loading