Opened 4 years ago

Closed 3 years ago

#6992 closed defect (invalid)

Cross-building ffmpeg with static gnutls for android fails at configure step

Reported by: Maxime Gauduin Owned by:
Priority: normal Component: build system
Version: 3.4 Keywords:
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Greetings,

I'm trying to cross-compile ffmpeg 3.4.1 for android using a freshly generated x86_64 android toolchain at API version 21.

Every external library was built static so the resulting ffmpeg binary links to the least possible number of libs.

Everything works fine except configure can't find gnutls with undefined references to a lot of GMP symbols despite -lgmp having been added to LIBS.

Here's my config.log: https://paste.xinu.at/Qxb/

Attachments (1)

config.log (366.3 KB ) - added by Maxime Gauduin 4 years ago.
config.log

Download all attachments as: .zip

Change History (8)

comment:1 by Maxime Gauduin, 4 years ago

Summary: Cross-build ffmpeg with static gnutls on android fails at configure stepCross-building ffmpeg with static gnutls for android fails at configure step

comment:2 by Carl Eugen Hoyos, 4 years ago

Is the issue reproducible with current FFmpeg git head?
Please attach all necessary log files here in the ticket, do not use external resources (except for large media files).

How did you compile gmp?

by Maxime Gauduin, 4 years ago

Attachment: config.log added

config.log

comment:3 by Maxime Gauduin, 4 years ago

Reproduced with armv7 and aarch64, I've attached the config.log here this time.

Here is an overview of how I'm building gmp:

./configure --host=aarch64-linux-android --prefix=/srv/buildbot/aarch64_android/libgmp-aarch64_android/staging --disable-shared --enable-static

environment:

CC=aarch64-linux-android-clang
CFLAGS=-march=armv8-a -Os -pipe -fPIE -I/srv/buildbot/aarch64_android/staging/include
CHOST=aarch64-linux-android
CPPFLAGS=-D_FORTIFY_SOURCE=2 -I/srv/buildbot/aarch64_android/staging/include
CXX=aarch64-linux-android-clang++
CXXFLAGS=-march=armv8-a -Os -pipe -fPIE -I/srv/buildbot/aarch64_android/staging/include
LANG=en_US.utf8
LANGUAGE=C
LC_ALL=C
LDFLAGS=-Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now -pie -static-libstdc++ -L/srv/buildbot/aarch64_android/staging/lib
PATH=/srv/buildbot/aarch64_android/toolchain/bin:/srv/buildbot/aarch64_android/staging/bin:/srv/buildbot/aarch64_android/staging/sbin:/usr/local/sbin:/usr/local/bin:/usr/bin
PKG_CONFIG_PATH=/srv/buildbot/aarch64_android/staging/lib/pkgconfig

FYI, I've been successfully cross-building a dynamically linked ffmpeg with the same gmp (albeit with --disable-static and --enable-shared) for linux platforms with all those architectures using toolchains from linaro or generated with crosstool-ng. The only thing that doesn't work when I'm going static is gnutls.

I'll try the git head as soon as I can.

comment:4 by Maxime Gauduin, 4 years ago

I can reproduce using the current git head as well.

comment:5 by Maxime Gauduin, 4 years ago

Hi guys, do you have any pointer that would help me diagnose the issue?

comment:6 by Maxime Gauduin, 3 years ago

Turns out order matters, -lgmp needs to come after -lnettle and -lhogweed.

comment:7 by Maxime Gauduin, 3 years ago

Resolution: invalid
Status: newclosed
Note: See TracTickets for help on using tickets.