Issues with building a kernel - General Topics

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.

Related

[Q] Building Android Kernel for MIPS

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

help in compiling kernel

i m trying to build a kernel for our devices
i have done every thing including config modifaction
n now m ready to compile the kernel but i have tried many commands for compiling kernel but the it always retur an error like for example when i put
this command
$ make ARCH=arm CROSS_COMPILE=$CCOMPILER -j4
or
$ make ARCH=arm CROSS_COMPILE=$CCOMPILER zImage -j4
get this error
[email protected]:~/kernel/omap$ make ARCH=arm CROSS_COMPILE=$CCOMPILER -j4
CHK include/linux/version.h
CHK include/generated/utsrelease.h
CC scripts/mod/empty.o
cc1: error: unrecognized command line option ‘-mlittle-endian’
cc1: error: unrecognized command line option ‘-mno-thumb-interwork’
scripts/mod/empty.c:1:0: error: unknown ABI (aapcs-linux) for -mabi= switch
scripts/mod/empty.c:1:0: error: bad value (armv5t) for -march= switch
make[2]: *** [scripts/mod/empty.o] Error 1
make[1]: *** [scripts/mod] Error 2
make: *** [scripts] Error 2
make: *** Waiting for unfinished jobs....
make: *** wait: No child processes. Stop.
[email protected]:~/kernel/omap$
plz help guyz its urgent!!!
Bro asking for technical help here isn't going to help, most devs do not look here. You try posting in various kernel threads for help, or private message a kernel developer for help
Cheers
Sent from my GT-i9003 powered by Stable and Smooth CyanogenMod 9!
1. make ARCH=arm CROSS_COMPILE=/home/name /toolchain/arm-eabi-4.4.0/bin/arm-eabi- menuconfig
2. make ARCH=arm CROSS_COMPILE=/home/name/toolchain/arm-eabi-4.4.0/bin/arm-eabi-
1. make ARCH=arm CROSS_COMPILE=/home/name /toolchain/arm-eabi-4.4.0/bin/arm-eabi- menuconfig
2. make ARCH=arm CROSS_COMPILE=/home/name/toolchain/arm-eabi-4.4.0/bin/arm-eabi-
Click to expand...
Click to collapse
Sent from my GT-I9003 using the XDA mobile application powered by Tapatalk

Having some troubles to build kernel from Github Repository

Hi,
I'm having some issues to build the kernel for my tablet Samsung Galaxy Tab p5110 from this github repo:
https://github.com/C...sung_espresso10
I'm getting the following error:
CC arch/arm/mach-omap2/common-board-devices.o
arch/arm/mach-omap2/common-board-devices.c:28: fatal error: linux/spi/ads7846.h: No such file or directory
compilation terminated.
make[1]: *** [arch/arm/mach-omap2/common-board-devices.o] Error 1
make: *** [arch/arm/mach-omap2] Error 2
I also had to edit arch/arm/mach-omap2/Makefile.sec because it was taking the BUILD_SOURCE as "".
I'm the doing the following steps:
# Sett the CROSS BUILD compiler here
make mrproper
make ARCH=arm cyanogenmod_p5110_defconfig
make -j4 ARCH=arm zImage
make clean
Any help will be appreciated.
Thanks,
Matias Kreder
This problem was caused because of the extract to .zip function of github. It corrupted some headers.
After building this kernel we were able to boot into CM10.1 but touch doesn't work, any idea why? do you know where should I ask?
I guess I should open a separate thread for that.

