aboutsummaryrefslogtreecommitdiff
path: root/soong
diff options
context:
space:
mode:
authorColin Cross <ccross@android.com>2021-06-25 16:38:48 -0700
committerColin Cross <ccross@android.com>2021-06-25 16:38:48 -0700
commitf771b7824f62d21c534f897a520d805a93d44c77 (patch)
treea3f1ea4764bb3808977ea1fc9ac7b184e66f3ebb /soong
parent7e54369514a41c9475ff66861cd214167766d370 (diff)
downloadlinux-x86-f771b7824f62d21c534f897a520d805a93d44c77.tar.gz
Add clang_rt.crt* modules
Add the clang_rt.crt* modules for use by musl libc so it doesn't depend on the gcc ones. Bug: 190084016 Test: m checkbuild Change-Id: I10c207f2762a48b3752b76c050b99498add2c7d2
Diffstat (limited to 'soong')
-rw-r--r--soong/clangprebuilts.go54
1 files changed, 44 insertions, 10 deletions
diff --git a/soong/clangprebuilts.go b/soong/clangprebuilts.go
index 2b8c5de61..26a0f8d55 100644
--- a/soong/clangprebuilts.go
+++ b/soong/clangprebuilts.go
@@ -61,6 +61,8 @@ func init() {
libClangRtPrebuiltLibrarySharedFactory)
android.RegisterModuleType("libclang_rt_prebuilt_library_static",
libClangRtPrebuiltLibraryStaticFactory)
+ android.RegisterModuleType("libclang_rt_prebuilt_object",
+ libClangRtPrebuiltObjectFactory)
android.RegisterModuleType("llvm_darwin_filegroup",
llvmDarwinFileGroupFactory)
android.RegisterModuleType("clang_builtin_headers",
@@ -225,10 +227,10 @@ func libClangRtPrebuiltLibraryShared(ctx android.LoadHookContext, in *prebuiltLi
libDir := getClangResourceDir(ctx)
type props struct {
- Srcs []string
- System_shared_libs []string
- No_libcrt *bool
- Sanitize struct {
+ Srcs []string
+ Default_shared_libs []string
+ No_libcrt *bool
+ Sanitize struct {
Never *bool
}
Strip struct {
@@ -250,7 +252,7 @@ func libClangRtPrebuiltLibraryShared(ctx android.LoadHookContext, in *prebuiltLi
name := strings.TrimPrefix(ctx.ModuleName(), "prebuilt_")
p.Srcs = []string{path.Join(libDir, name+".so")}
- p.System_shared_libs = []string{}
+ p.Default_shared_libs = []string{}
p.No_libcrt = proptools.BoolPtr(true)
p.Sanitize.Never = proptools.BoolPtr(true)
p.Strip.None = proptools.BoolPtr(true)
@@ -271,10 +273,10 @@ func libClangRtPrebuiltLibraryStatic(ctx android.LoadHookContext) {
libDir := getClangResourceDir(ctx)
type props struct {
- Srcs []string
- System_shared_libs []string
- No_libcrt *bool
- Stl *string
+ Srcs []string
+ Default_shared_libs []string
+ No_libcrt *bool
+ Stl *string
}
name := strings.TrimPrefix(ctx.ModuleName(), "prebuilt_")
@@ -285,12 +287,38 @@ func libClangRtPrebuiltLibraryStatic(ctx android.LoadHookContext) {
} else {
p.Srcs = []string{path.Join(libDir, name+".a")}
}
- p.System_shared_libs = []string{}
+ p.Default_shared_libs = []string{}
p.No_libcrt = proptools.BoolPtr(true)
p.Stl = proptools.StringPtr("none")
ctx.AppendProperties(p)
}
+func libClangRtPrebuiltObject(ctx android.LoadHookContext) {
+ libDir := getClangResourceDir(ctx)
+
+ type props struct {
+ Arch struct {
+ X86 struct {
+ Srcs []string
+ }
+ X86_64 struct {
+ Srcs []string
+ }
+ }
+ Default_shared_libs []string
+ Stl *string
+ }
+
+ name := strings.TrimPrefix(ctx.ModuleName(), "prebuilt_")
+
+ p := &props{}
+ p.Arch.X86.Srcs = []string{path.Join(libDir, name+"-i386.o")}
+ p.Arch.X86_64.Srcs = []string{path.Join(libDir, name+"-x86_64.o")}
+ p.Default_shared_libs = []string{}
+ p.Stl = proptools.StringPtr("none")
+ ctx.AppendProperties(p)
+}
+
func llvmDarwinFileGroup(ctx android.LoadHookContext) {
clangDir := getClangPrebuiltDir(ctx)
libName := strings.TrimSuffix(ctx.ModuleName(), "_darwin")
@@ -341,6 +369,12 @@ func libClangRtPrebuiltLibraryStaticFactory() android.Module {
return module.Init()
}
+func libClangRtPrebuiltObjectFactory() android.Module {
+ module := cc.NewPrebuiltObject(android.HostAndDeviceSupported)
+ android.AddLoadHook(module, libClangRtPrebuiltObject)
+ return module.Init()
+}
+
func llvmDarwinFileGroupFactory() android.Module {
module := android.FileGroupFactory()
android.AddLoadHook(module, llvmDarwinFileGroup)