Openssl 1.0.0o for Android - android

I need to upgrade my OpenSSL library to openssl-1.0.0o and I want to know if this version has android support.
I am following the steps in this thread, while trying to build it in cygwin, but I get an error on 'make all':
/cygdrive/d/ndk+openssl/android-ndk-r10d/toolchains/arm-linux-androideabi-4.9/pr
ebuilt/linux-x86/bin/arm-linux-androideabi-gcc --sysroot=/cygdrive/d/ndk+openssl
/android-ndk-r10d/platforms/android-19/arch-arm/ -I. -I.. -I../include -D_WINDL
L -DOPENSSL_PIC -DOPENSSL_THREADS -DDSO_DLFCN -DHAVE_DLFCN_H -DTERMIOS -DL_ENDI
AN -fomit-frame-pointer -O3 -march=i486 -Wall -DOPENSSL_BN_ASM_PART_WORDS -DOPEN
SSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DMD5_A
SM -DRMD160_ASM -DAES_ASM -DWHIRLPOOL_ASM -c -o cryptlib.o cryptlib.c
/cygdrive/d/ndk+openssl/android-ndk-r10d/toolchains/arm-linux-androideabi-4.9/pr
ebuilt/linux-x86/bin/arm-linux-androideabi-gcc: /cygdrive/d/ndk+openssl/android-
ndk-r10d/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86/bin/arm-linux-a
ndroideabi-gcc: cannot execute binary file
<builtin>: recipe for target 'cryptlib.o' failed
make[1]: *** [cryptlib.o] Error 126
make[1]: Leaving directory '/cygdrive/d/ndk+openssl/openssl-1.0.0o/crypto'
Makefile:247: recipe for target 'build_crypto' failed
make: *** [build_crypto] Error 1
Any help would be appreciated. Thank you.

Your build environment is broken: cross-compiler is not working at all on your host machine. You can't build any source with that compiler on that host. You should build android and related libs in correct build environment. In short words you should use some linux (x64?) host, not cygwin.

Related

Build Android kernel ld vdso32 with error unrecognised emulation mode: armelf_linux_eabi

