[PD-dev] qsort_r failure building puredata on Android?

Miller Puckette msp at ucsd.edu
Tue Oct 27 18:29:49 CET 2020


And now that I see it I think Claude's solution is equivalent to what I'm
suggesting.

cheers
Miller

On Tue, Oct 27, 2020 at 05:17:55PM +0000, Claude Heiland-Allen wrote:
> Hi Andi,
> 
> On 27/10/2020 15:49, Andi McClure wrote:
> > I am building puredata via libpd on Android (a fork off 0.51/d5766fd0).
> > I am doing this by loading the libpd CMakeLists.txt from my own
> > CMakeLists invoked from gradle and then linking libpd in my Android app.
> > 
> > When it gets to the step of building libpd.so, it prints:
> > 
> > libpd/CMakeFiles/libpd.dir/pure-data/src/x_text.c.o: In function
> > `text_define_sort':
> > 
> > /path/to/repo/deps/libpd/pure-data/src/x_text.c:552: undefined reference
> > to `qsort_r'
> > 
> 
> I ran into this compiling libpd to run in the browser with Emscripten, ended
> up writing my own qsort_r that wraps qsort. I haven't tested it much
> though.?? There are a couple of follow-up commits so this diff isn't quite
> the whole story:
> 
> https://urldefense.com/v3/__https://github.com/claudeha/pure-data/commit/e8023866ef8be3475cc101cfb1656f5249030875*diff-e11aa02617b1aa9f0aa34c6e0b8c21b98b1fcee3324d88e839579e6f66923ef3__;Iw!!Mih3wA!W-VdJNWZkwWeADXyvunb0VGsLI01ymfDvWLCG2sLkSqN21eRYnRDiF715tgT$
> 
> https://urldefense.com/v3/__https://github.com/pure-data/pure-data/issues/675__;!!Mih3wA!W-VdJNWZkwWeADXyvunb0VGsLI01ymfDvWLCG2sLkSqN21eRYnRDiHsg9182$
> is an issue with a pull request, that's probably a bit nicer than my patched
> branch that is way behind upstream...
> 
> Maybe other systems than Emscripten and Android are broken, anyone using a
> BSD or Linux which doesn't use glibc for example?
> 
> > I asked around about this, and was told a few things:
> > * Sometimes this kind of Android error magically goes away if you fiddle
> > with compileSdkVersion in gradle.
> > * There is a list in this git repo:
> > https://urldefense.com/v3/__https://android.googlesource.com/platform/bionic/*/master/libc/libc.map.txt__;Kw!!Mih3wA!W-VdJNWZkwWeADXyvunb0VGsLI01ymfDvWLCG2sLkSqN21eRYnRDiHMmztiR$
> > ?? ??Of which libc symbols wind up in which binary in Android. However,
> > in current Android master, qsort_r is not in this list at all. Only
> > qsort.
> > * qsort_r is not a standard C function, it is a GNU thing,??so it's
> > possible Android really just doesn't have it. If Android really doesn't
> > provide quicksort, it *might* be possible to fake qsort_r by adding a
> > single C++ file which wraps std::sort (this was added in C++03 so
> > Android *probably* has it), which doesn't have standard C qsort's
> > reentrancy problem.
> > 
> 
> 
> Claude
> -- 
> https://urldefense.com/v3/__https://mathr.co.uk__;!!Mih3wA!W-VdJNWZkwWeADXyvunb0VGsLI01ymfDvWLCG2sLkSqN21eRYnRDiDl2d_E9$
> 
> 
> 
> 
> _______________________________________________
> Pd-dev mailing list
> Pd-dev at lists.iem.at
> https://urldefense.com/v3/__https://lists.puredata.info/listinfo/pd-dev__;!!Mih3wA!W-VdJNWZkwWeADXyvunb0VGsLI01ymfDvWLCG2sLkSqN21eRYnRDiKUXRTcD$





More information about the Pd-dev mailing list