Allow cc_object to use libc headers under the VNDK
Bionic headers aren't implicit when building with the VNDK, they're exported from libc. So add libc to the shared libraries of a cc_object if it wants the standard flags. Removes a duplicate No_default_compiler_flags Test: Add cc_object with vendor_available, build on aosp_arm64_ab (VNDK-enabled) Change-Id: I9bfcd1e1a65de4edc597bd348b79d625ecae4f5e
This commit is contained in:
@@ -43,10 +43,6 @@ type BaseLinkerProperties struct {
|
||||
// list of module-specific flags that will be used for all link steps
|
||||
Ldflags []string `android:"arch_variant"`
|
||||
|
||||
// don't insert default compiler flags into asflags, cflags,
|
||||
// cppflags, conlyflags, ldflags, or include_dirs
|
||||
No_default_compiler_flags *bool
|
||||
|
||||
// list of system libraries that will be dynamically linked to
|
||||
// shared library and executable modules. If unset, generally defaults to libc,
|
||||
// libm, and libdl. Set to [] to prevent linking against the defaults.
|
||||
|
@@ -53,6 +53,11 @@ func (object *objectLinker) linkerProps() []interface{} {
|
||||
func (*objectLinker) linkerInit(ctx BaseModuleContext) {}
|
||||
|
||||
func (object *objectLinker) linkerDeps(ctx DepsContext, deps Deps) Deps {
|
||||
if !ctx.noDefaultCompilerFlags() && ctx.toolchain().Bionic() {
|
||||
// Needed for VNDK builds where bionic headers aren't automatically added.
|
||||
deps.LateSharedLibs = append(deps.LateSharedLibs, "libc")
|
||||
}
|
||||
|
||||
deps.ObjFiles = append(deps.ObjFiles, object.Properties.Objs...)
|
||||
return deps
|
||||
}
|
||||
|
Reference in New Issue
Block a user