I am trying to build a kernel for Xperia SP.
First I have git-cloned the kernel source from here:
https://github.com/Tomoms/android_kernel_sony_msm8x60
then git-cloned this toolchain:
https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/arm/arm-eabi-4.7
then I went to:
KERNEL_FOLDER/arch/arm/configs
and copied msm8960_defconfig (as i think Xperia SP has msm8960) to root of KERNEL_FOLDER and renamed it to .config
then I opened the terminal in the KERNEL_FOLDER directory and typed
make ARCH=arm CROSS_COMPILE=~/toolchains/arm-eabi-4.7/bin/arm-eabi-
and got this
CHK include/linux/version.h
CHK include/generated/utsrelease.h
HOSTCC scripts/basic/fixdep
make[1]: `include/generated/mach-types.h' is up to date.
CC kernel/bounds.s
/home/pc/toolchains/arm-eabi-4.7/bin/arm-eabi-gcc -Wp,-MD,kernel/.bounds.s.d -nostdinc -isystem /home/pc/toolchains/arm-eabi-4.7/bin/arm-eabi-gcc -print-file-name=include [Errno 8] Exec format error -I/home/pc/android/kernel/android_kernel_sony_msm8x60/arch/arm/include -Iarch/arm/include/generated -Iinclude -include /home/pc/android/kernel/android_kernel_sony_msm8x60/include/linux/kconfig.h -D__KERNEL__ -mlittle-endian -Iarch/arm/mach-msm/include -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Wno-format-security -fno-delete-null-pointer-checks -Os -fstack-protector -mabi=aapcs-linux -mno-thumb-interwork -funwind-tables -D__LINUX_ARM_ARCH__=7 -march=armv7-a -msoft-float -Uarm -fomit-frame-pointer -g -mtune=cortex-a7 -mfpu=neon-vfpv4 -fgraphite -floop-parallelize-all -ftree-loop-linear -floop-interchange -floop-strip-mine -floop-block -DKBUILD_STR(s)=#s -DKBUILD_BASENAME=KBUILD_STR(bounds) -DKBUILD_MODNAME=KBUILD_STR(bounds) -fverbose-asm -S -o kernel/bounds.s kernel/bounds.c [Errno 8] Exec format error
make[1]: *** [kernel/bounds.s] Error 8
make: *** [prepare0] Error 2
People used to get this error when building on 32bit systems. Ensure you are building on 64bit linux.
Related
I try build static library for Android (*.a). My pro-file:
QT -= gui
TEMPLATE = lib
CONFIG += staticlib
CONFIG += c++11
DEFINES += QT_DEPRECATED_WARNINGS
ANDROID_ABIS = armeabi-v7a arm64-v8a x86 x86_64
SOURCES += \
untitled3.cpp
HEADERS += \
untitled3.h
Files untitled3.cpp and untitled3.h very simple. When I build project I get the only one library *.a, but expected get four libs for all architectures: armeabi-v7a arm64-v8a x86 x86_64
When I build at first, compilation finished with error:
10:13:57: Running steps for project untitled3...
10:13:57: Starting: "C:\Qt\Qt5.14.1\5.14.1\android\bin\qmake.exe" C:\Users\range\Documents\untitled3\untitled3.pro -spec android-clang "CONFIG+=debug" "CONFIG+=qml_debug" ANDROID_ABIS="armeabi-v7a arm64-v8a x86 x86_64"
Info: creating stash file C:\Users\range\Documents\andr_out\.qmake.stash
WARNING: Targets of builds 'Armeabi-v7a' and 'Arm64-v8a' conflict: libuntitled3.a.
10:13:57: The process "C:\Qt\Qt5.14.1\5.14.1\android\bin\qmake.exe" exited normally.
10:13:57: Starting: "C:\Users\range\AppData\Local\Android\Sdk\ndk\21.0.6113669\prebuilt\windows-x86_64\bin\make.exe" -f C:/Users/range/Documents/andr_out/Makefile qmake_all
make: Nothing to be done for 'qmake_all'.
10:13:57: The process "C:\Users\range\AppData\Local\Android\Sdk\ndk\21.0.6113669\prebuilt\windows-x86_64\bin\make.exe" exited normally.
10:13:57: Starting: "C:\Users\range\AppData\Local\Android\Sdk\ndk\21.0.6113669\prebuilt\windows-x86_64\bin\make.exe" -j12
C:/Users/range/AppData/Local/Android/Sdk/ndk/21.0.6113669/prebuilt/windows-x86_64/bin/make -f Makefile.Armeabi-v7a all
C:/Users/range/AppData/Local/Android/Sdk/ndk/21.0.6113669/prebuilt/windows-x86_64/bin/make -f Makefile.Arm64-v8a all
C:/Users/range/AppData/Local/Android/Sdk/ndk/21.0.6113669/prebuilt/windows-x86_64/bin/make -f Makefile.X86 all
C:/Users/range/AppData/Local/Android/Sdk/ndk/21.0.6113669/prebuilt/windows-x86_64/bin/make -f Makefile.X86_64 all
make[1]: Entering directory 'C:/Users/range/Documents/andr_out'
C:\Users\range\AppData\Local\Android\Sdk\ndk\21.0.6113669/toolchains/llvm/prebuilt/windows-x86_64/bin/clang++ -c -target armv7a-linux-androideabi21 -fno-limit-debug-info -fPIC -fstack-protector-strong -DANDROID -g -marm -O0 -fPIC -std=gnu++11 -Wall -W -D_REENTRANT -DQT_DEPRECATED_WARNINGS -DQT_QML_DEBUG -DQT_CORE_LIB -I..\untitled3 -I. -I..\..\..\..\Qt\Qt5.14.1\5.14.1\android\include -I..\..\..\..\Qt\Qt5.14.1\5.14.1\android\include\QtCore -Iarmeabi-v7a -I..\..\..\..\Qt\Qt5.14.1\5.14.1\android\mkspecs\android-clang -o armeabi-v7a\untitled3.obj ..\untitled3\untitled3.cpp
make[1]: Entering directory 'C:/Users/range/Documents/andr_out'
C:\Users\range\AppData\Local\Android\Sdk\ndk\21.0.6113669/toolchains/llvm/prebuilt/windows-x86_64/bin/clang++ -c -target aarch64-linux-android21 -fno-limit-debug-info -fPIC -fstack-protector-strong -DANDROID -g -fPIC -std=gnu++11 -Wall -W -D_REENTRANT -DQT_DEPRECATED_WARNINGS -DQT_QML_DEBUG -DQT_CORE_LIB -I..\untitled3 -I. -I..\..\..\..\Qt\Qt5.14.1\5.14.1\android\include -I..\..\..\..\Qt\Qt5.14.1\5.14.1\android\include\QtCore -Iarm64-v8a -I..\..\..\..\Qt\Qt5.14.1\5.14.1\android\mkspecs\android-clang -o arm64-v8a\untitled3.obj ..\untitled3\untitled3.cpp
make[1]: Entering directory 'C:/Users/range/Documents/andr_out'
C:\Users\range\AppData\Local\Android\Sdk\ndk\21.0.6113669/toolchains/llvm/prebuilt/windows-x86_64/bin/clang++ -c -target i686-linux-android21 -mstackrealign -fno-limit-debug-info -fPIC -fstack-protector-strong -DANDROID -g -fPIC -std=gnu++11 -Wall -W -D_REENTRANT -DQT_DEPRECATED_WARNINGS -DQT_QML_DEBUG -DQT_CORE_LIB -I..\untitled3 -I. -I..\..\..\..\Qt\Qt5.14.1\5.14.1\android\include -I..\..\..\..\Qt\Qt5.14.1\5.14.1\android\include\QtCore -Ix86 -I..\..\..\..\Qt\Qt5.14.1\5.14.1\android\mkspecs\android-clang -o x86\untitled3.obj ..\untitled3\untitled3.cpp
make[1]: Entering directory 'C:/Users/range/Documents/andr_out'
C:\Users\range\AppData\Local\Android\Sdk\ndk\21.0.6113669/toolchains/llvm/prebuilt/windows-x86_64/bin/clang++ -c -target x86_64-linux-android21 -fno-limit-debug-info -fPIC -fstack-protector-strong -DANDROID -g -fPIC -std=gnu++11 -Wall -W -D_REENTRANT -DQT_DEPRECATED_WARNINGS -DQT_QML_DEBUG -DQT_CORE_LIB -I..\untitled3 -I. -I..\..\..\..\Qt\Qt5.14.1\5.14.1\android\include -I..\..\..\..\Qt\Qt5.14.1\5.14.1\android\include\QtCore -Ix86_64 -I..\..\..\..\Qt\Qt5.14.1\5.14.1\android\mkspecs\android-clang -o x86_64\untitled3.obj ..\untitled3\untitled3.cpp
del libuntitled3.a
del libuntitled3.a
del libuntitled3.a
del libuntitled3.a
ЌҐ г¤ Ґвбп ©вЁ C:\Users\range\Documents\andr_out\libuntitled3.a
C:\Users\range\AppData\Local\Android\Sdk\ndk\21.0.6113669/toolchains/llvm/prebuilt/windows-x86_64/bin/llvm-ar cqs libuntitled3.a arm64-v8a\untitled3.obj
ЌҐ г¤ Ґвбп ©вЁ C:\Users\range\Documents\andr_out\libuntitled3.a
ЌҐ г¤ Ґвбп ©вЁ C:\Users\range\Documents\andr_out\libuntitled3.a
ЌҐ г¤ Ґвбп ©вЁ C:\Users\range\Documents\andr_out\libuntitled3.a
C:\Users\range\AppData\Local\Android\Sdk\ndk\21.0.6113669/toolchains/llvm/prebuilt/windows-x86_64/bin/llvm-ar cqs libuntitled3.a armeabi-v7a\untitled3.obj
C:\Users\range\AppData\Local\Android\Sdk\ndk\21.0.6113669/toolchains/llvm/prebuilt/windows-x86_64/bin/llvm-ar cqs libuntitled3.a x86\untitled3.obj
C:\Users\range\AppData\Local\Android\Sdk\ndk\21.0.6113669/toolchains/llvm/prebuilt/windows-x86_64/bin/llvm-ar cqs libuntitled3.a x86_64\untitled3.obj
C:\Users\range\AppData\Local\Android\Sdk\ndk\21.0.6113669/toolchains/llvm/prebuilt/windows-x86_64/bin/aarch64-linux-android-ranlib libuntitled3.a
C:\Users\range\AppData\Local\Android\Sdk\ndk\21.0.6113669/toolchains/llvm/prebuilt/windows-x86_64/bin/x86_64-linux-android-ranlib libuntitled3.a
C:\Users\range\AppData\Local\Android\Sdk\ndk\21.0.6113669/toolchains/llvm/prebuilt/windows-x86_64/bin/aarch64-linux-android-ranlib: libuntitled3.a: Permission denied
make[1]: *** [Makefile.Arm64-v8a:67: libuntitled3.a] Error 1
make: *** [Makefile:62: arm64-v8a-all] Error 2
make: *** Waiting for unfinished jobs....
make[1]: Leaving directory 'C:/Users/range/Documents/andr_out'
C:\Users\range\AppData\Local\Android\Sdk\ndk\21.0.6113669/toolchains/llvm/prebuilt/windows-x86_64/bin/i686-linux-android-ranlib libuntitled3.a
C:\Users\range\AppData\Local\Android\Sdk\ndk\21.0.6113669/toolchains/llvm/prebuilt/windows-x86_64/bin/arm-linux-androideabi-ranlib libuntitled3.a
C:\Users\range\AppData\Local\Android\Sdk\ndk\21.0.6113669/toolchains/llvm/prebuilt/windows-x86_64/bin/x86_64-linux-android-ranlib: unable to rename 'libuntitled3.a'; reason: File exists
make[1]: *** [Makefile.X86_64:67: libuntitled3.a] Error 1
make[1]: Leaving directory 'C:/Users/range/Documents/andr_out'
make: *** [Makefile:90: x86_64-all] Error 2
C:\Users\range\AppData\Local\Android\Sdk\ndk\21.0.6113669/toolchains/llvm/prebuilt/windows-x86_64/bin/i686-linux-android-ranlib: unable to rename 'libuntitled3.a'; reason: File exists
make[1]: *** [Makefile.X86:67: libuntitled3.a] Error 1
make: *** [Makefile:76: x86-all] Error 2
make[1]: Leaving directory 'C:/Users/range/Documents/andr_out'
make[1]: Leaving directory 'C:/Users/range/Documents/andr_out'
10:13:58: The process "C:\Users\range\AppData\Local\Android\Sdk\ndk\21.0.6113669\prebuilt\windows-x86_64\bin\make.exe" exited with code 2.
Error while building/deploying project untitled3 (kit: Android for armeabi-v7a,arm64-v8a,x86,x86_64 (Clang Qt 5.14.1 for Android))
When executing step "Make"
10:13:58: Elapsed time: 00:01.
When I build at second, compilation finished successfully, but in output dir I find one *.a - lib:
In folders armeabi-v7a arm64-v8a x86 x86_64 exist only *.obj - files, but not exist .a - files.
My question: how correct build static library (.a) for android for all (4) architectures?
P.S.: Qt version for Android: 5.14.1; Qt Creator version: 4.11.0, based on Qt version: 5.14.0
have you tried building 4 seperate projects for each android architecture (a .pro for each architecture) to see what the result is? it’s obviously not ideal when the project gets larger, but from diagnostics point of view it’s worth a try.
When I build the Android 4.3 ROM image for a Nexus 10 device (ARM7a) using the Android Open Source Project (AOSP) guidelines, the image works fine with no problem. However, when I add the following inline assembly code (adapted from here) to the Android Stack.cpp source file:
{uint32_t pmccntr;asm volatile("mrc p15, 0, %0, c9, c13, 0" : "=r"(pmccntr));t0=static_cast<int64_t>(pmccntr) * 64;}
//The C++ statement to measure its execution time
{uint32_t pmccntr;asm volatile("mrc p15, 0, %0, c9, c13, 0" : "=r"(pmccntr));t1=static_cast<int64_t>(pmccntr) * 64;}
time = t1-t0;
I get the follwong compiler error message:
Error: no such instruction: `mrc p15,0,%eax,c9,c13,0'
Notice that I never used eax in my added inline assembly code, however, the compiler error message shows eax.
According to the command line adb shell cat /proc/cpuinfo,
my device CPU is ARMv7 Processor rev 4 (v7l)
My build environment (according to the Android build mm command inside the directory /dalvik/vm/interp/ which contains the Stack.cpp file) is
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=4.3
TARGET_PRODUCT=full_manta
TARGET_BUILD_VARIANT=eng
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm
TARGET_ARCH_VARIANT=armv7-a-neon
TARGET_CPU_VARIANT=cortex-a15
HOST_ARCH=x86
HOST_OS=linux
HOST_OS_EXTRA=Linux-3.16.0-70-generic-x86_64-with-Ubuntu-14.04-trusty
HOST_BUILD_TYPE=release
BUILD_ID=JWR66V
OUT_DIR=out
Update#1
Below are the compiler's commands that are used when compiling the Stack.cpp file which are shown using the build command make -j4 libdvm showcommands
It seems that the correct compiler is used as shown highlighted in bold below:
target thumb C++: libdvm <= dalvik/vm/interp/Stack.cpp
prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.7/bin/arm-linux-androideabi-g++ -I libnativehelper/include/nativehelper -I dalvik -I dalvik/vm -I external/zlib -I libcore/include -I dalvik/libattr -I external/stlport/stlport -I bionic/ -I bionic/libstdc++/include -I dalvik/vm -I out/target/product/manta/obj/SHARED_LIBRARIES/libdvm_intermediates -I libnativehelper/include/nativehelper -isystem system/core/include -isystem hardware/libhardware/include -isystem hardware/libhardware_legacy/include -isystem hardware/ril/include -isystem libnativehelper/include -isystem frameworks/native/include -isystem frameworks/native/opengl/include -isystem frameworks/av/include -isystem frameworks/base/include -isystem external/skia/include -isystem out/target/product/manta/obj/include -isystem bionic/libc/arch-arm/include -isystem bionic/libc/include -isystem bionic/libc/kernel/common -isystem bionic/libc/kernel/arch-arm -isystem bionic/libm/include -isystem bionic/libm/include/arm -isystem bionic/libthread_db/include -c -fno-exceptions -Wno-multichar -msoft-float -fpic -fPIE -ffunction-sections -fdata-sections -funwind-tables -fstack-protector -Wa,--noexecstack -Werror=format-security -D_FORTIFY_SOURCE=1 -fno-short-enums -mcpu=cortex-a15 -mfloat-abi=softfp -mfpu=neon -include build/core/combo/include/arch/linux-arm/AndroidConfig.h -I build/core/combo/include/arch/linux-arm/ -Wno-unused-but-set-variable -fno-builtin-sin -fno-strict-volatile-bitfields -Wno-psabi -mthumb-interwork -DANDROID -fmessage-length=0 -W -Wall -Wno-unused -Winit-self -Wpointer-arith -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -DNDEBUG -g -Wstrict-aliasing=2 -fgcse-after-reload -frerun-cse-after-loop -frename-registers -DNDEBUG -UDEBUG -fvisibility-inlines-hidden -DANDROID -fmessage-length=0 -W -Wall -Wno-unused -Winit-self -Wpointer-arith -Wsign-promo -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -DNDEBUG -UDEBUG -mthumb -Os -fomit-frame-pointer -fno-strict-aliasing -fno-rtti -fstrict-aliasing -Wstrict-aliasing=2 -fno-align-jumps -Wall -Wextra -Wno-unused-parameter -DARCH_VARIANT=\"armv7-a-neon\" -DDVM_SHOW_EXCEPTION=1 -DWITH_JIT -DANDROID_SMP=1 -MD -MF out/target/product/manta/obj/SHARED_LIBRARIES/libdvm_intermediates/interp/Stack.d -o out/target/product/manta/obj/SHARED_LIBRARIES/libdvm_intermediates/interp/Stack.o dalvik/vm/interp/Stack.cpp
Update#2:
After changing the compile command-line to use -v to show the actual sub-tool commands that the g++ frontend invokes and adding the following compiler directives as suggested by #Peter Cordes
#if defined(__x86_64__) || defined(__i386__) #error "x86 What on earth" #endif
Below is the output of the compiling after using the command prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.7/bin/arm-linux-androideabi-g++ -v -o out/target/product/manta/obj/SHARED_LIBRARIES/libdvm_intermediates/interp/Stack.o dalvik/vm/interp/Stack.cpp
Notice the error below (at the end of the compiling output) is because I removed all compiler parameters except -v and -o to shorten the output (it's about 2 pages), so I used only prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.7/bin/arm-linux-androideabi-g++ -v -o
When I do not remove all the original parameters (about 30), I do not get that error fatal error: Dalvik.h: No such file or directory
prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.7/bin/arm-linux-androideabi-g++ -v -o out/target/product/manta/obj/SHARED_LIBRARIES/libdvm_intermediates/interp/Stack.o dalvik/vm/interp/Stack.cpp
Using built-in specs.
COLLECT_GCC=prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.7/bin/arm-linux-androideabi-g++
COLLECT_LTO_WRAPPER=/home/user/Android/nexus10/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.7/bin/../libexec/gcc/arm-linux-androideabi/4.7/lto-wrapper
Target: arm-linux-androideabi
Configured with: /tmp/AOSP-toolchain/build/../gcc/gcc-4.7/configure --prefix=/tmp/toolchain-build-linux/prefix --target=arm-linux-androideabi --host=x86_64-linux-gnu --build=x86_64-linux-gnu --with-gnu-as --with-gnu-ld --enable-languages=c,c++ --with-gmp=/tmp/toolchain-build-linux/temp-install --with-mpfr=/tmp/toolchain-build-linux/temp-install --with-mpc=/tmp/toolchain-build-linux/temp-install --with-cloog=/tmp/toolchain-build-linux/temp-install --with-ppl=/tmp/toolchain-build-linux/temp-install --disable-ppl-version-check --disable-cloog-version-check --enable-cloog-backend=isl --with-host-libstdcxx='-static-libgcc -Wl,-Bstatic,-lstdc++,-Bdynamic -lm' --disable-libssp --enable-threads --disable-nls --disable-libmudflap --disable-libgomp --disable-libstdc__-v3 --disable-sjlj-exceptions --disable-shared --disable-tls --disable-libitm --with-float=soft --with-fpu=vfp --with-arch=armv5te --enable-target-optspace --enable-initfini-array --disable-nls --prefix=/tmp/toolchain-build-linux/prefix --with-sysroot=/tmp/toolchain-build-linux/prefix/sysroot --with-binutils-version=2.22 --with-mpfr-version=3.1.1 --with-mpc-version=1.0.1 --with-gmp-version=5.0.5 --with-gcc-version=4.7 --with-gdb-version=7.3.x --with-gxx-include-dir=/tmp/toolchain-build-linux/prefix/include/c++/4.7 --with-bugurl=http://source.android.com/source/report-bugs.html --disable-bootstrap --disable-libquadmath --enable-plugins --enable-libgomp --enable-gold --enable-graphite=yes --with-cloog-version=0.17.0 --with-ppl-version=1.0 --with-arch=armv5te --program-transform-name='s&^&arm-linux-androideabi-&' --enable-gold=default
Thread model: posix
gcc version 4.7 (GCC)
COLLECT_GCC_OPTIONS='-v' '-o' 'out/target/product/manta/obj/SHARED_LIBRARIES/libdvm_intermediates/interp/Stack.o' '-march=armv5te' '-mfloat-abi=soft' '-mfpu=vfp' '-mtls-dialect=gnu'
/home/user/Android/nexus10/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.7/bin/../libexec/gcc/arm-linux-androideabi/4.7/cc1plus -quiet -v -iprefix /home/user/Android/nexus10/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.7/bin/../lib/gcc/arm-linux-androideabi/4.7/ -D_GNU_SOURCE dalvik/vm/interp/Stack.cpp -mbionic -fpic -quiet -dumpbase Stack.cpp -march=armv5te -mfloat-abi=soft -mfpu=vfp -mtls-dialect=gnu -auxbase Stack -version -fno-exceptions -fno-rtti -o /tmp/cctyR1ga.s
GNU C++ (GCC) version 4.7 (arm-linux-androideabi)
compiled by GNU C version 4.6.x-google 20120106 (prerelease), GMP version 5.0.5, MPFR version 3.1.1, MPC version 1.0.1
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
ignoring nonexistent directory "/home/user/Android/nexus10/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.7/bin/../lib/gcc/arm-linux-androideabi/4.7/../../../../arm-linux-androideabi/include"
ignoring nonexistent directory "/home/user/Android/nexus10/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.7/bin/../lib/gcc/../../include/c++/4.7"
ignoring nonexistent directory "/home/user/Android/nexus10/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.7/bin/../lib/gcc/../../include/c++/4.7/arm-linux-androideabi"
ignoring nonexistent directory "/home/user/Android/nexus10/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.7/bin/../lib/gcc/../../include/c++/4.7/backward"
ignoring duplicate directory "/home/user/Android/nexus10/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.7/bin/../lib/gcc/../../lib/gcc/arm-linux-androideabi/4.7/include"
ignoring nonexistent directory "/tmp/toolchain-build-linux/prefix/sysroot/usr/local/include"
ignoring duplicate directory "/home/user/Android/nexus10/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.7/bin/../lib/gcc/../../lib/gcc/arm-linux-androideabi/4.7/include-fixed"
ignoring nonexistent directory "/home/user/Android/nexus10/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.7/bin/../lib/gcc/../../lib/gcc/arm-linux-androideabi/4.7/../../../../arm-linux-androideabi/include"
ignoring nonexistent directory "/tmp/toolchain-build-linux/prefix/sysroot/usr/include"
#include "..." search starts here:
#include <...> search starts here:
/home/user/Android/nexus10/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.7/bin/../lib/gcc/arm-linux-androideabi/4.7/include
/home/user/Android/nexus10/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.7/bin/../lib/gcc/arm-linux-androideabi/4.7/include-fixed
End of search list.
GNU C++ (GCC) version 4.7 (arm-linux-androideabi)
compiled by GNU C version 4.6.x-google 20120106 (prerelease), GMP version 5.0.5, MPFR version 3.1.1, MPC version 1.0.1
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: c3359b46636f5ec5014b000ecf7eb5d5
dalvik/vm/interp/Stack.cpp:23:20: fatal error: Dalvik.h: No such file or directory
compilation terminated.
Update#3:
I wrote a simple C++ program called inlineAsm.cpp that uses an inline assembly code as suggested by #Peter Cordes which is shown below:
main()
{
int time, t0, t1, a;
{int pmccntr;asm volatile("mrc p15, 0, %0, c9, c13, 0" : "=r"(pmccntr));t0=(pmccntr) * 64;}
a=1;
{int pmccntr;asm volatile("mrc p15, 0, %0, c9, c13, 0" : "=r"(pmccntr));t1=(pmccntr) * 64;}
time = (t1-t0);
}
I compiled the above code using the following command:
prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.7/bin/arm-linux-androideabi-g++ inlineAsm.cpp
Below are the compiler error messages that I get:
/home/user/Android/nexus10/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.7/bin/../lib/gcc/arm-linux-androideabi/4.7/../../../../arm-linux-androideabi/bin/ld: error: cannot open crtbegin_dynamic.o: No such file or directory
/home/user/Android/nexus10/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.7/bin/../lib/gcc/arm-linux-androideabi/4.7/../../../../arm-linux-androideabi/bin/ld: error: cannot open crtend_android.o: No such file or directory
/home/user/Android/nexus10/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.7/bin/../lib/gcc/arm-linux-androideabi/4.7/../../../../arm-linux-androideabi/bin/ld: error: cannot find -lstdc++
/home/user/Android/nexus10/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.7/bin/../lib/gcc/arm-linux-androideabi/4.7/../../../../arm-linux-androideabi/bin/ld: error: cannot find -lm
/home/user/Android/nexus10/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.7/bin/../lib/gcc/arm-linux-androideabi/4.7/../../../../arm-linux-androideabi/bin/ld: error: cannot find -lc
/home/user/Android/nexus10/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.7/bin/../lib/gcc/arm-linux-androideabi/4.7/../../../../arm-linux-androideabi/bin/ld: error: cannot find -ldl
collect2: error: ld returned 1 exit status
This is very strange because as I said before when I remove the inline assembly code that I added to the Android Stack.cpp source code, I can compile and build the ROM image for a Nexus10 which is ARM7a and the I can flash the image to the device and the image works fine with no problem.
I have cloned the QtRemoteObjects repository from: http://code.qt.io/cgit/playground/qtremoteobjects.git/
on my Windows 7 using GitBash.exe.
The project files are download to "D:\Daten\Android\qtremoteobjects\". Based on the article on this website: https://www.kdab.com/qt-android-create-android-service-using-qt/ I run this command in GitBash:
$ cd d:/Daten/Android/qtremoteobjects/
$ git c:/Qt5.7.0/5.7/android_armv7/bin/qmake -r && make && make install
QMAKE PART
For the qmake part these errors show up:
Reading D:/Daten/Android/qtremoteobjects/tests/auto/cmake/cmake.pro
Das System kann den angegebenen Pfad nicht finden.
meaning the system could not find the given path. And the next two errors are:
WARNING: Failure to find: rep_server_source.h
Project MESSAGE: cmake executable not found. Not running CMake unit tests
First question: Why doesnt the system find the path for cmake.pro and rep_server_source.h and why isnt the cmake executable not found even though I have separately installed CMake.
MAKE PART
The next error that shows up is:
bash: make: command not found
As a solution to this I separated the qmake and make process. I first just ran qmake
$ git c:/Qt5.7.0/5.7/android_armv7/bin/qmake -r
and when qmake is finished (and the same errors as above still show up) i run mingw32-make.exe from Qt5.7->Tools in the qtremoteobjects folder:
$ c:/Qt5.7.0/Tools/mingw530_32/bin/mingw32-make.exe
and this is the result:
cd src/ && ( test -e Makefile || C:/Qt5.7.0/5.7/android_x86/bin/qmake.exe
D:/Daten/Android/qtremoteobjects/src/src.pro -o Makefile ) && C:/Qt5.7.0/Tools/mingw530_32/bin/mingw32-make -f Makefile
mingw32-make[1]: Entering directory 'D:/Daten/Android/qtremoteobjects/src'
cd remoteobjects/ && ( test -e Makefile || C:/Qt5.7.0/5.7/android_x86/bin/qmake.exe D:/Daten/Android/qtremoteobjects/src/remoteobjects/remoteobjects.pro -o Makefile ) && C:/Qt5.7.0/Tools/mingw530_32/bin/mingw32-make -f Makefile
mingw32-make[2]: Entering directory 'D:/Daten/Android/qtremoteobjects/src/remoteobjects'
D:\Daten\Android\android-ndk-r10e/toolchains/x86-4.9/prebuilt/windows/bin/i686-linux-android-g++ -c -ffunction-sections -funwind-tables -O2 -fomit-frame-pointer -fstrict-aliasing -funswitch-loops -finline-limit=300 -DANDROID -Wa,--noexecstack -std=c++11 -mfpmath=sse -O2 -O2 -fvisibility=hidden -fvisibility-inlines-hidden -fno-exceptions -Wall -Wno-psabi -W -Wvla -D_REENTRANT -fPIC -DQT_NO_XKBCOMMON -DQT_BUILD_REMOTEOBJECTS_LIB -DQT_BUILDING_QT -DQT_NO_CAST_TO_ASCII -DQT_ASCII_CAST_WARNINGS -DQT_MOC_COMPAT -DQT_USE_QSTRINGBUILDER -DQT_DEPRECATED_WARNINGS -DQT_DISABLE_DEPRECATED_BEFORE=0x050000 -DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_FROM_BYTEARRAY -DQT_NO_URL_CAST_FROM_STRING -DQT_BUILD_REMOTEOBJECTS_LIB -DQT_NO_EXCEPTIONS -DQT_NO_DEBUG -DQT_NETWORK_LIB -DQT_CORE_LIB -I. -Ic:/utils/openssl-android-master/include -I../../include -I../../include/QtRemoteObjects -I../../include/QtRemoteObjects/5.6.1 -I../../include/QtRemoteObjects/5.6.1/QtRemoteObjects -I. -IC:/Qt5.7.0/5.7/android_x86/include -IC:/Qt5.7.0/5.7/android_x86/include/QtNetwork -IC:/Qt5.7.0/5.7/android_x86/include/QtCore/5.7.0 -IC:/Qt5.7.0/5.7/android_x86/include/QtCore/5.7.0/QtCore -IC:/Qt5.7.0/5.7/android_x86/include/QtCore -I.moc -isystem D:/Daten/Android/android-ndk-r10e/sources/cxx-stl/gnu-libstdc++/4.9/include -isystem D:/Daten/Android/android-ndk-r10e/sources/cxx-stl/gnu-libstdc++/4.9/libs/x86/include -isystem D:/Daten/Android/android-ndk-r10e/platforms/android-9/arch-x86/usr/include -IC:/Qt5.7.0/5.7/android_x86/mkspecs/android-g++ -o .obj/qconnection_local_backend.obj qconnection_local_backend.cpp
Makefile:1720: recipe for target '.obj/qconnection_local_backend.obj' failed
process_begin: CreateProcess(NULL, D:\Daten\Android\android-ndk-r10e/toolchains/x86-4.9/prebuilt/windows/bin/i686-linux-android-g++ -c -ffunction-sections -funwind-tables -O2 -fomit-frame-pointer -fstrict-aliasing -funswitch-loops -finline-limit=300 -DANDROID -Wa,--noexecstack -std=c++11 -mfpmath=sse -O2 -O2 -fvisibility=hidden -fvisibility-inlines-hidden -fno-exceptions -Wall -Wno-psabi -W -Wvla -D_REENTRANT -fPIC -DQT_NO_XKBCOMMON -DQT_BUILD_REMOTEOBJECTS_LIB -DQT_BUILDING_QT -DQT_NO_CAST_TO_ASCII -DQT_ASCII_CAST_WARNINGS -DQT_MOC_COMPAT -DQT_USE_QSTRINGBUILDER -DQT_DEPRECATED_WARNINGS -DQT_DISABLE_DEPRECATED_BEFORE=0x050000 -DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_FROM_BYTEARRAY -DQT_NO_URL_CAST_FROM_STRING -DQT_BUILD_REMOTEOBJECTS_LIB -DQT_NO_EXCEPTIONS -DQT_NO_DEBUG -DQT_NETWORK_LIB -DQT_CORE_LIB -I. -Ic:/utils/openssl-android-master/include -I../../include -I../../include/QtRemoteObjects -I../../include/QtRemoteObjects/5.6.1 -I../../include/QtRemoteObjects/5.6.1/QtRemoteObjects -I. -IC:/Qt5.7.0/5.7/android_x86/include -IC:/Qt5.7.0/5.7/android_x86/include/QtNetwork -IC:/Qt5.7.0/5.7/android_x86/include/QtCore/5.7.0 -IC:/Qt5.7.0/5.7/android_x86/include/QtCore/5.7.0/QtCore -IC:/Qt5.7.0/5.7/android_x86/include/QtCore -I.moc -isystem D:/Daten/Android/android-ndk-r10e/sources/cxx-stl/gnu-libstdc++/4.9/include -isystem D:/Daten/Android/android-ndk-r10e/sources/cxx-stl/gnu-libstdc++/4.9/libs/x86/include -isystem D:/Daten/Android/android-ndk-r10e/platforms/android-9/arch-x86/usr/include -IC:/Qt5.7.0/5.7/android_x86/mkspecs/android-g++ -o .obj/qconnection_local_backend.obj qconnection_local_backend.cpp, ...) failed.
make (e=2): Das System kann die angegebene Datei nicht finden.
mingw32-make[2]: *** [.obj/qconnection_local_backend.obj] Error 2
mingw32-make[2]: Leaving directory 'D:/Daten/Android/qtremoteobjects/src/remoteobjects'
Makefile:44: recipe for target 'sub-remoteobjects-make_first-ordered' failed
mingw32-make[1]: *** [sub-remoteobjects-make_first-ordered] Error 2
mingw32-make[1]: Leaving directory 'D:/Daten/Android/qtremoteobjects/src'
Makefile:46: recipe for target 'sub-src-make_first' failed
mingw32-make: *** [sub-src-make_first] Error 2
Second Question Why is make not successful here? what do these errors mean? What is wrong with '.obj/qconnection_local_backend.obj'
Is it because I am running make on Windows?
Thanks,
I am building linphone-android on Ubuntu 14.04.
According to the the README file, I finish all pre-installation, run the check_tools.sh, and find no problem.
But, then running the prepare.py, I meet the below problem(in cmake/CMakeFiles/CMakeError.log):
Determining if the C compiler works failed with the following output:
Change Dir: /home/joelly/Downloads/linphone-android/WORK/android-arm/cmake/CMakeFiles/CMakeTmp
Run Build Command:/usr/bin/make "cmTryCompileExec3545077747/fast"
/usr/bin/make -f CMakeFiles/cmTryCompileExec3545077747.dir/build.make CMakeFiles/cmTryCompileExec3545077747.dir/build
make[1]: Entering directory `/home/joelly/Downloads/linphone-android/WORK/android-arm/cmake/CMakeFiles/CMakeTmp'
/usr/bin/cmake -E cmake_progress_report /home/joelly/Downloads/linphone-android/WORK/android-arm/cmake/CMakeFiles/CMakeTmp/CMakeFiles 1
Building C object CMakeFiles/cmTryCompileExec3545077747.dir/testCCompiler.c.o
/opt/android/ndk/toolchains/llvm/prebuilt/linux-x86_64/bin/clang -DANDROID -fPIE -isystem /opt/android/ndk/sources/android/cpufeatures -isystem /opt/android/ndk/sources/cxx-stl/gnu-libstdc++/4.9/include -isystem /opt/android/ndk/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi/include -isystem /opt/android/ndk/sources/android/support/include -ffunction-sections -funwind-tables -fstack-protector -no-canonical-prefixes -march=armv5te -mtune=xscale -msoft-float -fomit-frame-pointer -fno-strict-aliasing -o CMakeFiles/cmTryCompileExec3545077747.dir/testCCompiler.c.o -c /home/joelly/Downloads/linphone-android/WORK/android-arm/cmake/CMakeFiles/CMakeTmp/testCCompiler.c
error: unknown target CPU 'armv5te'
make[1]: Leaving directory `/home/joelly/Downloads/linphone-android/WORK/android-arm/cmake/CMakeFiles/CMakeTmp'
make[1]: *** [CMakeFiles/cmTryCompileExec3545077747.dir/testCCompiler.c.o] Error 1
make: *** [cmTryCompileExec3545077747/fast] Error 2
Bravo!
I update my cmake to the newest version , and work it out!
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 ?