I try to build android kernel from google official document,use official build.shfrom scratch,but got this error message as follow:
VDSOSYM include/generated/vdso-offsets.h
LDS arch/arm64/kernel/vdso32/vdso.lds
VDSOC32 arch/arm64/kernel/vdso32/vgettimeofday.o
VDSOA32 arch/arm64/kernel/vdso32/sigreturn.o
HOSTCC arch/arm64/kernel/vdso32/../../../arm/vdso/vdsomunge
clang-5.0: warning: optimization flag '-fno-delete-null-pointer-checks' is not supported [-Wignored-optimization-argument]
VDSOL32 arch/arm64/kernel/vdso32/vdso.so.raw
/..//bin/ld: unrecognised emulation mode: armelf_linux_eabi
Supported emulations: elf_x86_64 elf32_x86_64 elf_i386 elf_iamcu i386pep i386pe elf64bpf
clang-5.0: error: linker command failed with exit code 1 (use -v to see invocation)
make[3]: *** [/home/tonki/aosp/newkernel/private/msm-google/arch/arm64/kernel/vdso32/Makefile:138: arch/arm64/kernel/vdso32/vdso.so.raw] Error 1
make[2]: *** [arch/arm64/Makefile:242: vdso_prepare] Error 2
make[1]: *** [Makefile:152: sub-make] Error 2
make: *** [Makefile:24: __sub-make] Error 2
I take a look at arch/arm64/kernel/vdso32/Makefilefile,found this line
CC_ARM32 := $(CC) $(CLANG_TARGET_ARM32),it use clang --target=arm-linux-androideabi to link vdso32.raw image but use /usr/bin/ld to link.
My OS is Arch Linux distribution,there was no gcc-arm-linux-androideabi official package which i can install with pacman like Ubuntu's apt tool.
Branch: AOSP kernel/android-msm-crosshatch-4.9-pie-qpr2.
Device: Pixel 3XL.
Kernel-config: official b1c1_defconfig(arch/arm64/configs/b1c1_defconfig).
Question: How can i solve it ? I have no idea here.Thanks!
I try to find the error detail.
I open make verbose message ouput.
clang --target=arm-linux-androideabi -Wp,-MD,arch/arm64/kernel/vdso32/.vdso.so.raw.d -nostdinc -isystem /home/tonki/aosp/newkernel/prebuilts-master/clang/host/linux-x86/clang-4393122/lib64/clang/5.0.1/include -I/home/tonki/aosp/newkernel/private/msm-google/arch/arm64/include -I./arch/arm64/include/generated/uapi -I./arch/arm64/include/generated -I/home/tonki/aosp/newkernel/private/msm-google/include -I./include -I/home/tonki/aosp/newkernel/private/msm-google/arch/arm64/include/uapi -I/home/tonki/aosp/newkernel/private/msm-google/include/uapi -I./include/generated/uapi -include /home/tonki/aosp/newkernel/private/msm-google/include/linux/kconfig.h -D__KERNEL__ -Qunused-arguments -mlittle-endian -Wl,-Bsymbolic -Wl,--no-undefined -Wl,-soname=linux-vdso.so.1 -Wl,-z,max-page-size=4096 -Wl,-z,common-page-size=4096 -nostdlib -shared -mfloat-abi=soft -Wl,-T arch/arm64/kernel/vdso32/vdso.lds arch/arm64/kernel/vdso32/vgettimeofday.o arch/arm64/kernel/vdso32/sigreturn.o -o arch/arm64/kernel/vdso32/vdso.so.raw
I think clang -target=arm-linux-androideabi was use system'ld to link vdso.so.raw ,so i found this link ,finally i modify like this
in arch/arm64/kernel/vdso32/Makefile:8
CC_ARM32 := $(CC) $(CLANG_TARGET_ARM32) -gcc-toolchain /home/tonki/aosp/newkernel/prebuilts/ndk-r23/toolchains/llvm/prebuilt/linux-x86_64
It finally work!

aarch64-linux-android-gcc error on Ubuntu 16.04 "poll.h" not found

Hi I am trying to cross compile code for Android arm64 on Ubuntu 16.04 with gcc-4.9 from android-ndk and cannot get rid of this error:
aarch64-linux-android-gcc -o test.o -c test.c -Os -fPIE -Wall -DDBG
test.c:26:18: fatal error: poll.h: No such file or directory
#include <poll.h>
^
compilation terminated.
Makefile:16: recipe for target 'test.o' failed
make: *** [test.o] Error 1
I think it is because the toolchain cannot be accessed the right way because before I got:
make: aarch64-linux-android-as: Command not found
Please advise.
Thank you yugr, turning it into standalone solved it:
$NDK/build/tools/make_standalone_toolchain.py \
--arch arm64 --api 23 --install-dir /tmp/my-android-toolchain
After that I added /tmp/my-android-toolchain/bin to PATH and it worked.

Error when compiling OpenSSH for android

