Re: BUG #18610: llvm error: __aarch64_swp4_acq_rel which could not be resolved
Thomas Munro <thomas.munro@gmail.com>
From: Thomas Munro <thomas.munro@gmail.com>
To: "a.kozhemyakin" <a.kozhemyakin@postgrespro.ru>
Cc: pgsql-bugs@lists.postgresql.org
Date: 2024-11-08T05:15:30Z
Lists: pgsql-bugs
Attachments
- 0001-jit-Use-mno-outline-atomics-for-bitcode.patch (application/octet-stream) patch 0001
While hacking on ARM problems this week, I remembered this one. I see now that this is not new: all Debian clang versions at least as far back as 14, including the default one on Debian stable, have it on by default. That is out of sync with their gcc package. So unless you also set CC to clang, you get: postgres=# set jit_inline_above_cost = 0; SET postgres=# set jit_above_cost = 0; SET postgres=# select pg_last_wal_receive_lsn(); WARNING: failed to resolve name __aarch64_swp4_acq_rel FATAL: fatal llvm error: Program used external function '__aarch64_swp4_acq_rel' which could not be resolved! I suspect some other distros might have turned this on in their gcc too but I am not sure which ones. Some options: 1. Somehow figure out if $CC is using -moutline-atomics, then make BITCODE_CFLAGS agree. I haven't thought of a nice way to do it... 2. Tell $CC to use it. That was already kinda rejected in that other thread, leaving this up to the toolchain people. If we ever change our minds on that, it I guess it would be master only, so not help with this problem. 3. Disable it in BITCODE_CFLAGS, whether or not $CC is using it. It might be fairly rare for inlined functions to use relevant atomic ops, so perhaps it's not such a big deal to be conservative here for now. Here's a patch for approach #3. This is low-urgency and a code freeze begins in a day or two, so I'm *not* proposing it for next week's release.
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
jit: Use -mno-outline-atomics for bitcode on ARM.
- 8aefd8b6f661 13.19 landed
- 7ca388fd0dec 14.16 landed
- 78c09bd9f94e 18.0 landed
- 8a9a515188c8 17.3 landed
- 6de14dbb3629 16.7 landed
- 15ab513fed04 15.11 landed