From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: lloda Newsgroups: gmane.lisp.guile.bugs Subject: bug#60234: Build failure on mac os 12.6 / gcc 12.2 Date: Fri, 20 Jan 2023 10:38:18 +0100 Message-ID: References: <5404ACA9-05C6-4349-9736-3185914D8A0F@sarc.name> <87k01h8tqd.fsf@gnu.org> Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.7\)) Content-Type: multipart/alternative; boundary="Apple-Mail=_D17C3DD7-422A-45C2-BAC7-7DB0E34072C0" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="2834"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 60234@debbugs.gnu.org To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-X-From: bug-guile-bounces+guile-bugs=m.gmane-mx.org@gnu.org Fri Jan 20 10:39:35 2023 Return-path: Envelope-to: guile-bugs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pInry-0000UU-95 for guile-bugs@m.gmane-mx.org; Fri, 20 Jan 2023 10:39:34 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pInre-0003vL-3Y; Fri, 20 Jan 2023 04:39:14 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pInrU-0003uj-Ay for bug-guile@gnu.org; Fri, 20 Jan 2023 04:39:05 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pInrS-0001n3-K4 for bug-guile@gnu.org; Fri, 20 Jan 2023 04:39:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pInrS-0008IC-1d for bug-guile@gnu.org; Fri, 20 Jan 2023 04:39:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: lloda Original-Sender: "Debbugs-submit" Resent-CC: bug-guile@gnu.org Resent-Date: Fri, 20 Jan 2023 09:39:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 60234 X-GNU-PR-Package: guile Original-Received: via spool by 60234-submit@debbugs.gnu.org id=B60234.167420751231834 (code B ref 60234); Fri, 20 Jan 2023 09:39:02 +0000 Original-Received: (at 60234) by debbugs.gnu.org; 20 Jan 2023 09:38:32 +0000 Original-Received: from localhost ([127.0.0.1]:45604 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pInqx-0008HN-Iz for submit@debbugs.gnu.org; Fri, 20 Jan 2023 04:38:32 -0500 Original-Received: from mta-07-4.privateemail.com ([68.65.122.27]:31657) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pInqu-0008H6-OE for 60234@debbugs.gnu.org; Fri, 20 Jan 2023 04:38:30 -0500 Original-Received: from mta-07.privateemail.com (localhost [127.0.0.1]) by mta-07.privateemail.com (Postfix) with ESMTP id 32A3D18000AD; Fri, 20 Jan 2023 04:38:22 -0500 (EST) Original-Received: from [192.168.1.105] (unknown [51.154.167.214]) by mta-07.privateemail.com (Postfix) with ESMTPA id 4DCA418000A6; Fri, 20 Jan 2023 04:38:20 -0500 (EST) In-Reply-To: <87k01h8tqd.fsf@gnu.org> X-Mailer: Apple Mail (2.3608.120.23.2.7) X-Virus-Scanned: ClamAV using ClamSMTP X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guile@gnu.org List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guile-bounces+guile-bugs=m.gmane-mx.org@gnu.org Original-Sender: bug-guile-bounces+guile-bugs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.lisp.guile.bugs:10529 Archived-At: --Apple-Mail=_D17C3DD7-422A-45C2-BAC7-7DB0E34072C0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On 18 Jan 2023, at 23:16, Ludovic Court=C3=A8s > wrote: >=20 > Hi Daniel, >=20 > lloda > skribis: >=20 >> .../libguile/threads.h:194:43: error: 'scm_i_current_thread' is = defined with tls model global-dynamic >> 194 | SCM_INTERNAL SCM_THREAD_LOCAL scm_thread *scm_i_current_thread; >> | ^ >> .../libguile/threads.c:357:30: note: previously defined here as = local-dynamic >> 357 | SCM_THREAD_LOCAL scm_thread *scm_i_current_thread =3D NULL; >>=20 >> Simply repeating SCM_INTERNAL in the .c fixes it... >=20 > The problem is that =E2=80=98SCM_INTERNAL=E2=80=99 is synonymous with = =E2=80=98extern=E2=80=99, which > makes no sense for a definition (threads.c:357), so rightfully GCC > GNU/Linux rightfully complains: >=20 > --8<---------------cut here---------------start------------->8--- > CC libguile_3.0_la-threads.lo > threads.c:358:43: warning: 'scm_i_current_thread' initialized and = declared 'extern' > 358 | SCM_INTERNAL SCM_THREAD_LOCAL scm_thread *scm_i_current_thread =3D= NULL; > | ^~~~~~~~~~~~~~~~~~~~ > --8<---------------cut here---------------end--------------->8--- >=20 > It=E2=80=99s just a warning, but still not looking good. Hi, Agreed, I had the same warning on mac os. Looked like the least bad = choice... > Is there something else at play, such as a =E2=80=98-ftls-model=E2=80=99= flag being > passed to GCC somehow (info =E2=80=9C(gcc) Code Gen Options")? >=20 > If not, should we have: >=20 > #define SCM_THREAD_LOCAL \ > __thread __attribute__ ((__tls_model__ ("global-dynamic"))) >=20 > instead (info "(gcc) Common Variable Attributes")? >=20 > Would that work with Clang? >=20 > Ludo=E2=80=99. I don't seem to have any such flags. The attribute does fix the issue on mac os with gcc 12. I hadn't tried clang before, but I did now, and clang 14 works fine with = or without the attribute. So the fix would only be for gcc. Thanks Daniel= --Apple-Mail=_D17C3DD7-422A-45C2-BAC7-7DB0E34072C0 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8

