@@ -3605,7 +3605,7 @@ 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. isPPC () )
36093609 D.Diag (diag::err_drv_unsupported_opt_for_target)
36103610 << A->getAsString (Args) << TripleStr;
36113611 if ((EffectiveTriple.isX86 () || EffectiveTriple.isARM () ||
@@ -3645,7 +3645,7 @@ static void RenderSSPOptions(const Driver &D, const ToolChain &TC,
36453645 << A->getOption ().getName () << Value << " sysreg global" ;
36463646 return ;
36473647 }
3648- if (EffectiveTriple.isRISCV ()) {
3648+ if (EffectiveTriple.isRISCV () || EffectiveTriple. isPPC () ) {
36493649 if (Value != " tls" && Value != " global" ) {
36503650 D.Diag (diag::err_drv_invalid_value_with_suggestion)
36513651 << A->getOption ().getName () << Value << " tls global" ;
@@ -3666,7 +3666,7 @@ static void RenderSSPOptions(const Driver &D, const ToolChain &TC,
36663666 StringRef Value = A->getValue ();
36673667 if (!EffectiveTriple.isX86 () && !EffectiveTriple.isAArch64 () &&
36683668 !EffectiveTriple.isARM () && !EffectiveTriple.isThumb () &&
3669- !EffectiveTriple.isRISCV ())
3669+ !EffectiveTriple.isRISCV () && !EffectiveTriple. isPPC () )
36703670 D.Diag (diag::err_drv_unsupported_opt_for_target)
36713671 << A->getAsString (Args) << TripleStr;
36723672 int Offset;
@@ -3686,7 +3686,7 @@ static void RenderSSPOptions(const Driver &D, const ToolChain &TC,
36863686 if (Arg *A = Args.getLastArg (options::OPT_mstack_protector_guard_reg_EQ)) {
36873687 StringRef Value = A->getValue ();
36883688 if (!EffectiveTriple.isX86 () && !EffectiveTriple.isAArch64 () &&
3689- !EffectiveTriple.isRISCV ())
3689+ !EffectiveTriple.isRISCV () && !EffectiveTriple. isPPC () )
36903690 D.Diag (diag::err_drv_unsupported_opt_for_target)
36913691 << A->getAsString (Args) << TripleStr;
36923692 if (EffectiveTriple.isX86 () && (Value != " fs" && Value != " gs" )) {
@@ -3703,6 +3703,16 @@ static void RenderSSPOptions(const Driver &D, const ToolChain &TC,
37033703 << A->getOption ().getName () << Value << " tp" ;
37043704 return ;
37053705 }
3706+ if (EffectiveTriple.isPPC64 () && Value != " r13" ) {
3707+ D.Diag (diag::err_drv_invalid_value_with_suggestion)
3708+ << A->getOption ().getName () << Value << " r13" ;
3709+ return ;
3710+ }
3711+ if (EffectiveTriple.isPPC32 () && Value != " r2" ) {
3712+ D.Diag (diag::err_drv_invalid_value_with_suggestion)
3713+ << A->getOption ().getName () << Value << " r2" ;
3714+ return ;
3715+ }
37063716 A->render (Args, CmdArgs);
37073717 }
37083718
0 commit comments