Ensure hermetic device rust_bindgen.

rust_bindgen was not hermetic previously as it would pull in host
headers for device targets. This fixes that by using the same flags we
use when compiling with Clang. This also makes sure our rust_bindgen
headers are built as similar as possible to their respective
cc_libraries.

This also pulls in the bionic dependencies as well, which provide the
headers required for device targets.

Bug: 162007475
Test: device rust_bindgen deps file does not reference host headers.

Change-Id: I4efdf333e011a6c6d73a0345e5485823f166d17a
This commit is contained in:
Ivan Lozano
2020-07-24 16:05:01 -04:00
parent e1e844b83c
commit 45901edb9a
7 changed files with 57 additions and 36 deletions

View File

@@ -33,7 +33,7 @@ type baseSourceProvider struct {
var _ SourceProvider = (*baseSourceProvider)(nil)
type SourceProvider interface {
generateSource(ctx android.ModuleContext) android.Path
generateSource(ctx android.ModuleContext, deps PathDeps) android.Path
Srcs() android.Paths
sourceProviderProps() []interface{}
sourceProviderDeps(ctx DepsContext, deps Deps) Deps
@@ -43,7 +43,7 @@ func (sp *baseSourceProvider) Srcs() android.Paths {
return android.Paths{sp.outputFile}
}
func (sp *baseSourceProvider) generateSource(ctx android.ModuleContext) android.Path {
func (sp *baseSourceProvider) generateSource(ctx android.ModuleContext, deps PathDeps) android.Path {
panic("baseSourceProviderModule does not implement generateSource()")
}