Closed DavidBarishev closed 7 years ago
The SSL_library_init() and OpenSSL_add_ssl_algorithms() functions were deprecated in OpenSSL 1.1.0 by OPENSSL_init_ssl().
Thanks for the quick replay !
Since ffmpeg doesn't support version openssl 1.1.0 when cross compiling, i have used your script for the latest LTS version(openssl 1.0.2k
).Ireplaced the lib name to LIB_NAME="openssl-1.0.2k"
in the script, since it looked modular enought to support it, and indeed the new library compiled fine, but again it was not able to complete the test.I got a different warning now :
/home/david/compile/obj/local/openssl_for_ios_and_android/output/android/openssl-x86/lib/libcrypto.a(c_zlib.o):c_zlib.c:function zlib_stateful_expand_block: error: undefined reference to 'inflate'
/home/david/compile/obj/local/openssl_for_ios_and_android/output/android/openssl-x86/lib/libcrypto.a(c_zlib.o):c_zlib.c:function zlib_stateful_compress_block: error: undefined reference to 'deflate'
/home/david/compile/obj/local/openssl_for_ios_and_android/output/android/openssl-x86/lib/libcrypto.a(c_zlib.o):c_zlib.c:function bio_zlib_free: error: undefined reference to 'inflateEnd'
/home/david/compile/obj/local/openssl_for_ios_and_android/output/android/openssl-x86/lib/libcrypto.a(c_zlib.o):c_zlib.c:function bio_zlib_free: error: undefined reference to 'deflateEnd'
/home/david/compile/obj/local/openssl_for_ios_and_android/output/android/openssl-x86/lib/libcrypto.a(c_zlib.o):c_zlib.c:function zlib_stateful_finish: error: undefined reference to 'inflateEnd'
/home/david/compile/obj/local/openssl_for_ios_and_android/output/android/openssl-x86/lib/libcrypto.a(c_zlib.o):c_zlib.c:function zlib_stateful_finish: error: undefined reference to 'deflateEnd'
/home/david/compile/obj/local/openssl_for_ios_and_android/output/android/openssl-x86/lib/libcrypto.a(c_zlib.o):c_zlib.c:function zlib_stateful_init: error: undefined reference to 'inflateInit_'
/home/david/compile/obj/local/openssl_for_ios_and_android/output/android/openssl-x86/lib/libcrypto.a(c_zlib.o):c_zlib.c:function zlib_stateful_init: error: undefined reference to 'deflateInit_'
/home/david/compile/obj/local/openssl_for_ios_and_android/output/android/openssl-x86/lib/libcrypto.a(c_zlib.o):c_zlib.c:function bio_zlib_ctrl: error: undefined reference to 'deflate'
/home/david/compile/obj/local/openssl_for_ios_and_android/output/android/openssl-x86/lib/libcrypto.a(c_zlib.o):c_zlib.c:function bio_zlib_ctrl: error: undefined reference to 'zError'
/home/david/compile/obj/local/openssl_for_ios_and_android/output/android/openssl-x86/lib/libcrypto.a(c_zlib.o):c_zlib.c:function bio_zlib_write: error: undefined reference to 'deflate'
/home/david/compile/obj/local/openssl_for_ios_and_android/output/android/openssl-x86/lib/libcrypto.a(c_zlib.o):c_zlib.c:function bio_zlib_write: error: undefined reference to 'zError'
/home/david/compile/obj/local/openssl_for_ios_and_android/output/android/openssl-x86/lib/libcrypto.a(c_zlib.o):c_zlib.c:function bio_zlib_write: error: undefined reference to 'deflateInit_'
/home/david/compile/obj/local/openssl_for_ios_and_android/output/android/openssl-x86/lib/libcrypto.a(c_zlib.o):c_zlib.c:function bio_zlib_read: error: undefined reference to 'inflate'
/home/david/compile/obj/local/openssl_for_ios_and_android/output/android/openssl-x86/lib/libcrypto.a(c_zlib.o):c_zlib.c:function bio_zlib_read: error: undefined reference to 'zError'
/home/david/compile/obj/local/openssl_for_ios_and_android/output/android/openssl-x86/lib/libcrypto.a(c_zlib.o):c_zlib.c:function bio_zlib_read: error: undefined reference to 'inflateInit_'
/home/david/compile/obj/local/openssl_for_ios_and_android/output/android/openssl-x86/lib/libcrypto.a(ui_openssl.o):ui_openssl.c:function read_string_inner: error: undefined reference to 'signal'
/home/david/compile/obj/local/openssl_for_ios_and_android/output/android/openssl-x86/lib/libcrypto.a(ui_openssl.o):ui_openssl.c:function read_string_inner: error: undefined reference to 'tcsetattr'
/home/david/compile/obj/local/openssl_for_ios_and_android/output/android/openssl-x86/lib/libcrypto.a(ui_openssl.o):ui_openssl.c:function read_string_inner: error: undefined reference to 'tcsetattr'
/home/david/compile/obj/local/openssl_for_ios_and_android/output/android/openssl-x86/lib/libcrypto.a(ui_openssl.o):ui_openssl.c:function open_console: error: undefined reference to 'tcgetattr'
collect2: error: ld returned 1 exit status
I have also tried version 1.0.2c , and got the same result.Seems like some libs are missing ?If we remove zlib from the configure it might solve the zlib errors, but what about the ui_openssl
?
You could change commit to a31797400b3f4cf5c2d04c
I remember it could build OpenSSL 1.0.2c successfully but not support mips arch
I will check script why not support 1.0.2c later soon
Yup, you're right, i was able to compile 1.0.2c on that commit.
I have tried to find some differences between the scripts for x86:
Different c flags.
New:
elif [ "$ARCH" == "android-x86" ]; then
export ARCH_FLAGS="-march=i686 -mtune=intel -msse3 -mfpmath=sse -m32"
export ARCH_LINK=""
export TOOL="i686-linux-android"
NDK_FLAGS="--arch=x86"
Old :
elif [ "$ARCH" == "android-x86" ]; then
export ARCH_FLAGS="-march=i686 -msse3 -mstackrealign -mfpmath=sse"
export ARCH_LINK=""
export TOOL="i686-linux-android"
NDK_FLAGS="--platform=$ANDROID_PLATFORM --toolchain=x86-4.9 --install-dir=`pwd`/android-toolchain"
The new one uses zlib.
New:
./Configure $ARCH \
--prefix=${LIB_DEST_DIR}/${ABI} \
--with-zlib-include=$SYSROOT/usr/include \
--with-zlib-lib=$SYSROOT/usr/lib \
zlib \
no-asm \
no-shared \
no-unit-test
Old :
./Configure $ARCH
Not quite sure what each parameter does.
New :
export CPPFLAGS=${CPPFLAGS:-""}
export LIBS=${LIBS:-""}
export CFLAGS="${ARCH_FLAGS} -fpic -ffunction-sections -funwind-tables -fstack-protector -fno-strict-aliasing -finline-limit=64"
export CXXFLAGS="${CFLAGS} -std=c++11 -frtti -fexceptions"
Old :
export CPPFLAGS=" ${ARCH_FLAGS} -fpic -ffunction-sections -funwind-tables -fstack-protector -fno-strict-aliasing -finline-limit=64 "
export CXXFLAGS=" ${ARCH_FLAGS} -fpic -ffunction-sections -funwind-tables -fstack-protector -fno-strict-aliasing -finline-limit=64 -frtti -fexceptions "
export CFLAGS=" ${ARCH_FLAGS} -fpic -ffunction-sections -funwind-tables -fstack-protector -fno-strict-aliasing -finline-limit=64 "
That's the things that i found that might have affected the build.
Cool! Thanks for your job,I will check these diffrents and if you find something new please tell me
by the way I find these
https://github.com/openssl/openssl/issues/988
and about undefined reference zlib
maybe you should add LOCAL_LDLIBS += -lz
in your Android.mk
I figure it out, i was using wrong api level in my ffmpeg configuration, i have successfully used your script to configure openssl 1.0.2k without any modifications, and linked it against my ffmpeg configuration. Btw i am not using ndk build.
You can point out that your script works well with 1.0.2 version, and even provide binaries since this version will be supported until 2019.
Hello !
I'm building ffmpeg for android with openssl.
I couldn't get the configuration to work - i have tried compiling with the script, and using the prebuild one.
I am working with the x86 build.
Here is the code ffmpeg tests for openssl support :
Then we try to compile this code, using android's gcc, and including the prebuild headers and actual lib.
OPEN_SSL
is/output/android/openssl-android-x86
From the prebuild zip.Here is compiling the code.
Note the -I header option.
This command works fine, and produces test.o, now we link it to the actual lib:
Note the -L libs option. This command fails, with this error :
I know its not a problem with ffmpeg configuration because the same code works with this openssl prebuild : https://github.com/emileb/OpenSSL-for-Android-Prebuilt.
What is going on ? Why this one isn't working ?
You have done a great work with the scripts providing a convenient way to build, and i would like to use it.