Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android build error with Autotools #52

Open
kambala-decapitator opened this issue Dec 22, 2024 · 0 comments
Open

Android build error with Autotools #52

kambala-decapitator opened this issue Dec 22, 2024 · 0 comments

Comments

@kambala-decapitator
Copy link

kambala-decapitator commented Dec 22, 2024

The error itself:

In file included from /Users/kambala/.conan2/p/b/opusf04736e93b9f5b/b/src/src/http.c:345:
In file included from /Users/kambala/.conan2/p/androc439eef6aa9d6/p/bin/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include/arpa/inet.h:32:
In file included from /Users/kambala/.conan2/p/androc439eef6aa9d6/p/bin/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include/netinet/in.h:36:
In file included from /Users/kambala/.conan2/p/androc439eef6aa9d6/p/bin/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include/linux/in.h:231:
In file included from /Users/kambala/.conan2/p/androc439eef6aa9d6/p/bin/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include/aarch64-linux-android/asm/byteorder.h:12:
In file included from /Users/kambala/.conan2/p/androc439eef6aa9d6/p/bin/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include/linux/byteorder/little_endian.h:17:
/Users/kambala/.conan2/p/androc439eef6aa9d6/p/bin/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include/linux/swab.h:28:8: error: unknown type name 'inline'
   28 | static inline __attribute__((__const__)) __u32 __fswahw32(__u32 val) {
      |        ^
...

Comment in a similar issue libgit2/libgit2#6574 (comment) says that the reason is using an older C standard together with C99 features. And indeed, you specify c89 in configure.ac and unix/Makefile.

I was building v0.12 with NDK r27c and Conan, but that shouldn't really matter. Full build log:

opusfile/0.12: RUN: "/Users/kambala/.conan2/p/b/opusf04736e93b9f5b/b/src/configure" --disable-shared --enable-static --prefix=/ '--bindir=${prefix}/bin' '--sbindir=${prefix}/bin' '--libdir=${prefix}/lib' '--includedir=${prefix}/include' '--oldincludedir=${prefix}/include' --host=aarch64-linux-android --build=x86_64-apple-darwin --enable-http=yes --disable-examples 
checking for aarch64-linux-android-gcc... /Users/kambala/.conan2/p/androc439eef6aa9d6/p/bin/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android21-clang
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... yes
checking for suffix of object files... o
checking whether the compiler supports GNU C... yes
checking whether /Users/kambala/.conan2/p/androc439eef6aa9d6/p/bin/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android21-clang accepts -g... yes
checking for /Users/kambala/.conan2/p/androc439eef6aa9d6/p/bin/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android21-clang option to enable C11 features... none needed
checking whether /Users/kambala/.conan2/p/androc439eef6aa9d6/p/bin/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android21-clang understands -c and -o together... yes
checking for stdio.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for strings.h... yes
checking for sys/stat.h... yes
checking for sys/types.h... yes
checking for unistd.h... yes
checking for wchar.h... yes
checking for minix/config.h... no
checking whether it is safe to define __EXTENSIONS__... yes
checking whether _XOPEN_SOURCE should be defined... no
checking for special C compiler options needed for large files... no
checking for _FILE_OFFSET_BITS value needed for large files... no
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for aarch64-linux-android-strip... /Users/kambala/.conan2/p/androc439eef6aa9d6/p/bin/toolchains/llvm/prebuilt/darwin-x86_64/bin/llvm-strip
checking for a race-free mkdir -p... /Users/kambala/.conan2/p/b/opusf04736e93b9f5b/b/src/install-sh -c -d
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... yes
checking whether make supports the include directive... yes (GNU style)
checking whether make supports nested variables... yes
checking dependency style of /Users/kambala/.conan2/p/androc439eef6aa9d6/p/bin/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android21-clang... gcc3
checking whether to enable maintainer-specific portions of Makefiles... yes
checking build system type... x86_64-apple-darwin
checking host system type... aarch64-unknown-linux-android
checking how to print strings... printf
checking for a sed that does not truncate output... /usr/bin/sed
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for fgrep... /usr/bin/grep -F
checking for ld used by /Users/kambala/.conan2/p/androc439eef6aa9d6/p/bin/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android21-clang... /Users/kambala/.conan2/p/androc439eef6aa9d6/p/bin/toolchains/llvm/prebuilt/darwin-x86_64/bin/ld
checking if the linker (/Users/kambala/.conan2/p/androc439eef6aa9d6/p/bin/toolchains/llvm/prebuilt/darwin-x86_64/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /Users/kambala/.conan2/p/androc439eef6aa9d6/p/bin/toolchains/llvm/prebuilt/darwin-x86_64/bin/llvm-nm
checking the name lister (/Users/kambala/.conan2/p/androc439eef6aa9d6/p/bin/toolchains/llvm/prebuilt/darwin-x86_64/bin/llvm-nm) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 786432
checking how to convert x86_64-apple-darwin file names to aarch64-unknown-linux-android format... func_convert_file_noop
checking how to convert x86_64-apple-darwin file names to toolchain format... func_convert_file_noop
checking for /Users/kambala/.conan2/p/androc439eef6aa9d6/p/bin/toolchains/llvm/prebuilt/darwin-x86_64/bin/ld option to reload object files... -r
checking for aarch64-linux-android-file... no
checking for file... file
configure: WARNING: using cross tools not prefixed with host triplet
checking for aarch64-linux-android-objdump... /Users/kambala/.conan2/p/androc439eef6aa9d6/p/bin/toolchains/llvm/prebuilt/darwin-x86_64/bin/llvm-objdump
checking how to recognize dependent libraries... pass_all
checking for aarch64-linux-android-dlltool... no
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for aarch64-linux-android-ar... /Users/kambala/.conan2/p/androc439eef6aa9d6/p/bin/toolchains/llvm/prebuilt/darwin-x86_64/bin/llvm-ar
checking for archiver @FILE support... @
checking for aarch64-linux-android-strip... (cached) /Users/kambala/.conan2/p/androc439eef6aa9d6/p/bin/toolchains/llvm/prebuilt/darwin-x86_64/bin/llvm-strip
checking for aarch64-linux-android-ranlib... /Users/kambala/.conan2/p/androc439eef6aa9d6/p/bin/toolchains/llvm/prebuilt/darwin-x86_64/bin/llvm-ranlib
checking command to parse /Users/kambala/.conan2/p/androc439eef6aa9d6/p/bin/toolchains/llvm/prebuilt/darwin-x86_64/bin/llvm-nm output from /Users/kambala/.conan2/p/androc439eef6aa9d6/p/bin/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android21-clang object... ok
checking for sysroot... no
checking for a working dd... /bin/dd
checking how to truncate binary pipes... /bin/dd bs=4096 count=1
checking for aarch64-linux-android-mt... no
checking for mt... no
checking if : is a manifest tool... no
checking for dlfcn.h... yes
checking for objdir... .libs
checking if /Users/kambala/.conan2/p/androc439eef6aa9d6/p/bin/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android21-clang supports -fno-rtti -fno-exceptions... yes
checking for /Users/kambala/.conan2/p/androc439eef6aa9d6/p/bin/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android21-clang option to produce PIC... -fPIC -DPIC
checking if /Users/kambala/.conan2/p/androc439eef6aa9d6/p/bin/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android21-clang PIC flag -fPIC -DPIC works... yes
checking if /Users/kambala/.conan2/p/androc439eef6aa9d6/p/bin/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android21-clang static flag -static works... yes
checking if /Users/kambala/.conan2/p/androc439eef6aa9d6/p/bin/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android21-clang supports -c -o file.o... yes
checking if /Users/kambala/.conan2/p/androc439eef6aa9d6/p/bin/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android21-clang supports -c -o file.o... (cached) yes
checking whether the /Users/kambala/.conan2/p/androc439eef6aa9d6/p/bin/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android21-clang linker (/Users/kambala/.conan2/p/androc439eef6aa9d6/p/bin/toolchains/llvm/prebuilt/darwin-x86_64/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... Android linker
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... no
checking whether to build static libraries... yes
checking whether make supports nested variables... (cached) yes
checking if /Users/kambala/.conan2/p/androc439eef6aa9d6/p/bin/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android21-clang supports -std=c89 flag... yes
checking if /Users/kambala/.conan2/p/androc439eef6aa9d6/p/bin/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android21-clang supports -pedantic flag... yes
checking if /Users/kambala/.conan2/p/androc439eef6aa9d6/p/bin/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android21-clang supports -Wall flag... yes
checking if /Users/kambala/.conan2/p/androc439eef6aa9d6/p/bin/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android21-clang supports -Wextra flag... yes
checking if /Users/kambala/.conan2/p/androc439eef6aa9d6/p/bin/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android21-clang supports -Wno-parentheses flag... yes
checking if /Users/kambala/.conan2/p/androc439eef6aa9d6/p/bin/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android21-clang supports -Wno-long-long flag... yes
checking for sys/socket.h... yes
checking for clock_gettime... yes
checking pkg-config is at least version 0.9.0... yes
checking for openssl... yes
checking for ogg >= 1.3 opus >= 1.0.1... yes
checking for library containing lrintf... -lm
checking for /Users/kambala/.conan2/p/androc439eef6aa9d6/p/bin/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android21-clang way to treat warnings as errors... 
checking if /Users/kambala/.conan2/p/androc439eef6aa9d6/p/bin/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android21-clang supports __attribute__(( visibility("default") ))... yes
checking if /Users/kambala/.conan2/p/androc439eef6aa9d6/p/bin/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android21-clang supports -fvisibility=hidden... yes
checking for doxygen... no
checking for dot... no
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating opusfile.pc
config.status: creating opusurl.pc
config.status: creating opusfile-uninstalled.pc
config.status: creating opusurl-uninstalled.pc
config.status: creating doc/Doxyfile
config.status: creating config.h
config.status: executing depfiles commands
config.status: executing libtool commands
configure:
------------------------------------------------------------------------
  opusfile unknown: Automatic configuration OK.
Assertions ................... no

HTTP support ................. yes
Fixed-point .................. no
Floating-point API ........... yes
Library for lrintf() ......... -lm

Hidden visibility ............ yes

API code examples ............ no
API documentation ............ yes

opusfile/0.12: RUN: make -j6
/Applications/Xcode-15.4.0.app/Contents/Developer/usr/bin/make all-am
CC src/info.lo
CC src/internal.lo
CC src/opusfile.lo
CC src/stream.lo
CC src/libopusurl_la-http.lo
CC src/libopusurl_la-internal.lo
In file included from /Users/kambala/.conan2/p/b/opusf04736e93b9f5b/b/src/src/http.c:345:
In file included from /Users/kambala/.conan2/p/androc439eef6aa9d6/p/bin/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include/arpa/inet.h:32:
In file included from /Users/kambala/.conan2/p/androc439eef6aa9d6/p/bin/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include/netinet/in.h:36:
In file included from /Users/kambala/.conan2/p/androc439eef6aa9d6/p/bin/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include/linux/in.h:231:
In file included from /Users/kambala/.conan2/p/androc439eef6aa9d6/p/bin/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include/aarch64-linux-android/asm/byteorder.h:12:
In file included from /Users/kambala/.conan2/p/androc439eef6aa9d6/p/bin/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include/linux/byteorder/little_endian.h:17:
/Users/kambala/.conan2/p/androc439eef6aa9d6/p/bin/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include/linux/swab.h:28:8: error: unknown type name 'inline'
28 | static inline attribute((const)) __u32 __fswahw32(__u32 val) {
| ^
/Users/kambala/.conan2/p/androc439eef6aa9d6/p/bin/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include/linux/swab.h:28:47: error: expected ';' after top level declarator
28 | static inline attribute((const)) __u32 __fswahw32(__u32 val) {
| ^
/Users/kambala/.conan2/p/androc439eef6aa9d6/p/bin/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include/linux/swab.h:35:8: error: unknown type name 'inline'
35 | static inline attribute((const)) __u32 __fswahb32(__u32 val) {
| ^
/Users/kambala/.conan2/p/androc439eef6aa9d6/p/bin/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include/linux/swab.h:35:47: error: expected ';' after top level declarator
35 | static inline attribute((const)) __u32 __fswahb32(__u32 val) {
| ^
/Users/kambala/.conan2/p/androc439eef6aa9d6/p/bin/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include/linux/swab.h:71:8: error: unknown type name 'inline'
71 | static inline __u32 __swahw32p(const __u32 * p) {
| ^
/Users/kambala/.conan2/p/androc439eef6aa9d6/p/bin/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include/linux/swab.h:71:20: error: expected ';' after top level declarator
71 | static inline __u32 __swahw32p(const __u32 * p) {
| ^
/Users/kambala/.conan2/p/androc439eef6aa9d6/p/bin/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include/linux/swab.h:78:8: error: unknown type name 'inline'
78 | static inline __u32 __swahb32p(const __u32 * p) {
| ^
/Users/kambala/.conan2/p/androc439eef6aa9d6/p/bin/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include/linux/swab.h:78:20: error: expected ';' after top level declarator
78 | static inline __u32 __swahb32p(const __u32 * p) {
| ^
/Users/kambala/.conan2/p/androc439eef6aa9d6/p/bin/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include/linux/swab.h:85:8: error: unknown type name 'inline'
85 | static inline void __swab16s(__u16 * p) {
| ^
/Users/kambala/.conan2/p/androc439eef6aa9d6/p/bin/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include/linux/swab.h:106:8: error: unknown type name 'inline'
106 | static inline void __swahw32s(__u32 * p) {
| ^
/Users/kambala/.conan2/p/androc439eef6aa9d6/p/bin/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include/linux/swab.h:113:8: error: unknown type name 'inline'
113 | static inline void __swahb32s(__u32 * p) {
| ^
/Users/kambala/.conan2/p/b/opusf04736e93b9f5b/b/src/src/http.c:3472:31: warning: performing pointer subtraction with a null pointer has undefined behavior [-Wnull-pointer-subtraction]
3472 | request=va_arg(_ap,char *)-(char *)NULL;
| ^~~~~~~~~~~~~
1 warning and 11 errors generated.
make[1]: *** [src/libopusurl_la-http.lo] Error 1
make[1]: *** Waiting for unfinished jobs....
make: *** [all] Error 2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant