Hi,
This patch is a backport of a change already in mainline.
Assemblers cannot handle `pragma(mangle, "qsort_r@FBSD_1.0")', as the
symbol name is not the same as symbol version.
Regtested on x86_64-freebsd16.0, committed to releases/gcc-15.
Regards,
Iain.
---
PR d/123633
libphobos/ChangeLog:
* libdruntime/core/internal/qsort.d: Remove __qsort_r_compat.
---
libphobos/libdruntime/core/internal/qsort.d | 13 +------------
1 file changed, 1 insertion(+), 12 deletions(-)
diff --git a/libphobos/libdruntime/core/internal/qsort.d
b/libphobos/libdruntime/core/internal/qsort.d
index 8938a445bab..8e789e70510 100644
--- a/libphobos/libdruntime/core/internal/qsort.d
+++ b/libphobos/libdruntime/core/internal/qsort.d
@@ -60,21 +60,10 @@ else version (FreeBSD)
static if (__FreeBSD_version >= 1400000)
{
+ // FreeBSD changed qsort_r function signature to POSIX in FreeBSD 14.0
alias extern (C) int function(scope const void*, scope const void*,
scope void*) Cmp;
extern (C) void qsort_r(scope void* base, size_t nmemb, size_t size,
Cmp cmp, scope void* thunk);
- // https://cgit.freebsd.org/src/tree/include/stdlib.h?h=stable/14#n350
- pragma(mangle, "qsort_r@FBSD_1.0")
- private extern (C) void __qsort_r_compat(scope void* base, size_t
nmemb, size_t size, scope void* thunk, OldCmp cmp);
- alias extern (C) int function(scope void*, scope const void*, scope
const void*) OldCmp;
-
- deprecated("In FreeBSD 14, qsort_r's signature was fixed to match
POSIX. This extern(D) overload has been " ~
- "provided to avoid breaking code, but code should be
updated to use the POSIX version.")
- extern (D) void qsort_r(scope void* base, size_t nmemb, size_t size,
scope void* thunk, OldCmp cmp)
- {
- __qsort_r_compat(base, nmemb, size, thunk, cmp);
- }
-
extern (C) void[] _adSort(return scope void[] a, TypeInfo ti)
{
extern (C) int cmp(scope const void* p1, scope const void* p2,
scope void* ti)
--
2.43.0