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

Miller Puckette msp at ucsd.edu
Tue Oct 27 19:10:20 CET 2020


OK, just replace

static void *stupid_zkeyinfo;

with

static PERTHREAD void *stupid_zkeyinfo;

and I think it's OK.

M

On Tue, Oct 27, 2020 at 06:35:34PM +0100, Christof Ressi wrote:
> Hey, I've just updated the PR to also use "STUPID_SORT" on Android.
> 
> Christof
> 
> On 27.10.2020 18:17, 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!XeYXqMNRirjDZX-LmH5ybmSC_fHI6Czc5HoOCgT36ElNqOkl6LDZYBtpjVR3$
> > 
> > 
> > https://urldefense.com/v3/__https://github.com/pure-data/pure-data/issues/675__;!!Mih3wA!XeYXqMNRirjDZX-LmH5ybmSC_fHI6Czc5HoOCgT36ElNqOkl6LDZYEXtz1U-$
> > 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!XeYXqMNRirjDZX-LmH5ybmSC_fHI6Czc5HoOCgT36ElNqOkl6LDZYKT8thKT$
> > > 
> > > ?? ??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
> 
> 
> 
> _______________________________________________
> Pd-dev mailing list
> Pd-dev at lists.iem.at
> https://urldefense.com/v3/__https://lists.puredata.info/listinfo/pd-dev__;!!Mih3wA!XeYXqMNRirjDZX-LmH5ybmSC_fHI6Czc5HoOCgT36ElNqOkl6LDZYIJ_taKB$





More information about the Pd-dev mailing list