aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2019-06-10 19:40:13 +0000
committerandroid-build-team Robot <android-build-team-robot@google.com>2019-06-10 19:40:13 +0000
commit76b23d6c8b3127b90f18fad15bdca5ca1ccab4e3 (patch)
tree84c94cb868dbba1d94ad6bc93613f93edf560135
parentd2358da67980413355f959a206f87442c7e99bcb (diff)
parent17226f7da5ad71e2d992733045c6d93925b47856 (diff)
downloadlinux-x86-android10-c2f2-s1-release.tar.gz
Change-Id: If6ce2d86865574f6f6ac43c7357e455b38b29f48
-rw-r--r--Android.bp5
-rw-r--r--soong/clangprebuilts.go40
2 files changed, 35 insertions, 10 deletions
diff --git a/Android.bp b/Android.bp
index e453d7529..826fbd2e5 100644
--- a/Android.bp
+++ b/Android.bp
@@ -111,6 +111,7 @@ libclang_rt_prebuilt_library_shared {
},
},
check_elf_files: false, // Bypass circular dependency between libc++
+ has_stubs: true,
}
libclang_rt_prebuilt_library_shared {
@@ -124,6 +125,7 @@ libclang_rt_prebuilt_library_shared {
},
},
check_elf_files: false, // Bypass circular dependency between libc++
+ has_stubs: true,
}
libclang_rt_prebuilt_library_shared {
@@ -137,6 +139,7 @@ libclang_rt_prebuilt_library_shared {
},
},
check_elf_files: false, // Bypass circular dependency between libc++
+ has_stubs: true,
}
libclang_rt_prebuilt_library_shared {
@@ -156,6 +159,7 @@ libclang_rt_prebuilt_library_shared {
},
},
check_elf_files: false, // Bypass circular dependency between libc++
+ has_stubs: true,
}
libclang_rt_llndk_library {
@@ -364,6 +368,7 @@ libclang_rt_prebuilt_library_shared {
},
},
check_elf_files: false, // Bypass circular dependency between libc++
+ has_stubs: true,
}
libclang_rt_prebuilt_library_static {
diff --git a/soong/clangprebuilts.go b/soong/clangprebuilts.go
index a802c239b..86af1c73f 100644
--- a/soong/clangprebuilts.go
+++ b/soong/clangprebuilts.go
@@ -72,6 +72,11 @@ func getClangResourceDir(ctx android.LoadHookContext) string {
return path.Join(clangDir, "lib64", "clang", releaseVersion, "lib", "linux")
}
+func getSymbolFilePath(ctx android.LoadHookContext) string {
+ libDir := getClangResourceDir(ctx)
+ return path.Join(libDir, strings.TrimSuffix(ctx.ModuleName(), ".llndk")+".map.txt")
+}
+
func trimVersionNumbers(ver string, retain int) string {
sep := "."
versions := strings.Split(ver, sep)
@@ -182,7 +187,11 @@ func llvmPrebuiltLibraryStatic(ctx android.LoadHookContext) {
ctx.AppendProperties(p)
}
-func libClangRtPrebuiltLibraryShared(ctx android.LoadHookContext) {
+type prebuiltLibrarySharedProps struct {
+ Has_stubs *bool
+}
+
+func libClangRtPrebuiltLibraryShared(ctx android.LoadHookContext, in *prebuiltLibrarySharedProps) {
if ctx.AConfig().IsEnvTrue("FORCE_BUILD_SANITIZER_SHARED_OBJECTS") {
return
}
@@ -202,6 +211,10 @@ func libClangRtPrebuiltLibraryShared(ctx android.LoadHookContext) {
}
Pack_relocations *bool
Stl *string
+ Stubs struct {
+ Symbol_file *string
+ Versions []string
+ }
}
p := &props{}
@@ -217,6 +230,12 @@ func libClangRtPrebuiltLibraryShared(ctx android.LoadHookContext) {
disable := false
p.Pack_relocations = &disable
p.Stl = proptools.StringPtr("none")
+
+ if proptools.Bool(in.Has_stubs) {
+ p.Stubs.Versions = []string{"10000"}
+ p.Stubs.Symbol_file = proptools.StringPtr(getSymbolFilePath(ctx))
+ }
+
ctx.AppendProperties(p)
}
@@ -224,11 +243,11 @@ func libClangRtPrebuiltLibraryStatic(ctx android.LoadHookContext) {
libDir := getClangResourceDir(ctx)
type props struct {
- Srcs []string
+ Srcs []string
System_shared_libs []string
- No_libcrt *bool
- No_libgcc *bool
- Stl *string
+ No_libcrt *bool
+ No_libgcc *bool
+ Stl *string
}
name := strings.TrimPrefix(ctx.ModuleName(), "prebuilt_")
@@ -247,15 +266,12 @@ func libClangRtPrebuiltLibraryStatic(ctx android.LoadHookContext) {
}
func libClangRtLLndkLibrary(ctx android.LoadHookContext) {
- libDir := getClangResourceDir(ctx)
-
type props struct {
Symbol_file *string
}
p := &props{}
- symbol_file := string(path.Join(libDir, strings.TrimSuffix(ctx.ModuleName(), ".llndk")+".map.txt"))
- p.Symbol_file = proptools.StringPtr(symbol_file)
+ p.Symbol_file = proptools.StringPtr(getSymbolFilePath(ctx))
ctx.AppendProperties(p)
}
@@ -293,7 +309,11 @@ func llvmHostPrebuiltLibrarySharedFactory() android.Module {
func libClangRtPrebuiltLibrarySharedFactory() android.Module {
module, _ := cc.NewPrebuiltSharedLibrary(android.HostAndDeviceSupported)
- android.AddLoadHook(module, libClangRtPrebuiltLibraryShared)
+ props := &prebuiltLibrarySharedProps{}
+ module.AddProperties(props)
+ android.AddLoadHook(module, func(ctx android.LoadHookContext) {
+ libClangRtPrebuiltLibraryShared(ctx, props)
+ })
return module.Init()
}