diff options
| author | 2022-10-20 13:55:53 -0700 | |
|---|---|---|
| committer | 2022-10-20 14:31:24 -0700 | |
| commit | 2c435a00ff73dc485855824ee49d2dec1a01e592 (patch) | |
| tree | f153ec62fc52307cf1bf57c5e97a6639c01ea563 | |
| parent | ecf4e664e060597c6f66654c08787d4cd3262d30 (diff) | |
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
| -rw-r--r-- | cc/config/riscv64_device.go | 1 | ||||
| -rw-r--r-- | cc/lto.go | 2 | ||||
| -rw-r--r-- | cc/sanitize.go | 2 |
3 files changed, 3 insertions, 2 deletions
diff --git a/cc/config/riscv64_device.go b/cc/config/riscv64_device.go index d8918f164..825be7fac 100644 --- a/cc/config/riscv64_device.go +++ b/cc/config/riscv64_device.go @@ -25,6 +25,7 @@ var ( riscv64Cflags = []string{ // Help catch common 32/64-bit errors. "-Werror=implicit-function-declaration", + "-fno-emulated-tls", } riscv64ArchVariantCflags = map[string][]string{} @@ -91,7 +91,7 @@ func (lto *lto) flags(ctx BaseModuleContext, flags Flags) 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 { return flags } diff --git a/cc/sanitize.go b/cc/sanitize.go index d39b0eb47..b8cc432c5 100644 --- a/cc/sanitize.go +++ b/cc/sanitize.go @@ -511,7 +511,7 @@ func (sanitize *sanitize) begin(ctx BaseModuleContext) { 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 { s.Cfi = nil s.Diag.Cfi = nil |