Set -fno-emulated-tls for riscv64
Building for riscv64 fails with link errors on __thread variables. Set -fno-emulated-tls to fix it. Bug: 254713216 Test: lunch aosp_riscv64-userdebug && m ALLOW_MISSING_DEPENDENCIES=true ndk_sysroot Change-Id: I3dca81dfd277d681b6c868a5e8385e3a37335a5f
This commit is contained in:
@@ -25,6 +25,7 @@ var (
|
|||||||
riscv64Cflags = []string{
|
riscv64Cflags = []string{
|
||||||
// Help catch common 32/64-bit errors.
|
// Help catch common 32/64-bit errors.
|
||||||
"-Werror=implicit-function-declaration",
|
"-Werror=implicit-function-declaration",
|
||||||
|
"-fno-emulated-tls",
|
||||||
}
|
}
|
||||||
|
|
||||||
riscv64ArchVariantCflags = map[string][]string{}
|
riscv64ArchVariantCflags = map[string][]string{}
|
||||||
|
@@ -91,7 +91,7 @@ func (lto *lto) flags(ctx BaseModuleContext, flags Flags) Flags {
|
|||||||
return flags
|
return flags
|
||||||
}
|
}
|
||||||
|
|
||||||
// LTO doesn't work on riscv64 yet.
|
// TODO(b/254713216): LTO doesn't work on riscv64 yet.
|
||||||
if ctx.Arch().ArchType == android.Riscv64 {
|
if ctx.Arch().ArchType == android.Riscv64 {
|
||||||
return flags
|
return flags
|
||||||
}
|
}
|
||||||
|
@@ -511,7 +511,7 @@ func (sanitize *sanitize) begin(ctx BaseModuleContext) {
|
|||||||
s.Integer_overflow = nil
|
s.Integer_overflow = nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// CFI doesn't work for riscv64 yet because LTO doesn't work.
|
// TODO(b/254713216): CFI doesn't work for riscv64 yet because LTO doesn't work.
|
||||||
if ctx.Arch().ArchType == android.Riscv64 {
|
if ctx.Arch().ArchType == android.Riscv64 {
|
||||||
s.Cfi = nil
|
s.Cfi = nil
|
||||||
s.Diag.Cfi = nil
|
s.Diag.Cfi = nil
|
||||||
|
Reference in New Issue
Block a user