[Q] Building Android Kernel for MIPS - Android Software/Hacking General [Developers Only]

I've spent several days for building the android kernel for MIPS, but no luck for me.
Anyone here please help!
Some facts:
I'm running Ubuntu 10.04 64 bit in VM ware on Windows 7 64bit machine.
Kernel Version 3.0.8, downloaded from develope.mips : android-porting-guide
Toolchain: Sourcery_CodeBench_Lite_for_MIPS_GNU_Linux, gcc version 4.5.2
.config: Extract from Ainol Paladin Tablet. ICS 4.0.1, Kernel:3.0.8
I used the below commands:
$ export compiler=/home/android/tool/sourcerymips/bin/mips-linux-gnu-
$ make ARCH=mips menuconfig
$ make ARCH=mips CROSS_COMPLIE=$compiler
Click to expand...
Click to collapse
The errors
...
CC arch/mips/kernel/time.o
CC arch/mips/kernel/topology.o
CC arch/mips/kernel/traps.o
cc1: warnings being treated as errors
arch/mips/kernel/traps.c: In function 'trap_init':
arch/mips/kernel/traps.c:1815:6: error: "cpu_data" is not defined
arch/mips/kernel/traps.c:1815:6: error: token "[" is not valid in preprocessor expressions
arch/mips/kernel/traps.c:1943:6: error: "cpu_data" is not defined
arch/mips/kernel/traps.c:1943:6: error: token "[" is not valid in preprocessor expressions
make[2]: *** [arch/mips/kernel/traps.o] Error 1
make[1]: *** [arch/mips/kernel] Error 2
make: *** [arch/mips] Error 2
Click to expand...
Click to collapse

Related

CyanogenMod 11 Build issues

I get random errors here and there at times when compiling CyanogenMod 11, like
external/llvm/lib/CodeGen/ScheduleDAGInstrs.cpp: In member function 'void llvm::SDep::setLatency(unsigned int)':
external/llvm/lib/CodeGen/ScheduleDAGInstrs.cpp:276:49: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://source.android.com/source/report-bugs.html> for instructions.
make: *** [/home/suyash/cm11/out/target/product/m7ul/obj/STATIC_LIBRARIES/libLLVMCodeGen_intermediates/ScheduleDAGInstrs.o] Error 1
make: *** Waiting for unfinished jobs....
Click to expand...
Click to collapse
/home/suyash/cm11/prebuilts/gcc/linux-x86/host/i686-linux-glibc2.7-4.6/bin/../lib/gcc/i686-linux/4.6.x-google/../../../../i686-linux/include/c++/4.6.x-google/bits/locale_facets.tcc:324:1: error: '$' was not declared in this scope
/home/suyash/cm11/prebuilts/gcc/linux-x86/host/i686-linux-glibc2.7-4.6/bin/../lib/gcc/i686-linux/4.6.x-google/../../../../i686-linux/include/c++/4.6.x-google/bits/locale_facets.tcc:324:9: error: expected ';' before '{' token
make: *** [/home/suyash/cm11/out/host/linux-x86/obj/STATIC_LIBRARIES/libclangCodeGen_intermediates/CGCleanup.o] Error 1
make: *** Waiting for unfinished jobs....
Click to expand...
Click to collapse
This is acceptable
then I get this error:
The present kernel configuration has modules disabled.
Type 'make config' and enable loadable module support.
Then build a kernel with module support enabled.
make[2]: *** [modules] Error 1
make[1]: *** [sub-make] Error 2
Click to expand...
Click to collapse
I can't find a way to fix this.
Ubuntu 13.10 x64
Building for HTC One m7ul
CyanogenMod 11
OpenJDK 1.6
I fetched all the required repos btw. Can anyone help in fixing the issues?

Compiling Kernel

