linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Segher Boessenkool <segher@kernel.crashing.org>
To: Michael Ellerman <mpe@ellerman.id.au>
Cc: Nick Desaulniers <ndesaulniers@google.com>,
	linuxppc-dev@lists.ozlabs.org, Joel Stanley <joel@jms.id.au>
Subject: Re: [PATCH] powerpc/32: Avoid unsupported flags with clang
Date: Mon, 5 Nov 2018 17:12:08 -0600	[thread overview]
Message-ID: <20181105231207.GB5994@gate.crashing.org> (raw)
In-Reply-To: <87wopschge.fsf@concordia.ellerman.id.au>

On Mon, Nov 05, 2018 at 02:48:49PM +1100, Michael Ellerman wrote:
> Joel Stanley <joel@jms.id.au> writes:
> > When building for ppc32 with clang these flags are unsupported:
> >
> >   -ffixed-r2 and -mmultiple

> > -CFLAGS-$(CONFIG_PPC32)	:= -ffixed-r2 $(MULTIPLEWORD)
> > +ifndef CONFIG_CC_IS_CLANG
> > +#CFLAGS-$(CONFIG_PPC32)	:= -ffixed-r2 $(MULTIPLEWORD)
> > +endif
> 
> I think using cc-option with a comment would be nicer, you could avoid
> the ifdef and it would also future-proof it against the option either
> appearing in a future clang or disappearing in a future gcc.

These options will never be removed, lol.  -ffixed-<reg> is ancient and
generic, and -mmultiple is useful so not in any danger, and besides, we
would leave the command line option even if the feature is gone.

> eg ~=:
> 
> # Clang doesn't need or support -ffixed-r2
> CFLAGS-$(CONFIG_PPC32)	+= $(cc-option,-ffixed-r2)

This option changes the ABI.  The compiler had better handle it!  If it
doesn't, the only safe cause of action is to fail loudly.

If LLVM always makes r2 fixed, it is better to special-case it here.
(Even better would be to fix the compiler, of course).


Segher

      parent reply	other threads:[~2018-11-05 23:14 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-02  4:39 [PATCH] powerpc/32: Avoid unsupported flags with clang Joel Stanley
2018-11-02  4:47 ` Joel Stanley
2018-11-02 16:48 ` Nick Desaulniers
2018-11-05  3:48 ` Michael Ellerman
2018-11-05  6:12   ` Joel Stanley
2018-11-05 23:12   ` Segher Boessenkool [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181105231207.GB5994@gate.crashing.org \
    --to=segher@kernel.crashing.org \
    --cc=joel@jms.id.au \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mpe@ellerman.id.au \
    --cc=ndesaulniers@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).