I'm trying to cross-compile OpenSSH for an Android Plateform (Armv7) using the Android-NDK. To do this, I followed instructions based on this post : Cross Compile OpenSSH for ARM.
I replace the "arm-linux-gnueabi-gcc" by the android equivalent : "arm-linux-androideabi-gcc". I managed to compile zlib and openssl, but when it comes to openssh, things become more complicated ...
Here is what I've done :
export HOST=arm-linux-androideabi
./configure --host=$HOST --target=$HOST --prefix=$HOME/OpenSSH/opensshArm
After that I had the following output : 
configure: error: *** OpenSSL headers missing - please install first or check config.log ***
So I modified my ./configure by this one :
./configure --host=$HOST --target=$HOST --prefix=$HOME/OpenSSH/opensshArm --with-ssl-dir=$HOME/OpenSSH/out/usr
Where $HOME/out/ is the output directory used to compile zlib and openssl.
Here is where I'm stuck : I launch the "make" and here is thi output : 
make[1]: Entering directory `/home/test/OpenSSH/openssh-6.4p1/openbsd-compat'
arm-linux-androideabi-gcc -g -O2 -Wall -Wpointer-arith -Wuninitialized -Wsign-compare -Wformat-security -Wno-pointer-sign -fno-strict-aliasing -D_FORTIFY_SOURCE=2 -fno-builtin-memset -I. -I.. -I. -I./.. -I/home/test/OpenSSH/out/usr/include -DHAVE_CONFIG_H -c bsd-arc4random.c
In file included from /home/test/OpenSSH/out/usr/include/openssl/crypto.h:120,
from /home/test/OpenSSH/out/usr/include/openssl/bn.h:133,
from ../buffer.h:49,
from ../entropy.h:30,
from ../includes.h:177,
from bsd-arc4random.c:17:
/home/test/toolchain/bin/../sysroot/usr/include/stdlib.h:168: error: expected identifier or '(' before numeric constant
make[1]: *** [bsd-arc4random.o] Error 1
make[1]: Leaving directory `/home/test/OpenSSH/openssh-6.4p1/openbsd-compat'
make: *** [openbsd-compat/libopenbsd-compat.a] Error 2
Any helps ?

GMP compile error: No rule to make target `mpn/add_n.lo', needed by `libgmp.la'