On 18 Jan 2023, at 23:16, Ludovic = Court=C3=A8s <ludo@gnu.org> wrote:

Hi = Daniel,

lloda <lloda@sarc.name> = skribis:

.../libguile/threads.h:194:43: error: 'scm_i_current_thread' = is defined with tls model global-dynamic
194 | = SCM_INTERNAL SCM_THREAD_LOCAL scm_thread *scm_i_current_thread;
    | =             &n= bsp;           &nbs= p;            =      ^
.../libguile/threads.c:357:30: note: previously defined here = as local-dynamic
357 | SCM_THREAD_LOCAL scm_thread = *scm_i_current_thread =3D NULL;

Simply = repeating SCM_INTERNAL in the .c fixes it...

The problem is that = =E2=80=98SCM_INTERNAL=E2=80=99 is synonymous with =E2=80=98extern=E2=80=99= , which
makes no sense for a definition (threads.c:357), = so rightfully GCC
GNU/Linux rightfully complains:

--8<---------------cut = here---------------start------------->8---
CC =       libguile_3.0_la-threads.lo
threads.c:358:43: warning: 'scm_i_current_thread' initialized = and declared 'extern'
358 | SCM_INTERNAL SCM_THREAD_LOCAL = scm_thread *scm_i_current_thread =3D NULL;
    | =             &n= bsp;           &nbs= p;            =      ^~~~~~~~~~~~~~~~~~~~
--8<---------------cut = here---------------end--------------->8---

It=E2=80=99s just a warning, but still not looking good.

Hi,

Agreed, I had the same warning on mac os. Looked like the = least bad choice...

Is there something = else at play, such as a =E2=80=98-ftls-model=E2=80=99 flag being
passed to GCC somehow (info =E2=80=9C(gcc) Code Gen = Options")?

If not, should we have:

#define SCM_THREAD_LOCAL \
  __thread __attribute__ ((__tls_model__ = ("global-dynamic")))

instead (info "(gcc) = Common Variable Attributes")?

Would that = work with Clang?

Ludo=E2=80=99.

I don't seem to have any such = flags.

The attribute does fix = the issue on mac os with gcc 12.

I hadn't tried clang before, but I did now, and clang 14 = works fine with or without the attribute. So the fix would only be for = gcc.

Thanks

 Daniel= --Apple-Mail=_D17C3DD7-422A-45C2-BAC7-7DB0E34072C0--