View Revisions: Issue #6693

Summary 0006693: unable to cross-compile for android due to MHD_NONNULL
Revision 2021-01-30 12:59 by Christian Grothoff
Description I'm trying to cross-compile for android (archs armeabi-v7a, arm64-v8a, x86, x86_64 and ABI 16), using NDK 22.0.7026061 and the included clang (11.0.5).
My host is x86_64 linux.
I created Application.mk and Android.mk but get theses errors when running ndk-build:

src/include/microhttpd2.h:1494:1: error: expected function body after function declarator
MHD_NONNULL (1);
^
/path/to/src/include/microhttpd2.h:286:26: note: expanded from macro 'MHD_NONNULL'
#define MHD_NONNULL(...) __THROW __nonnull ((__VA_ARGS__))

I've tried following steps[1] to cross-compile for, e.g., armeabi-v7a, but my config output always says "Cross-compiling: no".
Also, running
./configure --target=arm-linux-androideabi --host=arm-linux-androideabi --disable-doc --disable-examples
make
results in:
$ file src/microhttpd/.libs/libmicrohttpd.so
src/microhttpd/.libs/libmicrohttpd.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, BuildID[sha1]=aac0a89534cbd27bf4c33c4b7b98ed7165bb4380, not stripped
and not a 32bit ARM as i'd expect (perhaps i passed wrong parameters).

I've seen this[2] bug but it seems to be stale.

I've also noticed that in src/include/microhttpd2.h:286 the comment above reads "Todo: port to non-gcc platforms."
Does this mean it's not usable with clang yet?

[1] https://libmicrohttpd.gnu.narkive.com/QVMVGEL0/how-to-compile-mhd-for-armv7
[2] https://bugs.gnunet.org/view.php?id=4913
Revision 2021-01-12 19:09 by nmm
Description I'm trying to cross-compile for android (archs armeabi-v7a, arm64-v8a, x86, x86_64 and ABI 16), using NDK 22.0.7026061 and the included clang (11.0.5).
My host is x86_64 linux.
I created Application.mk and Android.mk but get theses errors when running ndk-build:

src/include/microhttpd2.h:1494:1: error: expected function body after function declarator
MHD_NONNULL (1);
^
/path/to/src/include/microhttpd2.h:286:26: note: expanded from macro 'MHD_NONNULL'
#define MHD_NONNULL(...) __THROW __nonnull ((__VA_ARGS__))

I've tried following steps[1] to cross-compile for, e.g., armeabi-v7a, but my config output always says "Cross-compiling: no".
Also, running
./configure --target=arm-linux-androideabi --host=arm-linux-androideabi --disable-doc --disable-examples
make
results in:
$ file src/microhttpd/.libs/libmicrohttpd.so
src/microhttpd/.libs/libmicrohttpd.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, BuildID[sha1]=aac0a89534cbd27bf4c33c4b7b98ed7165bb4380, not stripped
and not a 32bit ARM as i'd expect (perhaps i passed wrong parameters).

I've seen this[2] bug but it seems to be stale.

I've also noticed that in src/include/microhttpd2.h:286 the comment above reads "Todo: port to non-gcc platforms."
Does this mean it's not usable with clang yet?

[1] https://libmicrohttpd.gnu.narkive.com/QVMVGEL0/how-to-compile-mhd-for-armv7
[2] https://bugs.gnunet.org/view.php?id=4913