public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Svante Signell <svante.signell@gmail.com>
To: gcc-patches <gcc-patches@gcc.gnu.org>,
	Debian Bug Tracking System <submit@bugs.debian.org>
Cc: Ian Lance Taylor <iant@golang.org>, Matthias Klose <doko@debian.org>
Subject: Now gcc-13: [Fwd: [PATCH] gcc-12: Re-enable split-stack support for GNU/Hurd.]
Date: Wed, 15 Mar 2023 17:14:01 +0100	[thread overview]
Message-ID: <952ba6f7c288d4198f99437672278473d5bb88f7.camel@gmail.com> (raw)
In-Reply-To: <bdea640227a303a971e49d0115946e7c454b3e37.camel@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 728 bytes --]

Package: gcc-snapshot
Version: 1:20230315-1
Severity: important
Tags: patch
User: debian-hurd@lists.debian.org
Usertags: hurd
Affects: gcc-snapshot
X-Debbugs-CC: debian-hurd@lists.debian.org

Hello, seems like the patch gcc_config_gnu.h.diff, in debian gcc-12 named:
pr104290-followup.diff was lost (again).

How can this patch ever become upstreamed??

It seems like sending to gcc-patches is not enough. Create a regression bug?  
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104290 is already reported as a
regression, it has to be updated to cover upstream releases of gcc-13 now.

For gcc-12 Debian has been carrying it as:
pr104290-followup.diff

Submitting this problem as new bug to Debian/gcc-13/gcc-snapshot!

Thanks!

[-- Attachment #2: Forwarded message — [PATCH] gcc-12: Re-enable split-stack support for GNU/Hurd. --]
[-- Type: message/rfc822, Size: 3849 bytes --]

[-- Attachment #2.1.1: Type: text/plain, Size: 2140 bytes --]

Hello,

In line of porting the latest build of libgo/go with gcc-12 to GNU/Hurd, support
of split-stack was found to be removed.
 
After patching the files in libgo 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(opts) and OPTION_GLIBC that was lost
in config/gnu.h, needed to enable split-stack support for GNU/Hurd. 

This problem happened with the latest commit as discussed in the mail thread
starting with https://gcc.gnu.org/pipermail/gcc-patches/2022-January/588973.html
.

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 attached patch to
src/gcc/config/gnu.h creates that definition. For GNU/Hurd, 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

For a longer history about this bug see:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104290

Additionally, I would propose the text in gcc/common/config/i386/i386-common.cc
to change from:
error ("%<-fsplit-stack%> currently only supported on GNU/Linux");
to:
error ("%<-fsplit-stack%> currently only supported on GLIBC-based systems");

Thanks!
\r

[-- Attachment #2.1.2: gcc_config_gnu.h.diff --]
[-- Type: text/x-patch, Size: 431 bytes --]

--- a/src/gcc/config/gnu.h	2022-02-06 11:59:41.000000000 +0100
+++ b/src/gcc/config/gnu.h	2022-02-06 12:00:19.000000000 +0100
@@ -19,6 +19,9 @@
 along with GCC.  If not, see <http://www.gnu.org/licenses/>.
 */
 
+#define OPTION_GLIBC_P(opts)	(DEFAULT_LIBC == LIBC_GLIBC)
+#define OPTION_GLIBC		OPTION_GLIBC_P (&global_options)
+
 #undef GNU_USER_TARGET_OS_CPP_BUILTINS
 #define GNU_USER_TARGET_OS_CPP_BUILTINS()		\
     do {					\

  parent reply	other threads:[~2023-03-15 16:14 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-23 10:13 [PATCH] gcc-12: Re-enable split-stack support for GNU/Hurd Svante Signell
2022-03-17  9:05 ` Svante Signell
2023-03-15 16:14 ` Svante Signell [this message]
2023-03-15 21:57   ` Now gcc-13: [Fwd: [PATCH] gcc-12: Re-enable split-stack support for GNU/Hurd.] Ian Lance Taylor

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=952ba6f7c288d4198f99437672278473d5bb88f7.camel@gmail.com \
    --to=svante.signell@gmail.com \
    --cc=doko@debian.org \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=iant@golang.org \
    --cc=submit@bugs.debian.org \
    /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).