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

Commit 655be5db authored by Colin Cross's avatar Colin Cross Committed by Automerger Merge Worker
Browse files

Merge "Use single module for clang runtime libraries" into sc-v2-dev-plus-aosp am: 135513ae

Original change: https://googleplex-android-review.googlesource.com/c/platform/build/soong/+/17036885

Change-Id: I72d5cdd315cad007f6f6a1a1a91f8ca272014f9c
parents d1a81a9a 135513ae
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