https://gcc.gnu.org/bugzilla/show_bug.cgi?id=125324

--- Comment #3 from Tobias Burnus <burnus at gcc dot gnu.org> ---
(In reply to Jerry DeLisle from comment #2)
> Tobias, is this machine this problem is on part of the compiler farm?
> If so I could test myself. If not, here is a draft patch:

I worry that it will break the build on other systems, because it is only in
(searched in subdir of gcc/config/):

darwin.opt, dragonfly.opt, freebsd.opt, gnu-user.opt, hpux11.opt,
i386/cygwin.opt, mingw/mingw.opt, netbsd.opt, openbsd.opt, rs6000/aix64.opt,
rtems.opt, sol2.opt

Contrary to gcc.cc's spec which is text based, this one uses OPT_pthread, which
is ends up in the generated <build-dir>/gcc/options.h as enum value.

Thus, I fear that it will fail with unknown identifier, unless -pthread is
supported (and OPT_pthread exists in options.h).

* * *

The other options it to create a .spec file, similar to e.g.
  libgfortran/libgfortran.spec.in
  libgomp/libgomp.spec.in
where the former is found via fortran/gfortranspec.cc's

lang_specific_pre_link (void)
{
  if (library)
    do_spec ("%:include(libgfortran.spec)");

which actually makes me wonder whether we could replace
    append_option (OPT_pthread, NULL, 1);

by a call to  do_spec ("....")

I don't know whether just passing "-pthread" here works - or only %{fcoarray=*}
-pthread" or ...
Cf. https://gcc.gnu.org/onlinedocs/gccint/Options.html

Reply via email to