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/e80...
https://urldefense.com/v3/__https://github.com/pure-data/pure-data/issues/67... 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...
?? ??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@lists.iem.at https://urldefense.com/v3/__https://lists.puredata.info/listinfo/pd-dev__;!!...