All of lore.kernel.org
 help / color / mirror / Atom feed
From: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
To: Tom Rix <trix@redhat.com>
Cc: linux-sparse@vger.kernel.org, dan.carpenter@oracle.com
Subject: Re: [PATCH] cgcc: handle -x assembler
Date: Sun, 22 May 2022 11:38:03 +0200	[thread overview]
Message-ID: <20220522093803.i4z3hpcuhkz3ohj7@mail> (raw)
In-Reply-To: <20220410140026.1830513-1-trix@redhat.com>

Hi,

Sorry for this late reply.
 
On Sun, Apr 10, 2022 at 10:00:26AM -0400, Tom Rix wrote:
> On linux-next, using
> make CC=cgcc
> 
> fails with
> cgcc: unknown assembler invoked
> scripts/Kconfig.include:50: Sorry, this assembler is not supported.
> 
> cgcc is being invoked with
> cgcc -Wa,--version -c -x assembler /dev/null -o /dev/null
> And dieing when the '-x c' is not matched.
>
> Add a check for -x assember.


As you most probably know, cgcc is a wrapper around GCC to transparently
also call sparse on the source code.
This was designed when using sparse on non-kernel code. The kernel doesn't
need it since its build system can do the same directly using the commands:
	make C=1 <...>
or
	make C=2 <...>
insuring it's called with the correct arguments (like the --arch option)
and taking in account a few idiosyncrasies.

Your patch is OK regarding cgcc itself but I don't know what good it will
do after, when calling sparse, since sparse can only process C code an will
surely choke on assembly files.

So, are you sure you must cgcc here and can't use the existing make C=[12]
mechanism? Otherwise, a more correct patch would be to change the check
for '-x c', set $do_check = 0 when the argument is 'assembler' (or
better, when anything other than 'c') and preferably stop to parse the
remaining arguments/directly call the $REAL_CC.

Best regards,
-- Luc

      reply	other threads:[~2022-05-22  9:38 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-10 14:00 [PATCH] cgcc: handle -x assembler Tom Rix
2022-05-22  9:38 ` Luc Van Oostenryck [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=20220522093803.i4z3hpcuhkz3ohj7@mail \
    --to=luc.vanoostenryck@gmail.com \
    --cc=dan.carpenter@oracle.com \
    --cc=linux-sparse@vger.kernel.org \
    --cc=trix@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.