Bug 96079 - Unresolved atomic builtins
Summary: Unresolved atomic builtins
Status: RESOLVED INVALID
Alias: None
Product: gcc
Classification: Unclassified
Component: jit (show other bugs)
Version: 10.1.0
: P3 normal
Target Milestone: ---
Assignee: David Malcolm
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-07-06 13:23 UTC by Antoni
Modified: 2021-05-18 00:58 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments
Reproducer (1.33 KB, text/x-csrc)
2020-07-06 13:23 UTC, Antoni
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Antoni 2020-07-06 13:23:15 UTC
Created attachment 48836 [details]
Reproducer

Hi.
When I try to use an atomic builtin, it gives an error like:

libgccjit.so: error: /tmp/libgccjit-1VoggR/fake.so: undefined symbol: __atomic_store_n

I tried setting the arch with:

gcc_jit_context_add_command_line_option(ctxt, "-march=x86-64");


but it didn't change anything.

From inspecting the source code of gcc, it seems it does not support that yet because it does not call resolve_overloaded_builtin (I might be wrong, I don't have much knowledge of the gcc codebase).

So, is there a way to do that currently or is it a bug?

Thanks.
Comment 1 Jonathan Wakely 2020-07-06 13:37:20 UTC
It seems like all these bugs with atomics in libgccjit could be a single bug report.
Comment 2 Antoni 2021-05-18 00:58:15 UTC
The actual call should be with a number instead of `n`, i.e. `__atomic_store_4`.