Skip to content
This repository has been archived by the owner on Oct 7, 2021. It is now read-only.

[Android] Issue building nettle #674

Closed
milos1290 opened this issue Feb 2, 2021 · 7 comments
Closed

[Android] Issue building nettle #674

milos1290 opened this issue Feb 2, 2021 · 7 comments

Comments

@milos1290
Copy link

Description

/android.sh -f \
            --enable-gnutls \
            --disable-x86 \
            --disable-x86-64 \
            --lts

Fails to build nettle dependency.

Expected behavior
Build passes

Current behavior
Building of nettle fails

Building arm-v7a platform on API level 16

gmp: already built
libiconv: already built
nettle: failed

Logs
nettle/config.log

/* confdefs.h */
...
#define PACKAGE_NAME "nettle"
#define PACKAGE_TARNAME "nettle"
#define PACKAGE_VERSION "3.6"
#define PACKAGE_STRING "nettle 3.6"
#define PACKAGE_BUGREPORT "[email protected]"
#define PACKAGE_URL ""
#define HAVE_LINK_IFUNC 1

configure: exit 1

build.log

checking build system type... i386-apple-darwin20.2.0
checking host system type... arm-unknown-linux-androideabi
checking for -R flag... using -Wl,-rpath,
Searching for libraries
checking /Users/milos/Developer/mobile-ffmpeg/prebuilt/android-arm/gmp/lib... added
checking /Users/milos/Developer/mobile-ffmpeg/prebuilt/android-arm/nettle/lib... not found
checking /usr/local/lib... added
checking /sw/local/lib... not found
checking /sw/lib... not found
checking /usr/gnu/lib... not found
checking /opt/gnu/lib... not found
checking /sw/gnu/lib... not found
checking /usr/freeware/lib... not found
checking /usr/pkg/lib... not found
checking for arm-linux-androideabi-gcc... armv7a-linux-androideabi16-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 we are using the GNU C compiler... yes
checking whether armv7a-linux-androideabi16-clang accepts -g... yes
checking for armv7a-linux-androideabi16-clang option to accept ISO C89... none needed
checking for ifunc support... yes
checking whether we are using the GNU C++ compiler... yes
checking whether armv7a-linux-androideabi16-clang++ accepts -g... yes
checking if LD -Wl,--version-script works... yes
checking whether make sets $(MAKE)... yes
checking for arm-linux-androideabi-ranlib... arm-linux-androideabi-ranlib
checking for arm-linux-androideabi-nm... arm-linux-androideabi-nm
checking for arm-linux-androideabi-objdump... arm-linux-androideabi-objdump
checking for arm-linux-androideabi-ar... arm-linux-androideabi-ar
checking for a BSD-compatible install... /usr/bin/install -c
checking for a thread-safe mkdir -p... ./install-sh -c -d
checking whether ln -s works... yes
checking build system compiler gcc... no
checking build system compiler cc... no
checking build system compiler c89... no
checking build system compiler c99... no
configure: error: Cannot find a build system compiler

Environment

  • Platform: Android
  • Architecture: arm-v7a, arm-v7a-neon, arm64-v8a
  • Source branch: master/development
  • Android Studio version: latest
  • Android NDK version: 21.4.7075529
@milos1290
Copy link
Author

@tanersener this PR actually fixes the issue for android

@tanersener
Copy link
Owner

Thanks for the heads up. I knew I fixed it. I just couldn't find the commit.

@mattsff
Copy link

mattsff commented Feb 18, 2021

I have the latest code from master that includes that PR (^^) but I have the same issue to build android version. ¿Any idea how to fix that? Thanks

@mattsff
Copy link

mattsff commented Feb 25, 2021

Any help here please? 🙏🏻 @milos1290 @tanersener

@tanersener
Copy link
Owner

error: implicitly declaring library function 'exit' with type 'void (int) __attribute__((noreturn))' [-Werror,-Wimplicit-function-declaration]
  exit(0);
  ^
conftest.c:4:3: note: include the header <stdlib.h> or explicitly provide a declaration for 'exit'

@mattsff This is the actual error here. It is printed in src/nettle/config.log.

The solution is to:
1- Manually add #include <stdlib.h> in all code snippets that call exit(0), exit (0) or exit(1) in src/nettle/aclocal.m4
2- re-build nettle with --reconf-nettle option

@milos1290
Copy link
Author

@mattsff the way i've fixed it was to copy the change from iOS PR changes into android-nettle.sh

${SED_INLINE} 's/exit(0)/return 0/g' ${BASEDIR}/src/${LIB_NAME}/configure
 ${SED_INLINE} 's/exit (0)/return 0/g' ${BASEDIR}/src/${LIB_NAME}/configure

@arjinmc
Copy link

arjinmc commented Mar 11, 2021

@mattsff the way i've fixed it was to copy the change from iOS PR changes into android-nettle.sh

${SED_INLINE} 's/exit(0)/return 0/g' ${BASEDIR}/src/${LIB_NAME}/configure
 ${SED_INLINE} 's/exit (0)/return 0/g' ${BASEDIR}/src/${LIB_NAME}/configure

It works.

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

No branches or pull requests

4 participants