* Compiling for Android @ 2014-06-18 21:54 beuc 2014-06-20 10:16 ` Ludovic Courtès 0 siblings, 1 reply; 16+ messages in thread From: beuc @ 2014-06-18 21:54 UTC (permalink / raw) To: guile-user Hi, Is there anybody working on compiling Guile for Android? Here are some notes when trying to compile stable-2.0. First important note: I had to move "AC_CHECK_LIB(m, cos)" (which btw could be rewritten at LT_LIB_M()) before gl_INIT in configure.ac, otherwise libunistring would fail to be detected. The compilation fails when libgc tries to use pthread features not implemented under Android (btw ./configure was happy to start compiling even if libgc wasn't present). Not sure where to go from here, maybe other projects use libgc and already faced the issue? Which version of libgc do you recommend? Cheers! Sylvain ----- /usr/src/android-ndk-r9d/build/tools/make-standalone-toolchain.sh \ --platform=android-12 --install-dir=/usr/src/ndk-standalone-12 PATH=/usr/src/ndk-standalone-12/bin:$PATH aptitude install lzip WGET=wget VERSION=2.4.2 $WGET http://ftp.igh.cnrs.fr/pub/gnu/libtool/libtool-$VERSION.tar.xz tar xf libtool-$VERSION.tar.xz cd libtool-$VERSION/ mkdir cross-android/ && cd cross-android/ ../configure --host=arm-linux-androideabi --prefix=/usr/src/ndk-standalone-12/sysroot/usr make -j$(nproc) make install VERSION=6.0.0a VERSIONDIR=6.0.0 $WGET https://gmplib.org/download/gmp/gmp-$VERSION.tar.lz tar xf gmp-$VERSION.tar.lz cd gmp-$VERSIONDIR/ mkdir cross-android/ && cd cross-android/ ../configure --host=arm-linux-androideabi --prefix=/usr/src/ndk-standalone-12/sysroot/usr make -j$(nproc) make install VERSION=0.9.3 $WGET http://ftp.gnu.org/gnu/libunistring/libunistring-0.9.3.tar.gz tar xf libunistring-$VERSION.tar.gz mkdir cross-android/ && cd cross-android/ cp -a /usr/share/misc/config.{guess,sub} ../build-aux/ ../configure --host=arm-linux-androideabi --prefix=/usr/src/ndk-standalone-12/sysroot/usr make -j$(nproc) make install VERSION=7.2f VERSIONDIR=7.2 $WGET http://www.hboehm.info/gc/gc_source/gc-$VERSION.tar.gz tar xf gc-$VERSION.tar.gz cd gc-$VERSIONDIR/ mkdir cross-android/ && cd cross-android/ => build failure due to Android's pthread cd guile/cross-android/ git checkout stable-2.0 mkdir cross-android/ && cd cross-android/ ../configure --host=arm-linux-androideabi --prefix=/usr/src/ndk-standalone-12/sysroot/usr make -j$(nproc) => depends on libgc ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: Compiling for Android 2014-06-18 21:54 Compiling for Android beuc @ 2014-06-20 10:16 ` Ludovic Courtès 2014-06-21 20:06 ` beuc 0 siblings, 1 reply; 16+ messages in thread From: Ludovic Courtès @ 2014-06-20 10:16 UTC (permalink / raw) To: beuc; +Cc: guile-user Hello! beuc@beuc.net skribis: > Is there anybody working on compiling Guile for Android? Not that I know of. > Here are some notes when trying to compile stable-2.0. > > First important note: I had to move "AC_CHECK_LIB(m, cos)" (which btw > could be rewritten at LT_LIB_M()) before gl_INIT in configure.ac, > otherwise libunistring would fail to be detected. Could you send the config.log of the failing thing? I wasn’t aware of LT_LIB_M, thanks for the tip. > The compilation fails when libgc tries to use pthread features not > implemented under Android (btw ./configure was happy to start > compiling even if libgc wasn't present). Not sure where to go from > here, maybe other projects use libgc and already faced the issue? Does it work if libgc is configure with --disable-threads? > Which version of libgc do you recommend? 7.4.0 should be good. HTH, Ludo’. ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: Compiling for Android 2014-06-20 10:16 ` Ludovic Courtès @ 2014-06-21 20:06 ` beuc 2014-06-21 21:34 ` Ludovic Courtès 0 siblings, 1 reply; 16+ messages in thread From: beuc @ 2014-06-21 20:06 UTC (permalink / raw) To: Ludovic Courtès; +Cc: guile-user Hi! On Fri, Jun 20, 2014 at 12:16:41PM +0200, Ludovic Courtès wrote: > beuc@beuc.net skribis: > > > Is there anybody working on compiling Guile for Android? > > Not that I know of. > > > Here are some notes when trying to compile stable-2.0. > > > > First important note: I had to move "AC_CHECK_LIB(m, cos)" (which btw > > could be rewritten at LT_LIB_M()) before gl_INIT in configure.ac, > > otherwise libunistring would fail to be detected. > > Could you send the config.log of the failing thing? Selected bits: configure:14688: checking for libunistring configure:14710: arm-linux-androideabi-gcc -o conftest -g -O2 -I/usr/src/ndk-standalone-12/sysroot/usr/include conftest.c /usr/src/ndk-standalone-12/sysroot/usr/lib/libunistring.so -Wl,-rpath -Wl,/usr/src/ndk-standalone-12/sysroot/usr/lib >&5 /usr/src/ndk-standalone-12/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: /usr/src/ndk-standalone-12/sysroot/usr/lib/libunistring.so: error: undefined reference to 'frexp' collect2: ld returned 1 exit status I'll send you the complete log separately due to size. > I wasn’t aware of LT_LIB_M, thanks for the tip. > > > The compilation fails when libgc tries to use pthread features not > > implemented under Android (btw ./configure was happy to start > > compiling even if libgc wasn't present). Not sure where to go from > > here, maybe other projects use libgc and already faced the issue? > > Does it work if libgc is configure with --disable-threads? Not in 7.2 :/ libtool: compile: arm-linux-androideabi-gcc -DHAVE_CONFIG_H -I./include -I../include -I./libatomic_ops/src -I../libatomic_ops/src -fexceptions -g -O2 -fno-strict-aliasing -MT alloc.lo -MD -MP -MF .deps/alloc.Tpo -c ../alloc.c -o alloc.o ../alloc.c: In function 'GC_collect_a_little_inner': ../alloc.c:507:5: error: 'PTHREAD_CANCEL_DISABLE' undeclared (first use in this function) ../alloc.c:507:5: note: each undeclared identifier is reported only once for each function it appears in ../alloc.c: In function 'GC_try_to_collect_general': ../alloc.c:971:5: error: 'PTHREAD_CANCEL_DISABLE' undeclared (first use in this function) ../alloc.c: In function 'GC_collect_or_expand': ../alloc.c:1247:5: error: 'PTHREAD_CANCEL_DISABLE' undeclared (first use in this function) Makefile:1377: recipe for target 'alloc.lo' failed make[1]: *** [alloc.lo] Error 1 > > Which version of libgc do you recommend? > > 7.4.0 should be good. Hmmm, the one that requires yet another dependency (libatomic)? T-T I'll have a look. P.S.: I managed to cross-compile GNU FreeDink for Android today :D -- Sylvain ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: Compiling for Android 2014-06-21 20:06 ` beuc @ 2014-06-21 21:34 ` Ludovic Courtès 2014-06-22 14:08 ` beuc 2014-06-22 15:42 ` libunistring test beuc 0 siblings, 2 replies; 16+ messages in thread From: Ludovic Courtès @ 2014-06-21 21:34 UTC (permalink / raw) To: beuc; +Cc: guile-user Hello! beuc@beuc.net skribis: > On Fri, Jun 20, 2014 at 12:16:41PM +0200, Ludovic Courtès wrote: >> beuc@beuc.net skribis: >> >> > Is there anybody working on compiling Guile for Android? >> >> Not that I know of. >> >> > Here are some notes when trying to compile stable-2.0. >> > >> > First important note: I had to move "AC_CHECK_LIB(m, cos)" (which btw >> > could be rewritten at LT_LIB_M()) before gl_INIT in configure.ac, >> > otherwise libunistring would fail to be detected. >> >> Could you send the config.log of the failing thing? > > Selected bits: > > configure:14688: checking for libunistring > configure:14710: arm-linux-androideabi-gcc -o conftest -g -O2 -I/usr/src/ndk-standalone-12/sysroot/usr/include conftest.c /usr/src/ndk-standalone-12/sysroot/usr/lib/libunistring.so -Wl,-rpath -Wl,/usr/src/ndk-standalone-12/sysroot/usr/lib >&5 > /usr/src/ndk-standalone-12/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: /usr/src/ndk-standalone-12/sysroot/usr/lib/libunistring.so: error: undefined reference to 'frexp' > collect2: ld returned 1 exit status It looks like a libunistring issue no? Namely, libunistring assumed frexp to be available in libc, and it isn’t. Does Bionic provide that function in libm or something? >> I wasn’t aware of LT_LIB_M, thanks for the tip. >> >> > The compilation fails when libgc tries to use pthread features not >> > implemented under Android (btw ./configure was happy to start >> > compiling even if libgc wasn't present). Not sure where to go from >> > here, maybe other projects use libgc and already faced the issue? >> >> Does it work if libgc is configure with --disable-threads? > > Not in 7.2 :/ > > libtool: compile: arm-linux-androideabi-gcc -DHAVE_CONFIG_H -I./include -I../include -I./libatomic_ops/src -I../libatomic_ops/src -fexceptions -g -O2 -fno-strict-aliasing -MT alloc.lo -MD -MP -MF .deps/alloc.Tpo -c ../alloc.c -o alloc.o > ../alloc.c: In function 'GC_collect_a_little_inner': > ../alloc.c:507:5: error: 'PTHREAD_CANCEL_DISABLE' undeclared (first use in this function) Does it help to configure with --disable-parallel-mark? >> > Which version of libgc do you recommend? >> >> 7.4.0 should be good. > > Hmmm, the one that requires yet another dependency (libatomic)? T-T It’s just a part of libgc that has been separated. HTH, Ludo’. ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: Compiling for Android 2014-06-21 21:34 ` Ludovic Courtès @ 2014-06-22 14:08 ` beuc 2014-06-23 7:59 ` Ludovic Courtès 2014-07-04 14:01 ` Ludovic Courtès 2014-06-22 15:42 ` libunistring test beuc 1 sibling, 2 replies; 16+ messages in thread From: beuc @ 2014-06-22 14:08 UTC (permalink / raw) To: Ludovic Courtès; +Cc: guile-user Hi, On Sat, Jun 21, 2014 at 11:34:18PM +0200, Ludovic Courtès wrote: > beuc@beuc.net skribis: > > Selected bits: > > > > configure:14688: checking for libunistring > > configure:14710: arm-linux-androideabi-gcc -o conftest -g -O2 -I/usr/src/ndk-standalone-12/sysroot/usr/include conftest.c /usr/src/ndk-standalone-12/sysroot/usr/lib/libunistring.so -Wl,-rpath -Wl,/usr/src/ndk-standalone-12/sysroot/usr/lib >&5 > > /usr/src/ndk-standalone-12/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: /usr/src/ndk-standalone-12/sysroot/usr/lib/libunistring.so: error: undefined reference to 'frexp' > > collect2: ld returned 1 exit status > > It looks like a libunistring issue no? Namely, libunistring assumed > frexp to be available in libc, and it isn’t. > > Does Bionic provide that function in libm or something? (Whoever decided to make "-lm" mandatory in GCC probably has a few thousands curses set on him on his family for at least 5 generations ;)) There's a -lm in Android. $ ls -1 /usr/src/ndk-standalone-12-arm/sysroot/usr/lib/libm* /usr/src/ndk-standalone-12-arm/sysroot/usr/lib/libm.a /usr/src/ndk-standalone-12-arm/sysroot/usr/lib/libm_hard.a /usr/src/ndk-standalone-12-arm/sysroot/usr/lib/libm.so # 'hard' must be for hard-float archs You're right that it's an issue in libunistring, and I'm surprised it doesn't show up in GNU/Linux. Incidentally I switched to static builds and I don't have the problem for now, but dynamic builds may be required to be included in https://code.google.com/p/android-scripting/ which is a widespread platform for scripting languages. > >> > Which version of libgc do you recommend? > >> > >> 7.4.0 should be good. > > > > Hmmm, the one that requires yet another dependency (libatomic)? T-T > > It’s just a part of libgc that has been separated. Yeah but deps are painful when you manually recompile them one by one ;) Anyway, I bit the bullet and installed v2.4.2 which compiles fine! Another issue: ./configure went well but I wasn't told iconv.h was required: ../../libguile/print.c:27:19: fatal error: iconv.h: No such file or directory There's also an issue in libffi.pc where a '(libdir)' is copied verbatim in LIBS, causing bash error at link time, which I hand-fixed for now. In the end, I got a classical Android issue: CCLD guile /usr/src/ndk-standalone-12-arm/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: ./.libs/libguile-2.0.a(libguile_2.0_la-threads.o): in function scm_cancel_thread:../../libguile/threads.c:1175: error: undefined reference to 'pthread_cancel' ... classical because Bionic intentionally doesn't implement this function. Cheers! Sylvain ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: Compiling for Android 2014-06-22 14:08 ` beuc @ 2014-06-23 7:59 ` Ludovic Courtès 2014-06-23 18:59 ` beuc 2014-07-04 14:01 ` Ludovic Courtès 1 sibling, 1 reply; 16+ messages in thread From: Ludovic Courtès @ 2014-06-23 7:59 UTC (permalink / raw) To: beuc; +Cc: guile-user beuc@beuc.net skribis: > On Sat, Jun 21, 2014 at 11:34:18PM +0200, Ludovic Courtès wrote: >> beuc@beuc.net skribis: >> > Selected bits: >> > >> > configure:14688: checking for libunistring >> > configure:14710: arm-linux-androideabi-gcc -o conftest -g -O2 -I/usr/src/ndk-standalone-12/sysroot/usr/include conftest.c /usr/src/ndk-standalone-12/sysroot/usr/lib/libunistring.so -Wl,-rpath -Wl,/usr/src/ndk-standalone-12/sysroot/usr/lib >&5 >> > /usr/src/ndk-standalone-12/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: /usr/src/ndk-standalone-12/sysroot/usr/lib/libunistring.so: error: undefined reference to 'frexp' >> > collect2: ld returned 1 exit status >> >> It looks like a libunistring issue no? Namely, libunistring assumed >> frexp to be available in libc, and it isn’t. >> >> Does Bionic provide that function in libm or something? [...] > You're right that it's an issue in libunistring, and I'm surprised it > doesn't show up in GNU/Linux. Because in glibc frexp is part of libc.so, not libm.so. >> >> > Which version of libgc do you recommend? >> >> >> >> 7.4.0 should be good. >> > >> > Hmmm, the one that requires yet another dependency (libatomic)? T-T >> >> It’s just a part of libgc that has been separated. > > Yeah but deps are painful when you manually recompile them one by one ;) > Anyway, I bit the bullet and installed v2.4.2 which compiles fine! > > > Another issue: ./configure went well but I wasn't told iconv.h was > required: > ../../libguile/print.c:27:19: fatal error: iconv.h: No such file or directory Hmm, could you run “grep -i 'iconv.h' config.log”? There is a check for that, and normally Gnulib provides a replacement if needed. Apparently lib/iconv.h doesn’t exist here, right? > There's also an issue in libffi.pc where a '(libdir)' is copied > verbatim in LIBS, causing bash error at link time, which I hand-fixed > for now. What does libffi.pc look like? > In the end, I got a classical Android issue: > CCLD guile > /usr/src/ndk-standalone-12-arm/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: ./.libs/libguile-2.0.a(libguile_2.0_la-threads.o): in function scm_cancel_thread:../../libguile/threads.c:1175: error: undefined reference to 'pthread_cancel' > > ... classical because Bionic intentionally doesn't implement this function. You could either comment out the related code in libguile, or build Guile --without-threads. Is the rest of pthreads implemented? If yes, then we should add a test for pthread_cancel and arrange for that. Thanks, Ludo’. ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: Compiling for Android 2014-06-23 7:59 ` Ludovic Courtès @ 2014-06-23 18:59 ` beuc 2014-06-24 7:56 ` Ludovic Courtès ` (2 more replies) 0 siblings, 3 replies; 16+ messages in thread From: beuc @ 2014-06-23 18:59 UTC (permalink / raw) To: Ludovic Courtès; +Cc: guile-user Hey, On Mon, Jun 23, 2014 at 09:59:24AM +0200, Ludovic Courtès wrote: > beuc@beuc.net skribis: > > Another issue: ./configure went well but I wasn't told iconv.h was > > required: > > ../../libguile/print.c:27:19: fatal error: iconv.h: No such file or directory > > Hmm, could you run “grep -i 'iconv.h' config.log”? There is a check for > that, and normally Gnulib provides a replacement if needed. > > Apparently lib/iconv.h doesn’t exist here, right? Not if I don't install it. [/me rebuilds the full environment with/without libs for the Nth time] $ grep -i -C2 'iconv\.h' config.log # tests excerpts removed configure:7751: $? = 0 configure:7751: result: yes configure:7751: checking for iconv.h configure:7751: arm-linux-androideabi-gcc -c -g -O2 conftest.c >&5 conftest.c:70:19: fatal error: iconv.h: No such file or directory compilation terminated. configure:7751: $? = 1 -- configure:12557: checking for iconv configure:12581: arm-linux-androideabi-gcc -o conftest -g -O2 conftest.c >&5 conftest.c:124:19: fatal error: iconv.h: No such file or directory compilation terminated. configure:12581: $? = 1 -- | } configure:12605: arm-linux-androideabi-gcc -o conftest -g -O2 conftest.c -liconv >&5 conftest.c:124:19: fatal error: iconv.h: No such file or directory compilation terminated. configure:12605: $? = 1 -- gl_cv_next_dirent_h='<dirent.h>' gl_cv_next_fcntl_h='<fcntl.h>' gl_cv_next_iconv_h='<iconv.h>' gl_cv_next_langinfo_h='<langinfo.h>' gl_cv_next_locale_h='<locale.h>' -- NEXT_AS_FIRST_DIRECTIVE_FCNTL_H='<fcntl.h>' NEXT_AS_FIRST_DIRECTIVE_FLOAT_H='' NEXT_AS_FIRST_DIRECTIVE_ICONV_H='<iconv.h>' NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H='<langinfo.h>' NEXT_AS_FIRST_DIRECTIVE_LOCALE_H='<locale.h>' -- NEXT_FCNTL_H='<fcntl.h>' NEXT_FLOAT_H='' NEXT_ICONV_H='<iconv.h>' NEXT_LANGINFO_H='<langinfo.h>' NEXT_LOCALE_H='<locale.h>' > > There's also an issue in libffi.pc where a '(libdir)' is copied > > verbatim in LIBS, causing bash error at link time, which I hand-fixed > > for now. > > What does libffi.pc look like? prefix=/usr/src/ndk-standalone-12-arm/sysroot/usr exec_prefix=${prefix} libdir=${exec_prefix}/lib toolexeclibdir=$(libdir) ... (instead of ${libdir}) > > In the end, I got a classical Android issue: > > CCLD guile > > /usr/src/ndk-standalone-12-arm/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: ./.libs/libguile-2.0.a(libguile_2.0_la-threads.o): in function scm_cancel_thread:../../libguile/threads.c:1175: error: undefined reference to 'pthread_cancel' > > > > ... classical because Bionic intentionally doesn't implement this function. > > You could either comment out the related code in libguile, or build > Guile --without-threads. libguile-2.0 builds (yay!) and we start getting interesting errors: make[2]: Entering directory '/mnt/workdir/guile/cross-android/module' GUILEC ice-9/eval.go Backtrace: In ice-9/boot-9.scm: 157: 8 ;;; note: source file /home/personnel/workdir/guile/cross-android/../module/system/vm/frame.scm ;;; newer than compiled /usr/lib/guile/2.0/ccache/system/vm/frame.go ;;; note: source file /home/personnel/workdir/guile/cross-android/../module/system/vm/program.scm ;;; newer than compiled /usr/lib/guile/2.0/ccache/system/vm/program.go ;;; note: source file /home/personnel/workdir/guile/cross-android/../module/system/vm/instruction.scm ;;; newer than compiled /usr/lib/guile/2.0/ccache/system/vm/instruction.go ;;; note: source file /home/personnel/workdir/guile/cross-android/../module/system/vm/objcode.scm ;;; newer than compiled /usr/lib/guile/2.0/ccache/system/vm/objcode.go ;;; note: source file /home/personnel/workdir/guile/cross-android/../module/srfi/srfi-26.scm ;;; newer than compiled /usr/lib/guile/2.0/ccache/srfi/srfi-26.go [catch #t #<catch-closure 179d080> ...] In unknown file: ?: 7 [apply-smob/1 #<catch-closure 179d080>] In ice-9/boot-9.scm: 63: 6 [call-with-prompt prompt0 ...] In ice-9/eval.scm: 432: 5 [eval # #] 387: 4 [eval # #] In srfi/srfi-1.scm: 619: 3 [for-each #<procedure 1894f00 at scripts/compile.scm:179:14 (file)> #] In scripts/compile.scm: 182: 2 [#<procedure 1894f00 at scripts/compile.scm:179:14 (file)> "../../module/ice-9/eval.scm"] In system/base/target.scm: 57: 1 [with-target "arm-unknown-linux-androideabi" ...] In unknown file: ?: 0 [scm-error misc-error #f "~A ~S" ("unknown CPU endianness" "arm") #f] ERROR: In procedure scm-error: ERROR: unknown CPU endianness "arm" Makefile:2167: recipe for target 'ic > Is the rest of pthreads implemented? If yes, then we should add a test > for pthread_cancel and arrange for that. Apparently yes and that'd be the only missing function. Check ./docs/text/system/libc/OVERVIEW.text from the Android NDK: PThread implementation: Bionic's C library comes with its own pthread implementation bundled in. This is different from other historical C libraries which: - place it in an external library (-lpthread) - play linker tricks with weak symbols at dynamic link time The support for real-time features (a.k.a. -lrt) is also bundled in the C library. The implementation is based on futexes and strives to provide *very* short code paths for common operations. Notable features are the following: - pthread_mutex_t, pthread_cond_t are only 4 bytes each. - Normal, recursive and error-check mutexes are supported, and the code path is heavily optimized for the normal case, which is used most of the time. - Process-shared mutexes and condition variables are not supported. Their implementation requires far more complexity and was absolutely not needed for Android (which uses other inter-process synchronization capabilities). Note that they could be added in the future without breaking the ABI by specifying more sophisticated code paths (which may make the common paths slightly slower though). - There is currently no support for read/write locks, priority-ceiling in mutexes and other more advanced features. Again, the main idea being that this was not needed for Android at all but could be added in the future. pthread_cancel(): pthread_cancel() will *not* be supported in Bionic, because doing this would involve making the C library significantly bigger for very little benefit. Consider that: - A proper implementation must insert pthread cancellation checks in a lot of different places of the C library. And conformance is very difficult to test properly. - A proper implementation must also clean up resources, like releasing memory, or unlocking mutexes, properly if the cancellation happens in a complex function (e.g. inside gethostbyname() or fprintf() + complex formatting rules). This tends to slow down the path of many functions. - pthread cancellation cannot stop all threads: e.g. it can't do anything against an infinite loop - pthread cancellation itself has short-comings and isn't very portable (see http://advogato.org/person/slamb/diary.html?start=49 for example). All of this is contrary to the Bionic design goals. If your code depends on thread cancellation, please consider alternatives. Note however that Bionic does implement pthread_cleanup_push() and pthread_cleanup_pop(), which can be used to handle cleanups that happen when a thread voluntarily exits through pthread_exit() or returning from its main function. pthread_once(): Do not call fork() within a callback provided to pthread_once(). Doing this may result in a deadlock in the child process the next time it calls pthread_once(). Also, you can't throw a C++ Exception from the callback (see C++ Exception Support below). The current implementation of pthread_once() lacks the necessary support of multi-core-safe double-checked-locking (read and write barriers). -- Sylvain ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: Compiling for Android 2014-06-23 18:59 ` beuc @ 2014-06-24 7:56 ` Ludovic Courtès 2014-06-25 21:23 ` beuc 2014-06-24 14:04 ` Mark H Weaver 2014-07-04 14:00 ` Ludovic Courtès 2 siblings, 1 reply; 16+ messages in thread From: Ludovic Courtès @ 2014-06-24 7:56 UTC (permalink / raw) To: beuc; +Cc: guile-user [-- Attachment #1: Type: text/plain, Size: 3773 bytes --] beuc@beuc.net skribis: > Hey, > > On Mon, Jun 23, 2014 at 09:59:24AM +0200, Ludovic Courtès wrote: >> beuc@beuc.net skribis: >> > Another issue: ./configure went well but I wasn't told iconv.h was >> > required: >> > ../../libguile/print.c:27:19: fatal error: iconv.h: No such file or directory >> >> Hmm, could you run “grep -i 'iconv.h' config.log”? There is a check for >> that, and normally Gnulib provides a replacement if needed. >> >> Apparently lib/iconv.h doesn’t exist here, right? > > Not if I don't install it. I was referring to $top_builddir/lib/iconv.h in Guile. Normally Gnulib would create it as it sees fit. Is it the case here? > $ grep -i -C2 'iconv\.h' config.log # tests excerpts removed Hmm, I don’t see GL_GENERATE_ICONV_H_TRUE here. >> > There's also an issue in libffi.pc where a '(libdir)' is copied >> > verbatim in LIBS, causing bash error at link time, which I hand-fixed >> > for now. >> >> What does libffi.pc look like? > > prefix=/usr/src/ndk-standalone-12-arm/sysroot/usr > exec_prefix=${prefix} > libdir=${exec_prefix}/lib > toolexeclibdir=$(libdir) > ... > (instead of ${libdir}) That’s weird, libffi 3.0.13 doesn’t have this problem. What version is it? >> > In the end, I got a classical Android issue: >> > CCLD guile >> > /usr/src/ndk-standalone-12-arm/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: ./.libs/libguile-2.0.a(libguile_2.0_la-threads.o): in function scm_cancel_thread:../../libguile/threads.c:1175: error: undefined reference to 'pthread_cancel' >> > >> > ... classical because Bionic intentionally doesn't implement this function. >> >> You could either comment out the related code in libguile, or build >> Guile --without-threads. > > libguile-2.0 builds (yay!) and we start getting interesting errors: Cool! :-) > make[2]: Entering directory '/mnt/workdir/guile/cross-android/module' > GUILEC ice-9/eval.go > Backtrace: > In ice-9/boot-9.scm: > 157: 8 ;;; note: source file /home/personnel/workdir/guile/cross-android/../module/system/vm/frame.scm > ;;; newer than compiled /usr/lib/guile/2.0/ccache/system/vm/frame.go > ;;; note: source file /home/personnel/workdir/guile/cross-android/../module/system/vm/program.scm > ;;; newer than compiled /usr/lib/guile/2.0/ccache/system/vm/program.go > ;;; note: source file /home/personnel/workdir/guile/cross-android/../module/system/vm/instruction.scm > ;;; newer than compiled /usr/lib/guile/2.0/ccache/system/vm/instruction.go > ;;; note: source file /home/personnel/workdir/guile/cross-android/../module/system/vm/objcode.scm > ;;; newer than compiled /usr/lib/guile/2.0/ccache/system/vm/objcode.go > ;;; note: source file /home/personnel/workdir/guile/cross-android/../module/srfi/srfi-26.scm > ;;; newer than compiled /usr/lib/guile/2.0/ccache/srfi/srfi-26.go > [catch #t #<catch-closure 179d080> ...] > In unknown file: > ?: 7 [apply-smob/1 #<catch-closure 179d080>] > In ice-9/boot-9.scm: > 63: 6 [call-with-prompt prompt0 ...] > In ice-9/eval.scm: > 432: 5 [eval # #] > 387: 4 [eval # #] > In srfi/srfi-1.scm: > 619: 3 [for-each #<procedure 1894f00 at scripts/compile.scm:179:14 (file)> #] > In scripts/compile.scm: > 182: 2 [#<procedure 1894f00 at scripts/compile.scm:179:14 (file)> "../../module/ice-9/eval.scm"] > In system/base/target.scm: > 57: 1 [with-target "arm-unknown-linux-androideabi" ...] > In unknown file: > ?: 0 [scm-error misc-error #f "~A ~S" ("unknown CPU endianness" "arm") #f] > > ERROR: In procedure scm-error: > ERROR: unknown CPU endianness "arm" > Makefile:2167: recipe for target 'ic This patch should solve the problem: [-- Warning: decoded text below may be mangled, UTF-8 assumed --] [-- Attachment #2: Type: text/x-patch, Size: 803 bytes --] diff --git a/module/system/base/target.scm b/module/system/base/target.scm index c74ae67..cefa951 100644 --- a/module/system/base/target.scm +++ b/module/system/base/target.scm @@ -1,6 +1,6 @@ ;;; Compilation targets -;; Copyright (C) 2011, 2012, 2013 Free Software Foundation, Inc. +;; Copyright (C) 2011, 2012, 2013, 2014 Free Software Foundation, Inc. ;; This library is free software; you can redistribute it and/or ;; modify it under the terms of the GNU Lesser General Public @@ -72,6 +72,8 @@ (endianness big)) ((string-match "^arm.*el" cpu) (endianness little)) + ((string=? "arm" cpu) ;ARMs are LE by default + (endianness little)) (else (error "unknown CPU endianness" cpu))))) [-- Attachment #3: Type: text/plain, Size: 338 bytes --] Just to be sure, could you run config.guess on the target machine? >> Is the rest of pthreads implemented? If yes, then we should add a test >> for pthread_cancel and arrange for that. > > Apparently yes and that'd be the only missing function. OK, I’ll commit something to disable handle that case. Thanks! Ludo’. ^ permalink raw reply related [flat|nested] 16+ messages in thread
* Re: Compiling for Android 2014-06-24 7:56 ` Ludovic Courtès @ 2014-06-25 21:23 ` beuc 2014-06-25 22:04 ` Ludovic Courtès 0 siblings, 1 reply; 16+ messages in thread From: beuc @ 2014-06-25 21:23 UTC (permalink / raw) To: Ludovic Courtès; +Cc: guile-user Hey, On Tue, Jun 24, 2014 at 09:56:07AM +0200, Ludovic Courtès wrote: > beuc@beuc.net skribis: > > Hey, > > > > On Mon, Jun 23, 2014 at 09:59:24AM +0200, Ludovic Courtès wrote: > >> beuc@beuc.net skribis: > >> > Another issue: ./configure went well but I wasn't told iconv.h was > >> > required: > >> > ../../libguile/print.c:27:19: fatal error: iconv.h: No such file or directory > >> > >> Hmm, could you run “grep -i 'iconv.h' config.log”? There is a check for > >> that, and normally Gnulib provides a replacement if needed. > >> > >> Apparently lib/iconv.h doesn’t exist here, right? > > > > Not if I don't install it. > > I was referring to $top_builddir/lib/iconv.h in Guile. Normally Gnulib > would create it as it sees fit. Is it the case here? > > > $ grep -i -C2 'iconv\.h' config.log # tests excerpts removed > > Hmm, I don’t see GL_GENERATE_ICONV_H_TRUE here. config.h seems consistent, it seems gnulib didn't bother creating it actually: /* Define if you have the iconv() function and it works. */ /* #undef HAVE_ICONV */ /* Define to 1 if you have the <iconv.h> header file. */ /* #undef HAVE_ICONV_H */ > >> > There's also an issue in libffi.pc where a '(libdir)' is copied > >> > verbatim in LIBS, causing bash error at link time, which I hand-fixed > >> > for now. > >> > >> What does libffi.pc look like? > > > > prefix=/usr/src/ndk-standalone-12-arm/sysroot/usr > > exec_prefix=${prefix} > > libdir=${exec_prefix}/lib > > toolexeclibdir=$(libdir) > > ... > > (instead of ${libdir}) > > That’s weird, libffi 3.0.13 doesn’t have this problem. What version is it? v3.1. That seems to be an issue in pkgconf: https://github.com/pkgconf/pkgconf/issues/67 (before you ask, pkgconf is a reimplementation of pkg-config that doesn't depend on itself and whose maintainer is more willing to implement changes) > >> > In the end, I got a classical Android issue: > >> > CCLD guile > >> > /usr/src/ndk-standalone-12-arm/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: ./.libs/libguile-2.0.a(libguile_2.0_la-threads.o): in function scm_cancel_thread:../../libguile/threads.c:1175: error: undefined reference to 'pthread_cancel' > >> > > >> > ... classical because Bionic intentionally doesn't implement this function. > >> > >> You could either comment out the related code in libguile, or build > >> Guile --without-threads. > > > > libguile-2.0 builds (yay!) and we start getting interesting errors: > > Cool! :-) > > > make[2]: Entering directory '/mnt/workdir/guile/cross-android/module' > > GUILEC ice-9/eval.go > > Backtrace: > > In ice-9/boot-9.scm: > > 157: 8 ;;; note: source file /home/personnel/workdir/guile/cross-android/../module/system/vm/frame.scm > > ;;; newer than compiled /usr/lib/guile/2.0/ccache/system/vm/frame.go > > ;;; note: source file /home/personnel/workdir/guile/cross-android/../module/system/vm/program.scm > > ;;; newer than compiled /usr/lib/guile/2.0/ccache/system/vm/program.go > > ;;; note: source file /home/personnel/workdir/guile/cross-android/../module/system/vm/instruction.scm > > ;;; newer than compiled /usr/lib/guile/2.0/ccache/system/vm/instruction.go > > ;;; note: source file /home/personnel/workdir/guile/cross-android/../module/system/vm/objcode.scm > > ;;; newer than compiled /usr/lib/guile/2.0/ccache/system/vm/objcode.go > > ;;; note: source file /home/personnel/workdir/guile/cross-android/../module/srfi/srfi-26.scm > > ;;; newer than compiled /usr/lib/guile/2.0/ccache/srfi/srfi-26.go > > [catch #t #<catch-closure 179d080> ...] > > In unknown file: > > ?: 7 [apply-smob/1 #<catch-closure 179d080>] > > In ice-9/boot-9.scm: > > 63: 6 [call-with-prompt prompt0 ...] > > In ice-9/eval.scm: > > 432: 5 [eval # #] > > 387: 4 [eval # #] > > In srfi/srfi-1.scm: > > 619: 3 [for-each #<procedure 1894f00 at scripts/compile.scm:179:14 (file)> #] > > In scripts/compile.scm: > > 182: 2 [#<procedure 1894f00 at scripts/compile.scm:179:14 (file)> "../../module/ice-9/eval.scm"] > > In system/base/target.scm: > > 57: 1 [with-target "arm-unknown-linux-androideabi" ...] > > In unknown file: > > ?: 0 [scm-error misc-error #f "~A ~S" ("unknown CPU endianness" "arm") #f] > > > > ERROR: In procedure scm-error: > > ERROR: unknown CPU endianness "arm" > > Makefile:2167: recipe for target 'ic > > This patch should solve the problem: > > diff --git a/module/system/base/target.scm b/module/system/base/target.scm > index c74ae67..cefa951 100644 > --- a/module/system/base/target.scm > +++ b/module/system/base/target.scm > @@ -1,6 +1,6 @@ > ;;; Compilation targets > > -;; Copyright (C) 2011, 2012, 2013 Free Software Foundation, Inc. > +;; Copyright (C) 2011, 2012, 2013, 2014 Free Software Foundation, Inc. > > ;; This library is free software; you can redistribute it and/or > ;; modify it under the terms of the GNU Lesser General Public > @@ -72,6 +72,8 @@ > (endianness big)) > ((string-match "^arm.*el" cpu) > (endianness little)) > + ((string=? "arm" cpu) ;ARMs are LE by default > + (endianness little)) > (else > (error "unknown CPU endianness" cpu))))) > It is worth noting that this patch is required for the native, pre-existing guile that is used for cross-compiling (I didn't realize my system guile was in use). After quite some compilation time I now get: In ice-9/eval.scm: 411: 5 [eval # #] In ice-9/psyntax.scm: 1106: 4 [expand-top-sequence ((eval-when # #)) () ((top)) ...] 989: 3 [scan ((eval-when # #)) () ((top)) ...] 279: 2 [scan ((load-extension # "scm_init_foreign_object")) () ((top)) ...] In unknown file: ?: 1 [load-extension "libguile-2.0" "scm_init_foreign_object"] In ice-9/boot-9.scm: 106: 0 [#<procedure 144d8c0 at ice-9/boot-9.scm:97:6 (thrown-k . args)> misc-error ...] ice-9/boot-9.scm:106:20: In procedure #<procedure 144d8c0 at ice-9/boot-9.scm:97:6 (thrown-k . args)>: ice-9/boot-9.scm:106:20: In procedure dynamic-pointer: Symbol not found: scm_init_foreign_object Makefile:2167: recipe for target 'system/foreign-object.go' failed I'm not sure I'm interested in compiling all guile modules myself though. I haven't thought about it much but I intend to ship a pretty minimal guile in GNU FreeDink so user can script their game, without being able to e.g. mess with the player's filesystem. > Just to be sure, could you run config.guess on the target machine? armv7l-unknown-linux-gnueabihf - but I had to some much trouble running config.guess that you should take it with a grain salt. In particular there's no /tmp, or about anything FHS-compliant for that matter. Android ain't POSIX. The host type I use when cross-compiling is 'arm-unknown-linux-androideabi'. > >> Is the rest of pthreads implemented? If yes, then we should add a test > >> for pthread_cancel and arrange for that. > > > > Apparently yes and that'd be the only missing function. > > OK, I’ll commit something to disable handle that case. Nice! -- Sylvain ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: Compiling for Android 2014-06-25 21:23 ` beuc @ 2014-06-25 22:04 ` Ludovic Courtès 0 siblings, 0 replies; 16+ messages in thread From: Ludovic Courtès @ 2014-06-25 22:04 UTC (permalink / raw) To: beuc; +Cc: guile-user Salut ! beuc@beuc.net skribis: > After quite some compilation time I now get: > In ice-9/eval.scm: > 411: 5 [eval # #] > In ice-9/psyntax.scm: > 1106: 4 [expand-top-sequence ((eval-when # #)) () ((top)) ...] > 989: 3 [scan ((eval-when # #)) () ((top)) ...] > 279: 2 [scan ((load-extension # "scm_init_foreign_object")) () ((top)) ...] > In unknown file: > ?: 1 [load-extension "libguile-2.0" "scm_init_foreign_object"] > In ice-9/boot-9.scm: > 106: 0 [#<procedure 144d8c0 at ice-9/boot-9.scm:97:6 (thrown-k . args)> misc-error ...] > > ice-9/boot-9.scm:106:20: In procedure #<procedure 144d8c0 at ice-9/boot-9.scm:97:6 (thrown-k . args)>: > ice-9/boot-9.scm:106:20: In procedure dynamic-pointer: Symbol not found: scm_init_foreign_object > Makefile:2167: recipe for target 'system/foreign-object.go' failed Are the native and cross Guile the same version? (Normally ./configure of the cross-compiled Guile makes sure of that.) Does module/ice-9/i18n.go cross-build correctly? Or does it fail similarly? > I'm not sure I'm interested in compiling all guile modules myself > though. I haven't thought about it much but I intend to ship a pretty > minimal guile in GNU FreeDink so user can script their game, without > being able to e.g. mess with the player's filesystem. > > >> Just to be sure, could you run config.guess on the target machine? > > armv7l-unknown-linux-gnueabihf - but I had to some much trouble > running config.guess that you should take it with a grain salt. OK. Thanks, Ludo’. ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: Compiling for Android 2014-06-23 18:59 ` beuc 2014-06-24 7:56 ` Ludovic Courtès @ 2014-06-24 14:04 ` Mark H Weaver 2014-07-04 14:00 ` Ludovic Courtès 2 siblings, 0 replies; 16+ messages in thread From: Mark H Weaver @ 2014-06-24 14:04 UTC (permalink / raw) To: beuc; +Cc: Ludovic Courtès, guile-user beuc@beuc.net writes: > Check ./docs/text/system/libc/OVERVIEW.text from the Android NDK: [...] > pthread_once(): [...] > The current implementation of pthread_once() lacks the necessary support of > multi-core-safe double-checked-locking (read and write barriers). This is the only bit that worries me. It sounds like Bionic's pthread_once() might not work properly on multi-core systems. We rely on 'pthread_once' for thread-safe lazy initialization in libguile. Mark ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: Compiling for Android 2014-06-23 18:59 ` beuc 2014-06-24 7:56 ` Ludovic Courtès 2014-06-24 14:04 ` Mark H Weaver @ 2014-07-04 14:00 ` Ludovic Courtès 2 siblings, 0 replies; 16+ messages in thread From: Ludovic Courtès @ 2014-07-04 14:00 UTC (permalink / raw) To: beuc; +Cc: guile-user beuc@beuc.net skribis: > In unknown file: > ?: 0 [scm-error misc-error #f "~A ~S" ("unknown CPU endianness" "arm") #f] > > ERROR: In procedure scm-error: > ERROR: unknown CPU endianness "arm" > Makefile:2167: recipe for target 'ic Fixed in df8c52e, which will be in 2.0.12. Ludo’. ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: Compiling for Android 2014-06-22 14:08 ` beuc 2014-06-23 7:59 ` Ludovic Courtès @ 2014-07-04 14:01 ` Ludovic Courtès 1 sibling, 0 replies; 16+ messages in thread From: Ludovic Courtès @ 2014-07-04 14:01 UTC (permalink / raw) To: beuc; +Cc: guile-user beuc@beuc.net skribis: > In the end, I got a classical Android issue: > CCLD guile > /usr/src/ndk-standalone-12-arm/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: ./.libs/libguile-2.0.a(libguile_2.0_la-threads.o): in function scm_cancel_thread:../../libguile/threads.c:1175: error: undefined reference to 'pthread_cancel' > > ... classical because Bionic intentionally doesn't implement this function. Should be fixed by f184e88, which simply omits ‘cancel-thread’ when ‘pthread_cancel’ is unavailable. Ludo’. ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: libunistring test 2014-06-21 21:34 ` Ludovic Courtès 2014-06-22 14:08 ` beuc @ 2014-06-22 15:42 ` beuc 2014-06-23 8:04 ` Ludovic Courtès 1 sibling, 1 reply; 16+ messages in thread From: beuc @ 2014-06-22 15:42 UTC (permalink / raw) To: Ludovic Courtès; +Cc: guile-user On Sat, Jun 21, 2014 at 11:34:18PM +0200, Ludovic Courtès wrote: > beuc@beuc.net skribis: > > On Fri, Jun 20, 2014 at 12:16:41PM +0200, Ludovic Courtès wrote: > >> beuc@beuc.net skribis: > >> > First important note: I had to move "AC_CHECK_LIB(m, cos)" (which btw > >> > could be rewritten at LT_LIB_M()) before gl_INIT in configure.ac, > >> > otherwise libunistring would fail to be detected. > >> > >> Could you send the config.log of the failing thing? > > > > Selected bits: > > > > configure:14688: checking for libunistring > > configure:14710: arm-linux-androideabi-gcc -o conftest -g -O2 -I/usr/src/ndk-standalone-12/sysroot/usr/include conftest.c /usr/src/ndk-standalone-12/sysroot/usr/lib/libunistring.so -Wl,-rpath -Wl,/usr/src/ndk-standalone-12/sysroot/usr/lib >&5 > > /usr/src/ndk-standalone-12/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: /usr/src/ndk-standalone-12/sysroot/usr/lib/libunistring.so: error: undefined reference to 'frexp' > > collect2: ld returned 1 exit status > > It looks like a libunistring issue no? Namely, libunistring assumed > frexp to be available in libc, and it isn’t. Incidentally, do you know why the test is referencing the .so directly? That seems to be the cause of the problem I'm trying to isolate the issue with a basic gnulib project and I have a much simpler test: configure:7110: checking for libunistring configure:7132: arm-linux-androideabi-gcc -o conftest -g -O2 conftest.c -lunistring >&5 configure:7132: $? = 0 configure:7142: result: yes -- Sylvain ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: libunistring test 2014-06-22 15:42 ` libunistring test beuc @ 2014-06-23 8:04 ` Ludovic Courtès 2014-06-23 16:48 ` beuc 0 siblings, 1 reply; 16+ messages in thread From: Ludovic Courtès @ 2014-06-23 8:04 UTC (permalink / raw) To: beuc; +Cc: guile-user beuc@beuc.net skribis: > On Sat, Jun 21, 2014 at 11:34:18PM +0200, Ludovic Courtès wrote: >> beuc@beuc.net skribis: >> > On Fri, Jun 20, 2014 at 12:16:41PM +0200, Ludovic Courtès wrote: >> >> beuc@beuc.net skribis: >> >> > First important note: I had to move "AC_CHECK_LIB(m, cos)" (which btw >> >> > could be rewritten at LT_LIB_M()) before gl_INIT in configure.ac, >> >> > otherwise libunistring would fail to be detected. >> >> >> >> Could you send the config.log of the failing thing? >> > >> > Selected bits: >> > >> > configure:14688: checking for libunistring >> > configure:14710: arm-linux-androideabi-gcc -o conftest -g -O2 -I/usr/src/ndk-standalone-12/sysroot/usr/include conftest.c /usr/src/ndk-standalone-12/sysroot/usr/lib/libunistring.so -Wl,-rpath -Wl,/usr/src/ndk-standalone-12/sysroot/usr/lib >&5 >> > /usr/src/ndk-standalone-12/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: /usr/src/ndk-standalone-12/sysroot/usr/lib/libunistring.so: error: undefined reference to 'frexp' >> > collect2: ld returned 1 exit status >> >> It looks like a libunistring issue no? Namely, libunistring assumed >> frexp to be available in libc, and it isn’t. > > Incidentally, do you know why the test is referencing the .so directly? That comes from Gnulib’s AC_LIB_HAVE_LINKFLAGS, and I believe this explanation is this comment (from lib-link.m4): dnl Using DIR/libNAME.so during linking hardcodes DIR into the dnl resulting binary. Ludo’. ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: libunistring test 2014-06-23 8:04 ` Ludovic Courtès @ 2014-06-23 16:48 ` beuc 0 siblings, 0 replies; 16+ messages in thread From: beuc @ 2014-06-23 16:48 UTC (permalink / raw) To: Ludovic Courtès; +Cc: guile-user [-- Attachment #1: Type: text/plain, Size: 1832 bytes --] Hi, On Mon, Jun 23, 2014 at 10:04:51AM +0200, Ludovic Courtès wrote: > beuc@beuc.net skribis: > > On Sat, Jun 21, 2014 at 11:34:18PM +0200, Ludovic Courtès wrote: > >> beuc@beuc.net skribis: > >> > On Fri, Jun 20, 2014 at 12:16:41PM +0200, Ludovic Courtès wrote: > >> >> beuc@beuc.net skribis: > >> >> > First important note: I had to move "AC_CHECK_LIB(m, cos)" (which btw > >> >> > could be rewritten at LT_LIB_M()) before gl_INIT in configure.ac, > >> >> > otherwise libunistring would fail to be detected. > >> >> > >> >> Could you send the config.log of the failing thing? > >> > > >> > Selected bits: > >> > > >> > configure:14688: checking for libunistring > >> > configure:14710: arm-linux-androideabi-gcc -o conftest -g -O2 -I/usr/src/ndk-standalone-12/sysroot/usr/include conftest.c /usr/src/ndk-standalone-12/sysroot/usr/lib/libunistring.so -Wl,-rpath -Wl,/usr/src/ndk-standalone-12/sysroot/usr/lib >&5 > >> > /usr/src/ndk-standalone-12/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: /usr/src/ndk-standalone-12/sysroot/usr/lib/libunistring.so: error: undefined reference to 'frexp' > >> > collect2: ld returned 1 exit status > >> > >> It looks like a libunistring issue no? Namely, libunistring assumed > >> frexp to be available in libc, and it isn’t. > > > > Incidentally, do you know why the test is referencing the .so directly? > > That comes from Gnulib’s AC_LIB_HAVE_LINKFLAGS, and I believe this > explanation is this comment (from lib-link.m4): > > dnl Using DIR/libNAME.so during linking hardcodes DIR into the > dnl resulting binary. I mean I made a minimal project with gnulib's libunistring module, and it checks using '-lunistring'. I attach it. So there's a difference somewhere. -- Sylvain [-- Attachment #2: testunistring.tar.gz --] [-- Type: application/octet-stream, Size: 3782 bytes --] ^ permalink raw reply [flat|nested] 16+ messages in thread
end of thread, other threads:[~2014-07-04 14:01 UTC | newest] Thread overview: 16+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2014-06-18 21:54 Compiling for Android beuc 2014-06-20 10:16 ` Ludovic Courtès 2014-06-21 20:06 ` beuc 2014-06-21 21:34 ` Ludovic Courtès 2014-06-22 14:08 ` beuc 2014-06-23 7:59 ` Ludovic Courtès 2014-06-23 18:59 ` beuc 2014-06-24 7:56 ` Ludovic Courtès 2014-06-25 21:23 ` beuc 2014-06-25 22:04 ` Ludovic Courtès 2014-06-24 14:04 ` Mark H Weaver 2014-07-04 14:00 ` Ludovic Courtès 2014-07-04 14:01 ` Ludovic Courtès 2014-06-22 15:42 ` libunistring test beuc 2014-06-23 8:04 ` Ludovic Courtès 2014-06-23 16:48 ` beuc
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).