tanersener / mobile-ffmpeg

FFmpeg for Android, iOS and tvOS. Not maintained anymore. Superseded by FFmpegKit.
https://tanersener.github.io/mobile-ffmpeg
GNU General Public License v3.0
3.85k stars 787 forks source link

[Android] Issue building nettle #674

Closed milos1290 closed 3 years ago

milos1290 commented 3 years ago

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 "nettle-bugs@lists.lysator.liu.se"
#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

milos1290 commented 3 years ago

@tanersener this PR actually fixes the issue for android

tanersener commented 3 years ago

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

mattsff commented 3 years ago

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 commented 3 years ago

Any help here please? 🙏🏻 @milos1290 @tanersener

tanersener commented 3 years ago
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 commented 3 years ago

@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 commented 3 years ago

@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.