Thread overview
[Issue 11520] New: [bionic] qsort is missing on linux/bionic
Nov 15, 2013
Martin Nowak
Nov 16, 2013
Martin Nowak
Jan 05, 2014
joakim@airpost.net
November 15, 2013
https://d.puremagic.com/issues/show_bug.cgi?id=11520

           Summary: [bionic] qsort is missing on linux/bionic
           Product: D
           Version: unspecified
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: druntime
        AssignedTo: nobody@puremagic.com
        ReportedBy: code@dawg.eu


--- Comment #0 from Martin Nowak <code@dawg.eu> 2013-11-15 04:43:33 PST ---
Druntime could easily implement it's own qsort.

https://github.com/ldc-developers/ldc/issues/490#issuecomment-28356710

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
November 16, 2013
https://d.puremagic.com/issues/show_bug.cgi?id=11520



--- Comment #1 from Martin Nowak <code@dawg.eu> 2013-11-16 14:01:25 PST ---
An existing (though copyrighted) implementation was removed with https://github.com/D-Programming-Language/druntime/commit/45f1755cf13a1a376cc1572b5a9327d95fc0db75. Also the used qsort_r isn't present in older glibc versions (see bug 10508).

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
January 05, 2014
https://d.puremagic.com/issues/show_bug.cgi?id=11520


joakim@airpost.net changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |joakim@airpost.net


--- Comment #2 from joakim@airpost.net 2014-01-05 02:54:17 PST ---
There is a qsort in bionic, looks like it comes from FreeBSD:

https://github.com/android/platform_bionic/blob/master/libc/include/stdlib.h#L91 https://github.com/android/platform_bionic/blob/master/libc/upstream-freebsd/lib/libc/stdlib/qsort.c#L110

There is no qsort_r, which is what Druntime uses on linux by default: my guess is that's what Elvis tried to use.  But you can use the fallback block from rt/qsort.d that calls qsort on Android and I believe it should work fine.

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------