I am compiling the VLC for Android on Ubuntu 12.04, basing on this instruction
Always get this error when compiling the libgmp
ibstdc++/4.7/include -I/home/jerry/workspaces/android-ndk-r8e/sources/cxx-stl/gnu-libstdc++/4.7/libs/armeabi-v7a/include -DNDEBUG -I/home/jerry/workspaces/vlc/vlc/contrib/arm-linux-androideabi/include -g -c -o mpn/add.lo mpn/add.c
/bin/bash ./libtool --tag=CC --mode=compile arm-linux-androideabi-gcc --sysroot=/home/jerry/workspaces/android-ndk-r8e/platforms/android-9/arch-arm -std=gnu99 -DHAVE_CONFIG_H -I. -D__GMP_WITHIN_GMP -g -mfpu=vfpv3-d16 -mcpu=cortex-a8 -mthumb -mfloat-abi=softfp -O2 -I/home/jerry/workspaces/android-ndk-r8e/sources/cxx-stl/gnu-libstdc++/4.7/include -I/home/jerry/workspaces/android-ndk-r8e/sources/cxx-stl/gnu-libstdc++/4.7/libs/armeabi-v7a/include -DNDEBUG -I/home/jerry/workspaces/vlc/vlc/contrib/arm-linux-androideabi/include -g -mfpu=vfpv3-d16 -mcpu=cortex-a8 -mthumb -mfloat-abi=softfp -O2 -I/home/jerry/workspaces/android-ndk-r8e/sources/cxx-stl/gnu-libstdc++/4.7/include -I/home/jerry/workspaces/android-ndk-r8e/sources/cxx-stl/gnu-libstdc++/4.7/libs/armeabi-v7a/include -DNDEBUG -I/home/jerry/workspaces/vlc/vlc/contrib/arm-linux-androideabi/include -g -c -o mpn/add_1.lo mpn/add_1.c
make[3]: *** No rule to make target `mpn/add_n.lo', needed by `libgmp.la'. Stop.
make[3]: *** Waiting for unfinished jobs....
make[3]: Leaving directory `/home/jerry/workspaces/vlc/vlc/contrib/android/gmp'
make[2]: *** [install-recursive] Error 1
make[2]: Leaving directory `/home/jerry/workspaces/vlc/vlc/contrib/android/gmp'
make[1]: *** [install] Error 2
make[1]: Leaving directory `/home/jerry/workspaces/vlc/vlc/contrib/android/gmp'
make: *** [.gmp] Error 2
Does anyone know to correct this problem?
I had the same error and GMP is still at version 4.2.1 but this was not the problem for me. A lot of other packages also failed. The problem was due to two different (and somehow incompatible) versions of libtool. Version 2.2.10 is provided by vlc itself in vlc/extras/tools, the other came from the distribution (Mint) at version 2.4.2. make clean in this tools-folder solved it for me, if it doesn't for you, you could try to set LIBTOOL_VERSION=2.4.2 or whatever version your distro provides in configure.mak.
The root cause was that at when config.status concatenates the config with ltmain.sh, some major parts of ltmain.sh are lost, so no compilation was done at all, hence the missing dependency.
After that everything compiled fine (didn't try to install though).
-rw-r--r-- 1 user user 8437456 Jun 5 21:00 VLC-debug.apk
It is a bug of the GMP, I fixed it by upgrading the GMP to v5.0+
This problem occurs because gmp/Makefile does not include gmp/mpn/Makeasm.am.
I don't know why but just copying gmp/mpn/Makeasm.am to the end of gmp/Makefile.am worked for me.
Upgrading gmp to version 5.1.2 did not help me.
Compiled fine with 5.1.1 https://ftp.gnu.org/gnu/gmp/gmp-5.1.1.tar.lz
I got similer error with gmp-6.0.0 and gmp-6.2.1 too, they were slightly different though.

Use build_libstagefright in ffmpeg to build file .so for android

In order to use ffmpeg in android , I tried to build ffmpeg by using build_libstagefright in
ffmpeg/tools/lib_stagefright
but it alwalys appear a error which i coundn't solve it.
the message in the bottom of ffmpeg/config.log is
arm-linux-androideabi-g++ -D_ISOC99_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -DPIC -I../android-source/frameworks/base/include -I../android-source/system/core/include -I../android-source/frameworks/base/media/libstagefright -I../android-source/frameworks/base/include/media/stagefright/openmax -I/home/user/android-ndk/sources/cxx-stl/gnu-libstdc++/include -I/home/user/android-ndk/sources/cxx-stl/gnu-libstdc++/libs/armeabi-v7a/include -march=armv7-a -mfloat-abi=softfp -mfpu=neon -march=armv7-a -std=c99 -fomit-frame-pointer -fPIC -marm -Wno-multichar -fno-exceptions -fno-rtti -D__STDC_CONSTANT_MACROS -c -o /tmp/ffconf.6ZzEMs87.o /tmp/ffconf.5jbfvJxK.cpp
./configure: line 701: /home/user/android-ndk/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi-g++: cannot execute binary file
ERROR: libstagefright_h264 not found
Anyone have the solution of this ??
my Build Environment is
Window 7
Cygwin
android-NDK-r8b linux version
I found a method ,let me cross this error.
In file of ffmpeg/configure
origin :
enabled libstagefright_h264 && require_cpp libstagefright_h264 "binder/ProcessState.h media/stagefright/MetaData.h
fixed :
enabled libstagefright && require_cpp libstagefright_h264 "binder/ProcessState.h media/stagefright/MetaData.h
When I fix libstagefright_h264 to libstagefright here, it seems be normal until the next error.
CC libavcodec/lagarithrac.o
CC libavcodec/latm_parser.o
CXX libavcodec/libstagefright.o
/bin/sh: /home/user/android-ndk/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux- x86/bin/arm-linux-androideabi-g++: cannot execute binary file
CC libavcodec/lcldec.o
common.mak:51: recipe for target `libavcodec/libstagefright.o' failed
make: *** [libavcodec/libstagefright.o] Error 126
make: *** Waiting for unfinished jobs....
PS: ffmpeg version is 1.0
Take a look at ffmpeg/config.log - there has to be an error description on the last line.
PS. On windows i used MinGW|MSYS to successfully compile ffmpeg

Categories

Resources