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

--- Comment #26 from Svante Signell <svante.signell at gmail dot com> ---
(In reply to Ian Lance Taylor from comment #25)
> > Hopefully someone knows hot to modify Makefile.tpl/Makefile.def to generate 
> > the correct dependencies in Makefile.in.
> 
> I suggest that you open a separate bug for that, with a complete standalone
> explanation of the problem.  This bug is mixed in with a lot of other things.

OK, will do.

> > Another patch that is not applied: gcc_config_gnu.h.diff. Who will commit 
> > that patch? It is not directly relating to libgo, but gotools fails to 
> > build later on without it.
> 
> I assume you mean this patch:
> 
> https://gcc.gnu.org/bugzilla/attachment.cgi?id=52360&action=edit

Yes!

> I don't understand why that patch makes any difference.  Where is the code
> that checks OPTION_GLIBC?

Pasted from Comment 1 and Comment 2:
start paste__________
Additionally, continuing, the build of gotools fails:
go1: error: '-fsplit-stack' currently only supported on GNU/Linux
go1: error: '-fsplit-stack' is not supported by this compiler configuration

The attached patch defines OPTION_GLIBC_P and OPTION_GLIBC that was lost for
config/gnu.h, thus enabling split-stack support for GNU/Hurd again. 

This problem happened with the latest commit and fixes for #104170 and as
discussed in the mail thread starting with
https://gcc.gnu.org/pipermail/gcc-patches/2022-January/588973.html.
end paste___________

The file first doing this check is: (first error: ..)
src/gcc/common/config/i386/i386-common.cc
in function:
static bool ix86_supports_split_stack (bool report,
            struct gcc_options *opts ATTRIBUTE_UNUSED)

and secondly in:src/gcc/opts.cc: (second error: ...)
in function:
void
finish_options (struct gcc_options *opts, struct gcc_options *opts_set,
                location_t loc)

The checking logic is in function ix86_supports_split_stack():
#if defined(TARGET_THREAD_SPLIT_STACK_OFFSET) && defined(OPTION_GLIBC_P)
  if (!OPTION_GLIBC_P (opts))
#endif
    {
      if (report)
        error ("%<-fsplit-stack%> currently only supported on GNU/Linux");
      return false;
    }

  bool ret = true;

In case of GNU/Hurd TARGET_THREAD_SPLIT_STACK_OFFSET is defined as well as
OPTION_GLIBC_P but OPTION_GLIBC_P (opts) is needed to. The proposed patch to
src/gcc/config/gnu.h creates that definition. Additionally, gnu.h is included
in the configure stage:
Configuring stage 1 in ./gcc
...
Using the following target machine macro files:
...
        ../../src/gcc/config/gnu.h

Thanks!

Reply via email to