public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jonathan Wakely <jwakely.gcc@gmail.com>
To: Tim Rice <tim@multitalents.net>
Cc: "gcc@gcc.gnu.org" <gcc@gcc.gnu.org>
Subject: Re: add command line option to gcc
Date: Fri, 06 Sep 2019 10:07:00 -0000	[thread overview]
Message-ID: <CAH6eHdRLc+x=pywsAd4Cvkf7MXwpcen4JNREQpP7scZ+3f3BSQ@mail.gmail.com> (raw)
In-Reply-To: <alpine.UW2.2.11.1909051919370.23439@server01.int.multitalents.net>

On Fri, 6 Sep 2019 at 04:26, Tim Rice wrote:
>
>
> I have a use case where I would like gcc to accept -Kthread
> and act as if it was passed -pthread. So -Kthread would
> be a synonym for -pthread.

For a specific target, or universally?

> I am having trouble figuring out how the option processing is handled.
> Possibly in gcc/gcc.c but I am stumped here.

You could use "specs" to tell the driver to use -pthread when -Kthread
is given e.g.

%{Kthread: -pthread}

This can either be hardcoded into the 'gcc' driver program (which
would be done in gcc/gcc.c or in a per-target file under gcc/config)
or provided in a specs file with the -specs option (see the manual).

The quick and dirty way to test that would be to dump the current
specs to a file with 'gcc -dumpspecs > kthread.spec' and then edit the
file so that everywhere you see %{pthread: xxx} you add %{Kthread:
xxx} to make it do the same thing. Then you can run gcc
-specs=kthread.spec -Kthread ...

  parent reply	other threads:[~2019-09-06 10:07 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-06  3:25 Tim Rice
2019-09-06  4:18 ` Nicholas Krause
2019-09-06 10:07 ` Jonathan Wakely [this message]
2019-09-06 17:21   ` Tim Rice

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='CAH6eHdRLc+x=pywsAd4Cvkf7MXwpcen4JNREQpP7scZ+3f3BSQ@mail.gmail.com' \
    --to=jwakely.gcc@gmail.com \
    --cc=gcc@gcc.gnu.org \
    --cc=tim@multitalents.net \
    /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 read-only IMAP folder(s) and NNTP newsgroup(s).