Add AArch64 device Rust toolchain.

Bug: 141207434
Test: build example rust device module.
Change-Id: I0932a614942bf4a4d4b6c153fcc4fc79c7f202bd
This commit is contained in:
Ivan Lozano
2019-09-20 11:00:37 -07:00
parent 5ca5ef6788
commit f1c8433b40
12 changed files with 221 additions and 16 deletions

View File

@@ -15,6 +15,8 @@
package config
import (
"strings"
"android/soong/android"
_ "android/soong/cc/config"
)
@@ -30,6 +32,24 @@ var (
"libterm",
"libtest",
}
deviceGlobalRustFlags = []string{}
deviceGlobalLinkFlags = []string{
"-Bdynamic",
"-nostdlib",
"-Wl,-z,noexecstack",
"-Wl,-z,relro",
"-Wl,-z,now",
"-Wl,--build-id=md5",
"-Wl,--warn-shared-textrel",
"-Wl,--fatal-warnings",
"-Wl,--pack-dyn-relocs=android+relr",
"-Wl,--use-android-relr-tags",
"-Wl,--no-undefined",
"-Wl,--hash-style=gnu",
}
)
func init() {
@@ -56,4 +76,7 @@ func init() {
pctx.ImportAs("ccConfig", "android/soong/cc/config")
pctx.StaticVariable("RustLinker", "${ccConfig.ClangBin}/clang++")
pctx.StaticVariable("RustLinkerArgs", "-B ${ccConfig.ClangBin} -fuse-ld=lld")
pctx.StaticVariable("DeviceGlobalLinkFlags", strings.Join(deviceGlobalLinkFlags, " "))
}