[RISCV] Default to -ffixed-x18 for Fuchsia
authorRoland McGrath <mcgrathr@google.com>
Mon, 6 Feb 2023 02:29:55 +0000 (18:29 -0800)
committerRoland McGrath <mcgrathr@google.com>
Mon, 6 Feb 2023 02:51:18 +0000 (18:51 -0800)
commit03ff435da540b0feb8272784e05ce742831d5bc2
treea16a7b8565263e9bdf7ca15a9bd82b3a7ce8ace2
parent34b21e817f19cebad4e0ae770b5d8ca4fd0ff21b
[RISCV] Default to -ffixed-x18 for Fuchsia

Fuchsia's ABI always reserves the x18 (s2) register for the
ShadowCallStack ABI, even when -fsanitize=shadow-call-stack is
not enabled.

Reviewed By: phosek

Differential Revision: https://reviews.llvm.org/D143355
clang/lib/Driver/SanitizerArgs.cpp
clang/test/Driver/sanitizer-ld.c
llvm/include/llvm/TargetParser/RISCVTargetParser.h
llvm/lib/Target/RISCV/RISCVSubtarget.cpp
llvm/lib/TargetParser/RISCVTargetParser.cpp
llvm/test/CodeGen/RISCV/reserved-regs.ll