On 2 May 2020 a series of commits starting with adb45d2294c0b165970a9b7d03713c8bc768ba0a and ending with 7eef40d444b3325f9580ff557afb6bc19c811f5e changed the implementation of the InterlockedCompareExchange64 function to use GCC's builtin __sync_val_compare_and_swap, and fall back to the (kernel32?) InterlockedCompareExchange64 exported function if absent.
0c14b1a962573ee125940f2008c646befe597226 then fixed the problem with ntdll's unix library not linking when GCC lacked the builtin (which both GCC and Clang lack on FreeBSD i386), by (in effect) redefining it as RtlInterlockedCompareExchange64 and linking to ntdll which exports that.
Recently 7571fa87df453e404d8b6ca58e2da95340156849 made ntdll's unix library link with -nodefaultlibs, so it cannot import RtlInterlockedCompareExchange64 from ntdll any more, recreating that linking regression when GCC lacks the builtin.
This patch implements InterlockedCompareExchange64 within the unix library when it is unavailable from GCC, and gets the unix library to link again.
Signed-off-by: Damjan Jovanovic damjan.jov@gmail.com --- dlls/ntdll/Makefile.in | 1 + dlls/ntdll/unix/cmpxchg64.c | 64 +++++++++++++++++++++++++++++++++++++ 2 files changed, 65 insertions(+) create mode 100644 dlls/ntdll/unix/cmpxchg64.c