On Fri, 6 Sep 2019, Jonathan Wakely wrote:

> 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?

Likely only useful for UnixWare (and OpenServer 6).

> 
> > 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).

Ok, I'll go down this path and see how it works out.

Thanks.
 
> 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 ...
> 

-- 
Tim Rice                                Multitalents    (707) 456-1146
t...@multitalents.net


Reply via email to