[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!

Compiling cm13 error 'unknown type init_shell'

Hello,
I'm coming from another phone and am new to this one. I'm jumping in to see if and where I can help with with bugs related to the cm13 device tree.
After almost a full compile, I'm running into an error I can't figure out.
Code:
No private recovery resources for TARGET_DEVICE osprey
make -C kernel/motorola/msm8916 O=/home/xclusive36/android/cm13/out/target/product/osprey/obj/KERNEL_OBJ ARCH=arm CROSS_COMPILE="/home/xclusive36/android/cm13/prebuilts/misc/linux-x86/ccache/ccache arm-eabi-" VARIANT_DEFCONFIG= SELINUX_DEFCONFIG= osprey_defconfig
host Executable: mkbootfs (/home/xclusive36/android/cm13/out/host/linux-x86/obj/EXECUTABLES/mkbootfs_intermediates/mkbootfs)
make[1]: Entering directory `/home/xclusive36/android/cm13/kernel/motorola/msm8916'
Install: /home/xclusive36/android/cm13/out/host/linux-x86/lib64/libcutils.so
/home/xclusive36/android/cm13/out/host/linux-x86/bin/checkpolicy: loading policy configuration from /home/xclusive36/android/cm13/out/target/product/osprey/obj/ETC/sepolicy_intermediates/policy.conf
device/motorola/osprey/sepolicy/init_shell.te:2:ERROR 'unknown type init_shell' at token ';' on line 26943:
#line 1 "device/motorola/osprey/sepolicy/init_shell.te"
allow init_shell utags_block_device:blk_file { getattr open read ioctl lock };
checkpolicy: error(s) encountered while parsing configuration
make: *** [/home/xclusive36/android/cm13/out/target/product/osprey/obj/ETC/sepolicy_intermediates/sepolicy] Error 1
make: *** Waiting for unfinished jobs....
GEN /home/xclusive36/android/cm13/out/target/product/osprey/obj/KERNEL_OBJ/Makefile
#
# configuration written to .config
#
make[1]: Leaving directory `/home/xclusive36/android/cm13/kernel/motorola/msm8916'
make: Leaving directory `/home/xclusive36/android/cm13'
#### make failed to build some targets (07:12 (mm:ss)) ####
Any help would be appreciated.
Thanks
xclusive36 said:
Hello,
I'm coming from another phone and am new to this one. I'm jumping in to see if and where I can help with with bugs related to the cm13 device tree.
After almost a full compile, I'm running into an error I can't figure out.
Code:
No private recovery resources for TARGET_DEVICE osprey
make -C kernel/motorola/msm8916 O=/home/xclusive36/android/cm13/out/target/product/osprey/obj/KERNEL_OBJ ARCH=arm CROSS_COMPILE="/home/xclusive36/android/cm13/prebuilts/misc/linux-x86/ccache/ccache arm-eabi-" VARIANT_DEFCONFIG= SELINUX_DEFCONFIG= osprey_defconfig
host Executable: mkbootfs (/home/xclusive36/android/cm13/out/host/linux-x86/obj/EXECUTABLES/mkbootfs_intermediates/mkbootfs)
make[1]: Entering directory `/home/xclusive36/android/cm13/kernel/motorola/msm8916'
Install: /home/xclusive36/android/cm13/out/host/linux-x86/lib64/libcutils.so
/home/xclusive36/android/cm13/out/host/linux-x86/bin/checkpolicy: loading policy configuration from /home/xclusive36/android/cm13/out/target/product/osprey/obj/ETC/sepolicy_intermediates/policy.conf
device/motorola/osprey/sepolicy/init_shell.te:2:ERROR 'unknown type init_shell' at token ';' on line 26943:
#line 1 "device/motorola/osprey/sepolicy/init_shell.te"
allow init_shell utags_block_device:blk_file { getattr open read ioctl lock };
checkpolicy: error(s) encountered while parsing configuration
make: *** [/home/xclusive36/android/cm13/out/target/product/osprey/obj/ETC/sepolicy_intermediates/sepolicy] Error 1
make: *** Waiting for unfinished jobs....
GEN /home/xclusive36/android/cm13/out/target/product/osprey/obj/KERNEL_OBJ/Makefile
#
# configuration written to .config
#
make[1]: Leaving directory `/home/xclusive36/android/cm13/kernel/motorola/msm8916'
make: Leaving directory `/home/xclusive36/android/cm13'
#### make failed to build some targets (07:12 (mm:ss)) ####
Any help would be appreciated.
Thanks
Click to expand...
Click to collapse
You'll need the SELinux patch on gerrit. It's still a WIP. http://review.cyanogenmod.org/#/c/118765/
squid2 said:
You'll need the SELinux patch on gerrit. It's still a WIP. http://review.cyanogenmod.org/#/c/118765/
Click to expand...
Click to collapse
Gotcha, thanks for the reply. I was able to get a full compile by removing that folder from the device/motorola/osprey folder. I'll take a look at that patch tonight when I get off of work and try it again with SELinux enabled.

Categories

Resources