* bug#60234: Build failure on mac os 12.6 / gcc 12.2
@ 2022-12-21 6:49 lloda
2022-12-21 7:06 ` lloda
2023-01-18 22:16 ` Ludovic Courtès
0 siblings, 2 replies; 4+ messages in thread
From: lloda @ 2022-12-21 6:49 UTC (permalink / raw)
To: 60234
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
^ permalink raw reply [flat|nested] 4+ messages in thread
* bug#60234: Build failure on mac os 12.6 / gcc 12.2
2022-12-21 6:49 bug#60234: Build failure on mac os 12.6 / gcc 12.2 lloda
@ 2022-12-21 7:06 ` lloda
2023-01-18 22:16 ` Ludovic Courtès
1 sibling, 0 replies; 4+ messages in thread
From: lloda @ 2022-12-21 7:06 UTC (permalink / raw)
To: 60234-done
Patched in f859e0f58b211eedcb0dce4f2382cfebf37010d7.
^ permalink raw reply [flat|nested] 4+ messages in thread
* bug#60234: Build failure on mac os 12.6 / gcc 12.2
2022-12-21 6:49 bug#60234: Build failure on mac os 12.6 / gcc 12.2 lloda
2022-12-21 7:06 ` lloda
@ 2023-01-18 22:16 ` Ludovic Courtès
2023-01-20 9:38 ` lloda
1 sibling, 1 reply; 4+ messages in thread
From: Ludovic Courtès @ 2023-01-18 22:16 UTC (permalink / raw)
To: lloda; +Cc: 60234
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;
> | ^
> .../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’.
^ permalink raw reply [flat|nested] 4+ messages in thread
* bug#60234: Build failure on mac os 12.6 / gcc 12.2
2023-01-18 22:16 ` Ludovic Courtès
@ 2023-01-20 9:38 ` lloda
0 siblings, 0 replies; 4+ messages in thread
From: lloda @ 2023-01-20 9:38 UTC (permalink / raw)
To: Ludovic Courtès; +Cc: 60234
[-- Attachment #1: Type: text/plain, Size: 2012 bytes --]
> On 18 Jan 2023, at 23:16, Ludovic Courtès <ludo@gnu.org <mailto:ludo@gnu.org>> wrote:
>
> Hi Daniel,
>
> lloda <lloda@sarc.name <mailto: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;
>> | ^
>> .../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
[-- Attachment #2: Type: text/html, Size: 5727 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2023-01-20 9:38 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-12-21 6:49 bug#60234: Build failure on mac os 12.6 / gcc 12.2 lloda
2022-12-21 7:06 ` lloda
2023-01-18 22:16 ` Ludovic Courtès
2023-01-20 9:38 ` lloda
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).