https://gcc.gnu.org/g:ae573c9d0e7f1cf3352cc5cf507ebd0472e9886f

commit r15-10798-gae573c9d0e7f1cf3352cc5cf507ebd0472e9886f
Author: Iain Buclaw <[email protected]>
Date:   Thu Feb 5 20:38:59 2026 +0100

    libphobos: Remove qsort_r compat to fix *-freebsd14 [PR123633]
    
    Assemblers cannot handle `pragma(mangle, "qsort_r@FBSD_1.0")', as the
    symbol name is not the same as symbol version.
    
            PR d/123633
    
    libphobos/ChangeLog:
    
            * libdruntime/core/internal/qsort.d: Remove __qsort_r_compat.

Diff:
---
 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 8938a445babd..8e789e70510c 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)

Reply via email to