Support building for Fuchsia.

This CL adds configs for the arm64 and x64 fuchsia
device targets, sets up the necessary linker flags,
and disables some functionality that is not currently
supported on Fuchsia.

Bug: 119831161
Test: Compile walleye, internal validation against
fuchsia_arm64-eng and fuchsia_x86_64-eng.
Change-Id: I2881b99d2e3a1995e2d8c00a2d86ee101a972c94
This commit is contained in:
Doug Horn
2019-01-17 14:44:05 -08:00
parent 590b1ae37c
commit c32c6b0d79
11 changed files with 393 additions and 33 deletions

View File

@@ -91,6 +91,26 @@ func (stl *stl) begin(ctx BaseModuleContext) {
ctx.ModuleErrorf("stl: %q is not a supported STL for windows", s)
return ""
}
} else if ctx.Fuchsia() {
switch s {
case "c++_static":
return "libc++_static"
case "c++_shared":
return "libc++"
case "libc++", "libc++_static":
return s
case "none":
return ""
case "":
if ctx.static() {
return "libc++_static"
} else {
return "libc++"
}
default:
ctx.ModuleErrorf("stl: %q is not a supported STL on Fuchsia", s)
return ""
}
} else {
switch s {
case "libc++", "libc++_static":
@@ -248,8 +268,9 @@ var hostDynamicGccLibs, hostStaticGccLibs map[android.OsType][]string
func init() {
hostDynamicGccLibs = map[android.OsType][]string{
android.Linux: []string{"-lgcc_s", "-lgcc", "-lc", "-lgcc_s", "-lgcc"},
android.Darwin: []string{"-lc", "-lSystem"},
android.Fuchsia: []string{"-lc", "-lunwind"},
android.Linux: []string{"-lgcc_s", "-lgcc", "-lc", "-lgcc_s", "-lgcc"},
android.Darwin: []string{"-lc", "-lSystem"},
android.Windows: []string{"-Wl,--start-group", "-lmingw32", "-lgcc", "-lgcc_eh",
"-lmoldname", "-lmingwex", "-lmsvcrt", "-lucrt", "-lpthread",
"-ladvapi32", "-lshell32", "-luser32", "-lkernel32", "-lpsapi",