https://gcc.gnu.org/g:f8cab2ae987facf17539e3b4e8a9e26bad49130e
commit f8cab2ae987facf17539e3b4e8a9e26bad49130e Author: Yangyu Chen <c...@cyyself.name> Date: Thu Oct 31 16:31:24 2024 +0800 RISC-V: allow -fno-plt to disable PLT Currently, the RISC-V target uses the target specific mplt option to control PLT generation. This patch deprecates the target specific mplt option and uses the common fplt option instead. This allows users to use the same option for most targets. Co-Developed-by: Liao Shihua <shi...@iscas.ac.cn> Signed-off-by: Yangyu Chen <c...@cyyself.name> gcc/ChangeLog: * config/riscv/predicates.md: Use flag_plt instead of TARGET_PLT. * config/riscv/riscv.opt: alias common option fplt to mplt. (cherry picked from commit 1f7b1c555c66cf55f9032ea14135f29d27d34811) Diff: --- gcc/config/riscv/predicates.md | 2 +- gcc/config/riscv/riscv.opt | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/gcc/config/riscv/predicates.md b/gcc/config/riscv/predicates.md index 9971fabc5873..55bcfa4fa4f1 100644 --- a/gcc/config/riscv/predicates.md +++ b/gcc/config/riscv/predicates.md @@ -329,7 +329,7 @@ { enum riscv_symbol_type type; return (riscv_symbolic_constant_p (op, &type) - && type == SYMBOL_GOT_DISP && !SYMBOL_REF_WEAK (op) && TARGET_PLT); + && type == SYMBOL_GOT_DISP && !SYMBOL_REF_WEAK (op) && flag_plt); }) (define_predicate "call_insn_operand" diff --git a/gcc/config/riscv/riscv.opt b/gcc/config/riscv/riscv.opt index 6360ed3984d0..5bc5d3002934 100644 --- a/gcc/config/riscv/riscv.opt +++ b/gcc/config/riscv/riscv.opt @@ -34,8 +34,8 @@ Target RejectNegative Joined UInteger Var(riscv_branch_cost) -mbranch-cost=N Set the cost of branches to roughly N instructions. mplt -Target Var(TARGET_PLT) Init(1) -When generating -fpic code, allow the use of PLTs. Ignored for fno-pic. +Target Alias(fplt) +This option is deprecated; use -fplt or -fno-plt instead. mabi= Target RejectNegative Joined Enum(abi_type) Var(riscv_abi) Init(ABI_ILP32) Negative(mabi=)