@@ -3605,7 +3605,8 @@ static void RenderSSPOptions(const Driver &D, const ToolChain &TC,
36053605 StringRef Value = A->getValue ();
36063606 if (!EffectiveTriple.isX86 () && !EffectiveTriple.isAArch64 () &&
36073607 !EffectiveTriple.isARM () && !EffectiveTriple.isThumb () &&
3608- !EffectiveTriple.isRISCV ())
3608+ !EffectiveTriple.isRISCV () && !EffectiveTriple.isPPC64 () &&
3609+ !EffectiveTriple.isPPC32 ())
36093610 D.Diag (diag::err_drv_unsupported_opt_for_target)
36103611 << A->getAsString (Args) << TripleStr;
36113612 if ((EffectiveTriple.isX86 () || EffectiveTriple.isARM () ||
@@ -3645,7 +3646,8 @@ static void RenderSSPOptions(const Driver &D, const ToolChain &TC,
36453646 << A->getOption ().getName () << Value << " sysreg global" ;
36463647 return ;
36473648 }
3648- if (EffectiveTriple.isRISCV ()) {
3649+ if (EffectiveTriple.isRISCV () || EffectiveTriple.isPPC64 () ||
3650+ EffectiveTriple.isPPC32 ()) {
36493651 if (Value != " tls" && Value != " global" ) {
36503652 D.Diag (diag::err_drv_invalid_value_with_suggestion)
36513653 << A->getOption ().getName () << Value << " tls global" ;
@@ -3666,7 +3668,8 @@ static void RenderSSPOptions(const Driver &D, const ToolChain &TC,
36663668 StringRef Value = A->getValue ();
36673669 if (!EffectiveTriple.isX86 () && !EffectiveTriple.isAArch64 () &&
36683670 !EffectiveTriple.isARM () && !EffectiveTriple.isThumb () &&
3669- !EffectiveTriple.isRISCV ())
3671+ !EffectiveTriple.isRISCV () && !EffectiveTriple.isPPC64 () &&
3672+ !EffectiveTriple.isPPC32 ())
36703673 D.Diag (diag::err_drv_unsupported_opt_for_target)
36713674 << A->getAsString (Args) << TripleStr;
36723675 int Offset;
@@ -3686,7 +3689,8 @@ static void RenderSSPOptions(const Driver &D, const ToolChain &TC,
36863689 if (Arg *A = Args.getLastArg (options::OPT_mstack_protector_guard_reg_EQ)) {
36873690 StringRef Value = A->getValue ();
36883691 if (!EffectiveTriple.isX86 () && !EffectiveTriple.isAArch64 () &&
3689- !EffectiveTriple.isRISCV ())
3692+ !EffectiveTriple.isRISCV () && !EffectiveTriple.isPPC64 () &&
3693+ !EffectiveTriple.isPPC32 ())
36903694 D.Diag (diag::err_drv_unsupported_opt_for_target)
36913695 << A->getAsString (Args) << TripleStr;
36923696 if (EffectiveTriple.isX86 () && (Value != " fs" && Value != " gs" )) {
@@ -3703,6 +3707,16 @@ static void RenderSSPOptions(const Driver &D, const ToolChain &TC,
37033707 << A->getOption ().getName () << Value << " tp" ;
37043708 return ;
37053709 }
3710+ if (EffectiveTriple.isPPC64 () && Value != " r13" ) {
3711+ D.Diag (diag::err_drv_invalid_value_with_suggestion)
3712+ << A->getOption ().getName () << Value << " r13" ;
3713+ return ;
3714+ }
3715+ if (EffectiveTriple.isPPC32 () && Value != " r2" ) {
3716+ D.Diag (diag::err_drv_invalid_value_with_suggestion)
3717+ << A->getOption ().getName () << Value << " r2" ;
3718+ return ;
3719+ }
37063720 A->render (Args, CmdArgs);
37073721 }
37083722
0 commit comments