Not able to find the problem:
make PLATFORM=android
make[2]: Entering directory `/home/debian/Downloads/nonemaioq3'
CC code/client/cl_cgame.c
/prog/toolchain/arm-linux-androideabi-4.6/bin/arm-linux-androideabi-gcc: 4: /prog/toolchain/arm-linux-androideabi-4.6/bin/arm-linux-androideabi-gcc: Syntax error: Unterminated quoted string
make[2]: *** [build/release-android-arm/client/cl_cgame.o] Error 2
make[2]: Leaving directory `/home/debian/Downloads/nonemaioq3'
make[1]: *** [targets] Error 2
make[1]: Leaving directory `/home/debian/Downloads/nonemaioq3'
make: *** [release] Error 2
and this is the Makefile I got:
http://pastebin.com/QYZYVvTn
I don't find any problem there :S Help please.
The line
CC code/client/cl_cgame.c
starts the compiler (C Compiler or CC). The error message is after the CC and doesn't start with make, so it relates to the compiler, not the Makefile.
/prog/toolchain/arm-linux-androideabi-4.6/bin/arm-linux-androideabi-gcc: 4: /prog/toolchain/arm-linux-androideabi-4.6/bin/arm-linux-androideabi-gcc: Syntax error: Unterminated quoted string
gcc is the GNU C compiler. The error is in the file /prog/toolchain/arm-linux-androideabi-4.6/bin/arm-linux-androideabi-gcc, on line 4.
In view of your comment, "arm-linux" means that version of GCC is meant to run on ARM processors. If you are running this on a PC, you want a gcc with "x86" or "x64" in place of "arm." That would be a cross-compiling situation; see here for links on how to set that up.
Related
Build output is:
... very long output of compiled files is omitted...
[MAK] CustomTarget/android/source/done
creating liboSettings.gradle
[build PY ] native-code.cxx
/bin/sh: 1: /home/bart/Projects/libreoffice/solenv/bin/native-code.py: not found
Makefile:15: recipe for target 'native-code.cxx' failed
make[2]: *** [native-code.cxx] Error 127
/home/bart/Projects/libreoffice/android/CustomTarget_lo_android.mk:17: recipe for target '/home/bart/Projects/libreoffice/workdir/CustomTarget/android/source/done' failed
make[1]: *** [/home/bart/Projects/libreoffice/workdir/CustomTarget/android/source/done] Error 2
Makefile:282: recipe for target 'build' failed
make: *** [build] Error 2
I am on Ubuntu 18.04.2 LTS.
My autogen.input is:
--with-distro=LibreOfficeAndroid
--with-android-sdk=/home/bart/Android/Sdk
--with-android-ndk=/home/bart/Android/android-ndk-r20
--with-jdk-home=/usr/lib/jvm/java-8-openjdk-amd64
I have used this page as a manual.
Also, I have noticed that native-code.cxx file is empty in libreoffice/android/source
Ok, figured it out. I didn't had python2 installed on my system (however had python3). Could configure check it?
The build environment is ubuntu 16.04 with latest gcc 5.4.0 and GNU Make 3.82. My target is an am335x custom board which can run android 4.4. I am going to support it for android 7.1.1.
The project is fetched from google android manifest tag android-7.1.1_r46 and the kernel is from msm tag android-7.1.1_r0.63. The cross compiler I am using is from prebuilts/gcc/linux-x86/arm/arm-eabi-4.8/bin.
That is the environment information. I haven't installed the NDK or SDK yet because I saw the api level for android 7.1.1 is 25 while the newest NDK only support up to 24, so I get a bit confused what to do.
If I run the command: m -j8 uboot linux
The uboot compiles fine, but there are a lot of errors when compiling the linux kernel.
/media/yangjiel/disk2/android/kernel/arch/arm/mach-omap2/prm_common.c: In function 'omap_prcm_register_chain_handler':
/media/yangjiel/disk2/android/kernel/arch/arm/mach-omap2/prm_common.c:293:2: warning: passing argument 2 of 'irq_set_chained_handler' from incompatible pointer type [enabled by default]
error, forbidden warning: prm_common.c:293
make[2]: *** [arch/arm/mach-omap2/prm_common.o] Error 1
make[1]: *** [arch/arm/mach-omap2] Error 2
make[1]: *** Waiting for unfinished jobs....
/media/yangjiel/disk2/android/kernel/kernel/sysctl_binary.c:141:13: error: 'KERN_BOOT_REASON' undeclared here (not in a function)
{ CTL_INT, KERN_BOOT_REASON, "boot_reason" },
^
/media/yangjiel/disk2/android/kernel/kernel/sysctl_binary.c:528:13: error: 'NET_IPV6_ACCEPT_RA_PREFIX_ROUTE' undeclared here (not in a function)
{ CTL_INT, NET_IPV6_ACCEPT_RA_PREFIX_ROUTE, "accept_ra_prefix_route" },
^
/media/yangjiel/disk2/android/kernel/kernel/sysctl_binary.c:528:2: error: initializer element is not constant
{ CTL_INT, NET_IPV6_ACCEPT_RA_PREFIX_ROUTE, "accept_ra_prefix_route" },
^
/media/yangjiel/disk2/android/kernel/kernel/sysctl_binary.c:528:2: error: (near initialization for 'bin_net_ipv6_conf_var_table[24].ctl_name')
make[2]: *** [kernel/sysctl_binary.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [kernel] Error 2
make: *** [sub-make] Error 2
make: Leaving directory `/media/yangjiel/disk2/android/kernel'
ninja: build stopped: subcommand failed.
make: *** [ninja_wrapper] Error 1
make: Leaving directory `/media/yangjiel/disk2/android'
If I drop the lines in that file which causing this error, the error above is resolved but I would get another
/media/yangjiel/disk2/android/kernel/kernel/cgroup.c: In function 'subsys_cgroup_allow_attach':
/media/yangjiel/disk2/android/kernel/kernel/cgroup.c:2138:37: error: invalid operands to binary != (have 'kuid_t' and 'kuid_t')
if (current != task && cred->euid != tcred->uid &&
^
/media/yangjiel/disk2/android/kernel/kernel/cgroup.c:2139:18: error: invalid operands to binary != (have 'kuid_t' and 'kuid_t')
cred->euid != tcred->suid)
^
make[2]: *** [kernel/cgroup.o] Error 1
make[2]: *** Waiting for unfinished jobs....
CC kernel/trace/power-traces.o
CC kernel/trace/rpm-traces.o
CC kernel/trace/trace_probe.o
LD kernel/trace/libftrace.o
LD kernel/trace/built-in.o
make[1]: *** [kernel] Error 2
make: *** [sub-make] Error 2
make: Leaving directory `/media/yangjiel/disk2/android/kernel'
ninja: build stopped: subcommand failed.
make: *** [ninja_wrapper] Error 1
make: Leaving directory `/media/yangjiel/disk2/android'
There are more errors behind.
I have googled around and most of the people say this is a tool chain problem. But I don't find a lot of instruction about how to install the tool chain properly especially for 7.1.1. There seems to be no tool chain needed for the android 4.4 kernel. I fetch the custom android 4.4 kernel and it compiles fine.
The problem above is because I downloaded a wrong version of Android kernel. What I downloaded is https://android.googlesource.com/kernel/msm/+/android-7.1.1_r0.63, and this is kernel v3.10.
Obviously this is not for Android 7.1.1 (which should be using kernel v4.4). So when I am trying to compile "old" kernel with the "new" cross compiler from the prebuilt, it generated whole bunch errors that the "old" compiler won't. I end up using the kernel from https://android.googlesource.com/kernel/common/+/upstream-linux-4.4.y upstream-linux-4.4.y branch, it is compatible with Android 7.0 to 7.1.2.
I have no idea why google name it as android-7.1.1_r0.63, but that definitely not for Android 7.1.1 to use. Hope nobody has the same problem as I did.
For cross compiling MPICH2 for Android.
I found the reference here
http://hex.ro/wp/projects/personal-cloud-computing/compiling-mpich2-for-android-and-running-on-two-phones/
and here
www.scientificbulletin.upb.ro/rev_docs_arhiva/fullffc_583765.
I did following
BuildRoot
Used Build Root (buildroot-2016.02) for cross compiling ARM toolchain
Target options :
Target Architecture as ARM little endian
Target binary format as ELF
Selected Toolchain as Buildroot toolchain (Internal)
Kernel headers as 3.12.x
C library as uClibc
After this make command was run.
MPICH2
mpich-3.2.tar.gz was extracted and following commands were executed
1. $ export PATH=/home/mpiuser/CrossBuild/buildroot-2016.02/output/host/usr/bin:$PATH
2. $ sudo ./configure --prefix=/home/mpiuser/CrossBuild/arm-mpich-install --disable-fortran CC=/home/mpiuser/CrossBuild/buildroot-2016.02/output/host/usr/bin/arm-linux-gcc --host=arm-linux
After this make was run for mpich-3.2, and during compilation following error was thrown :
GEN lib/libmpi.la
CXX src/binding/cxx/initcxx.lo
CXXLD lib/libmpicxx.la
lib/.libs/libmpi.so: error adding symbols: File in wrong format
collect2: error: ld returned 1 exit status
make[2]: *** [lib/libmpicxx.la] Error 1
make[2]: Leaving directory `/home/mpiuser/CrossBuild/mpich-3.2'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/mpiuser/CrossBuild/mpich-3.2'
make: *** [all] Error 2
Request to please help. Thanks
I'm trying to compile a shared library using cmake. I followed the instruction on this tutorial to change the toolchain for android NDK.
However, I'm getting the following output error:
/home/usr/android-toolchain/bin/../lib/gcc/arm-linux-androideabi/4.9/../../../../arm-linux-androideabi/bin/ld: error: cannot find -lpthread
collect2: error: ld returned 1 exit status
make[2]: *** [../libs/armeabi-v7a/libutils.so] Error 1
make[1]: *** [src/CMakeFiles/utils.dir/all] Error 2
make: *** [all] Error 2
A bit of googling around and I stumble upon this stackoverflow post. So I modified my CMakeLists.txt to add:
set(CMAKE_CXX_FLAGS"-DHAVE_PTHREADS")
but it seems like it still doesn't work. Am I going about this the wrong way?
Thanks!
I try to build the rt73.ko linux driver for android using cross complile. I have download the android NDK and the Kernel sources of the the target system (Rockchip RK3066) and when I build the driver I am getting the following error:
root#slax:~/2011_0210_RT73_Linux_STA_Drv1.1.0.5/Module# make
CROSS_COMPILE=arm-linux-androideabi- make -C /root/kernel
SUBDIRS=/root/2011_0210_RT73_Linux_STA_Drv1.1.0.5/Module mod-ules
make[1]: Entering directory /root/kernel' CC [M]
/root/2011_0210_RT73_Linux_STA_Drv1.1.0.5/Module/rtmp_main.o
/root/2011_0210_RT73_Linux_STA_Drv1.1.0.5/Module/rtmp_main.c: In
function 'usb_rtusb_probe':
/root/2011_0210_RT73_Linux_STA_Drv1.1.0.5/Module/rtmp_main.c:1152:3:
warning: return makes integer from pointer without a cast [enabled by
default] /root/2011_0210_RT73_Linux_STA_Drv1.1.0.5/Module/rtmp_main.c:
In function 'usb_rtusb_disconnect':
/root/2011_0210_RT73_Linux_STA_Drv1.1.0.5/Module/rtmp_main.c:1315:2:
warning: ISO C90 forbids mixed declarations and code
[-Wdeclaration-after-statement]
/root/2011_0210_RT73_Linux_STA_Drv1.1.0.5/Module/rtmp_main.c: In
function 'usb_rtusb_close':
/root/2011_0210_RT73_Linux_STA_Drv1.1.0.5/Module/rtmp_main.c:655:1:
warning: the frame size of 2128 bytes is larger than 1024 bytes
[-Wframe-larger-than=]
/root/android-ndk-r8c/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/as:
/usr/lib/libz.so.1: no version information available (required by
/root/android-ndk-r8c/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/as)
/bin/sh: scripts/basic/fixdep: cannot execute binary file make[2]: ***
[/root/2011_0210_RT73_Linux_STA_Drv1.1.0.5/Module/rtmp_main.o] Error
126 make[1]: ***
[_module_/root/2011_0210_RT73_Linux_STA_Drv1.1.0.5/Module] Error 2
make[1]: Leaving directory/root/kernel' make: * [all] Error 2
Could you please help me to overcome the above error?
Although you cross compile, only the kernel can be compiled. scripts/basic/fixdep is userland program.
To overcome this, you need to use http://crosstool-ng.org/ for example.