GNU bug report logs - #60234
Build failure on mac os 12.6 / gcc 12.2

Previous Next

Package: guile;

Reported by: lloda <lloda <at> sarc.name>

Date: Wed, 21 Dec 2022 06:50:02 UTC

Severity: normal

To reply to this bug, email your comments to 60234 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-guile <at> gnu.org:
bug#60234; Package guile. (Wed, 21 Dec 2022 06:50:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to lloda <lloda <at> sarc.name>:
New bug report received and forwarded. Copy sent to bug-guile <at> gnu.org. (Wed, 21 Dec 2022 06:50:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: lloda <lloda <at> sarc.name>
To: bug-guile <at> gnu.org
Subject: Build failure on mac os 12.6 / gcc 12.2
Date: Wed, 21 Dec 2022 07:49:37 +0100
The error is

.../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 = NULL;

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

regards

  Daniel





Reply sent to lloda <lloda <at> sarc.name>:
You have taken responsibility. (Wed, 21 Dec 2022 07:08:02 GMT) Full text and rfc822 format available.

Notification sent to lloda <lloda <at> sarc.name>:
bug acknowledged by developer. (Wed, 21 Dec 2022 07:08:02 GMT) Full text and rfc822 format available.

Message #10 received at 60234-done <at> debbugs.gnu.org (full text, mbox):

From: lloda <lloda <at> sarc.name>
To: 60234-done <at> debbugs.gnu.org
Subject: Re: bug#60234: Build failure on mac os 12.6 / gcc 12.2
Date: Wed, 21 Dec 2022 08:06:59 +0100
Patched in f859e0f58b211eedcb0dce4f2382cfebf37010d7.





bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 18 Jan 2023 12:24:08 GMT) Full text and rfc822 format available.

Did not alter fixed versions and reopened. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 18 Jan 2023 21:58:01 GMT) Full text and rfc822 format available.

bug unarchived. Request was from Ludovic Courtès <ludo <at> gnu.org> to control <at> debbugs.gnu.org. (Fri, 20 Jan 2023 08:59:04 GMT) Full text and rfc822 format available.

Did not alter fixed versions and reopened. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 20 Jan 2023 08:59:04 GMT) Full text and rfc822 format available.

Information forwarded to bug-guile <at> gnu.org:
bug#60234; Package guile. (Fri, 20 Jan 2023 09:02:01 GMT) Full text and rfc822 format available.

Message #21 received at 60234 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: lloda <lloda <at> sarc.name>
Cc: 60234 <at> debbugs.gnu.org
Subject: Re: bug#60234: Build failure on mac os 12.6 / gcc 12.2
Date: Wed, 18 Jan 2023 23:16:41 +0100
Hi Daniel,

lloda <lloda <at> 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;
>       |                                           ^
> .../libguile/threads.c:357:30: note: previously defined here as local-dynamic
>   357 | SCM_THREAD_LOCAL scm_thread *scm_i_current_thread = NULL;
>
> Simply repeating SCM_INTERNAL in the .c fixes it...

The problem is that ‘SCM_INTERNAL’ is synonymous with ‘extern’, 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 = NULL;
      |                                           ^~~~~~~~~~~~~~~~~~~~
--8<---------------cut here---------------end--------------->8---

It’s just a warning, but still not looking good.

Is there something else at play, such as a ‘-ftls-model’ flag being
passed to GCC somehow (info “(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’.




Information forwarded to bug-guile <at> gnu.org:
bug#60234; Package guile. (Fri, 20 Jan 2023 09:39:02 GMT) Full text and rfc822 format available.

Message #24 received at 60234 <at> debbugs.gnu.org (full text, mbox):

From: lloda <lloda <at> sarc.name>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 60234 <at> debbugs.gnu.org
Subject: Re: bug#60234: Build failure on mac os 12.6 / gcc 12.2
Date: Fri, 20 Jan 2023 10:38:18 +0100
[Message part 1 (text/plain, inline)]

> On 18 Jan 2023, at 23:16, Ludovic Courtès <ludo <at> gnu.org <mailto:ludo <at> gnu.org>> wrote:
> 
> Hi Daniel,
> 
> lloda <lloda <at> sarc.name <mailto:lloda <at> 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;
>>     |                                           ^
>> .../libguile/threads.c:357:30: note: previously defined here as local-dynamic
>> 357 | SCM_THREAD_LOCAL scm_thread *scm_i_current_thread = NULL;
>> 
>> Simply repeating SCM_INTERNAL in the .c fixes it...
> 
> The problem is that ‘SCM_INTERNAL’ is synonymous with ‘extern’, 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 = NULL;
>     |                                           ^~~~~~~~~~~~~~~~~~~~
> --8<---------------cut here---------------end--------------->8---
> 
> It’s 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 ‘-ftls-model’ flag being
> passed to GCC somehow (info “(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’.

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
[Message part 2 (text/html, inline)]

This bug report was last modified 1 year and 103 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.