I keep getting kernel compilation error when trying to compile CM kernel from sources.
Code:
/tmp/cc0DKVco.s: Assembler messages:
/tmp/cc0DKVco.s:172: Warning: swp{b} use is deprecated for ARMv6 and ARMv7
/tmp/cc0DKVco.s:199: Warning: swp{b} use is deprecated for ARMv6 and ARMv7
CC arch/arm/mach-msm/smd_private.o
CC arch/arm/mach-msm/smem.o
CC arch/arm/kernel/pmu.o
CC kernel/resource.o
CC arch/arm/kernel/perf_event.o
CC arch/arm/mach-msm/smd_init_dt.o
CC kernel/sysctl.o
arch/arm/mach-msm/smd_init_dt.c:24:25: fatal error: smd_private.h: No such file or directory
#include <smd_private.h>
^
compilation terminated.
make[1]: *** [arch/arm/mach-msm/smd_init_dt.o] Error 1
make: *** [arch/arm/mach-msm] Error 2
make: *** Waiting for unfinished jobs....
No mods or tweaks has been added, just compiling with A7 optimized (linaro) toolchain on Ubuntu 13.10. I'm pretty sure I have installed all the necessary files and set-up the build environment. I'm new to this so could a dev help me?
bu,p
Same for me, where is the problem? can anyone help?
here is my output:
Code:
arch/arm/mach-msm/smd_init_dt.c:24:25: error: smd_private.h: No such file or directory
arch/arm/mach-msm/smd_init_dt.c: In function 'msm_smsm_probe':
arch/arm/mach-msm/smd_init_dt.c:66: error: 'disable_smsm_reset_handshake' undeclared (first use in this function)
arch/arm/mach-msm/smd_init_dt.c:66: error: (Each undeclared identifier is reported only once
arch/arm/mach-msm/smd_init_dt.c:66: error: for each function it appears in.)
arch/arm/mach-msm/smd_init_dt.c:88: error: 'msm_smd_debug_mask' undeclared (first use in this function)
arch/arm/mach-msm/smd_init_dt.c:88: error: 'MSM_SMSM_DEBUG' undeclared (first use in this function)
arch/arm/mach-msm/smd_init_dt.c:88: error: 'smd_log_ctx' undeclared (first use in this function)
arch/arm/mach-msm/smd_init_dt.c:114: error: implicit declaration of function 'smd_get_intr_config'
arch/arm/mach-msm/smd_init_dt.c:114: warning: assignment makes pointer from integer without a cast
error, forbidden warning: smd_init_dt.c:114
make[1]: *** [arch/arm/mach-msm/smd_init_dt.o] Errore 1
make: *** [arch/arm/mach-msm] Errore 2
make: *** Attesa per i processi non terminati....
CC arch/arm/kernel/pmu.o
LD arch/arm/perfmon/built-in.o
CC arch/arm/kernel/perf_event.o
arch/arm/kernel/bootinfo.c: In function 'bootinfo_bck_buf_check':
arch/arm/kernel/bootinfo.c:277: warning: integer constant is too large for 'long' type
error, forbidden warning: bootinfo.c:277
EDIT: I solved the smd_privae.h not found simply by copying it from mach-msm into mach-msm/include/mach and replacing
Code:
#include <smd_private.h>
with
Code:
#include <mach/smd_private.h>
But i still have this problem: in bootinfo.c the value BOOTINFO_BCK_MAGIC (defined as #define BOOTINFO_BCK_MAGIC 0x626f6f74696e666f) is an integer costant which is too large for 'long' type (at line 277 in the expression if (bck->magic != BOOTINFO_BCK_MAGIC))
Any help?
EDIT2: solved it thanks to google and stackoverflow, just replace 0x626F6F74696E666F with 0x626F6F74696E666FULL (where ULL = Unsigned Long Long, not sure about the meaning, still a complete noob at C++ (not even sure it is C++) :silly:

[Completed] [Q] Errors building samsung android kernel on ubuntu 14.04

I am following this tutorial
http://forum.xda-developers.com/showthread.php?t=2152819
I get the following when i execute
Code:
$make maker.defconfig
make: Nothing to be done for `maker.defconfig'.
Then i set the CROSS_COMPILER and echo it
Code:
$ echo $CROSS_COMPILE
/usr/bin/arm-none-eabi-
and when i execute
Code:
$make ARCH=arm
i get the following errors
///////////////////////////////////////
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
gcc: error: unrecognized argument in option ‘-mabi=apcs-gnu’
gcc: note: valid arguments to ‘-mabi=’ are: ms sysv
gcc: error: unrecognized command line option ‘-mlittle-endian’
gcc: error: unrecognized command line option ‘-mapcs’
gcc: error: unrecognized command line option ‘-mno-sched-prolog’
make[1]: *** [kernel/bounds.s] Error 1
make: *** [prepare0] Error 2
////////////////////////////////////////////////////
Any idea how to resolve these
I got the same errors using Android NDK toolchain.
Thanks
Hi,
You can browse through this section for other guides and tutorials that may help, there are many,
http://forum.xda-developers.com/chef-central/android
Or, you can ask for help in the tutorial thread you already linked here. Failing all that, you can start your own thread in the section above and ask for help.
Good luck!

Need help with KVM-Enabled stock kernel compilation

I am having an issue when compiling the kernel with KVM Enabled options, I am using the stock google toolchain and I am compiling the stock OnePlus pie kernel :
In file included from arch/arm64/kvm/../../../arch/arm/kvm/arm.c:44:0:
./arch/arm64/include/asm/kvm_mmu.h: In function 'kvm_get_hyp_vector':
./arch/arm64/include/asm/kvm_mmu.h:328:3: error: implicit declaration of function 'has_vhe' [-Werror=implicit-function-declaration]
if (!has_vhe())
^
cc1: some warnings being treated as errors
scripts/Makefile.build:298: recipe for target 'arch/arm64/kvm/../../../arch/arm/kvm/arm.o' failed
make[1]: *** [arch/arm64/kvm/../../../arch/arm/kvm/arm.o] Error 1
AS arch/arm64/kernel/kuser32.o
Makefile:995: recipe for target 'arch/arm64/kvm' failed
make: *** [arch/arm64/kvm] Error 2

Issues with building a kernel

I'm trying to build a kernel with the CONFIG_USB_SERIAL_CH341 driver for my Xiaomi Redmi 6 running LOS, but I'm having troubles doing so. My best guess would be that I have the wrong toolchain? I would like to ask for help, any pointers, guides, reading material, etc. If you have any questions, requests for logs, ask and I'll try to hastily respond.
Linux 5.15.7
gcc (GCC) 11.1.0
arm-none-eabi-gcc (Arch Repository) 11.2.0
Target kernel
cd android_kernel_xiaomi_mt6765/
export ARCH=arm & export SUBARCH=arm
echo 'CONFIG_USB_SERIAL_CH341=y' >> arch/arm/configs/cereus_defconfig
make clean
make mrproper
make cereus_defconfig
make -j$(nproc)
Returns: 'Cannot use CONFIG_CC_STACKPROTECTOR_STRONG: -fstack-protector-strong not supported by compiler'.
After commenting out the stackprotector from the defconfig and making again... returns:
'/usr/bin/ld: scripts/dtc/dtc-parser.tab.o:(.bss+0x10): multiple definition of `yylloc'; scripts/dtc/dtc-lexer.lex.o:(.bss+0x0): first defined here
HOSTLD scripts/genksyms/genksyms
collect2: error: ld returned 1 exit status
make[2]: *** [scripts/Makefile.host:110: scripts/dtc/dtc] Error 1
make[1]: *** [scripts/Makefile.build:648: scripts/dtc] Error 2
make: *** [Makefile:560: scripts] Error 2'
I tried removing the yylloc lines from the dtc related files, but only to watch even more bizarre errors being thrown at me... From what I searched prepending the line with the 'extern' modifier was a common fix, but in the source code it was already defined as extern YYLTYPE yylloc;
I would be very grateful for any help.

Categories

Resources