Add cc_prebuilt_object.

To be used for prebuilt object support in SDK snapshots.

Test: m nothing
Bug: 148934017
Change-Id: I53d58100cc1d410c5cf5b7906de7ed6f7add2035
This commit is contained in:
Martin Stjernholm
2020-03-11 21:45:49 +00:00
parent 2812418eac
commit 0b92ac8e43
3 changed files with 70 additions and 3 deletions

View File

@@ -47,12 +47,18 @@ type ObjectLinkerProperties struct {
Linker_script *string `android:"path,arch_variant"`
}
func newObject() *Module {
module := newBaseModule(android.HostAndDeviceSupported, android.MultilibBoth)
module.sanitize = &sanitize{}
module.stl = &stl{}
return module
}
// cc_object runs the compiler without running the linker. It is rarely
// necessary, but sometimes used to generate .s files from .c files to use as
// input to a cc_genrule module.
func ObjectFactory() android.Module {
module := newBaseModule(android.HostAndDeviceSupported, android.MultilibBoth)
module.sanitize = &sanitize{}
module := newObject()
module.linker = &objectLinker{
baseLinker: NewBaseLinker(module.sanitize),
}
@@ -61,7 +67,6 @@ func ObjectFactory() android.Module {
// Clang's address-significance tables are incompatible with ld -r.
module.compiler.appendCflags([]string{"-fno-addrsig"})
module.stl = &stl{}
return module.Init()
}