I am trying to build a kernel for moto g 2014
I have tried using linaro and stock gcc toolchains.
Code:
[email protected]:~/kernelmoto$ export ARCH=arm
[email protected]:~/kernelmoto$ export CROSS_COMPILER=~/android/aosp-6.0/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.9/bin/arm-linux-androideabi-
[email protected]:~/kernelmoto$
[email protected]:~/kernelmoto$ make titan_defconfig
drivers/usb/gadget/Kconfig:881:warning: defaults for choice values not supported
#
# configuration written to .config
#
[email protected]:~/kernelmoto$ make clean && mrproper
CLEAN .
CLEAN arch/arm/kernel
CLEAN kernel
CLEAN security/selinux
CLEAN usr
CLEAN arch/arm/boot
CLEAN .tmp_versions
mrproper: command not found
[email protected]:~/kernelmoto$ make -j6
HOSTCC scripts/basic/fixdep
HOSTCC scripts/kconfig/conf.o
HOSTCC scripts/kconfig/zconf.tab.o
HOSTLD scripts/kconfig/conf
scripts/kconfig/conf --silentoldconfig Kconfig
drivers/usb/gadget/Kconfig:881:warning: defaults for choice values not supported
CHK include/linux/version.h
CHK include/generated/utsrelease.h
HOSTCC scripts/conmakehash
HOSTCC scripts/kallsyms
CC scripts/mod/empty.o
HOSTCC scripts/dtc/checks.o
gcc: error: unrecognized argument in option ‘-mabi=aapcs-linux’
gcc: note: valid arguments to ‘-mabi=’ are: ms sysv
gcc: error: unrecognized command line option ‘-mlittle-endian’
gcc: error: unrecognized command line option ‘-mno-thumb-interwork’
scripts/Makefile.build:307: recipe for target 'scripts/mod/empty.o' failed
make[2]: *** [scripts/mod/empty.o] Error 1
scripts/Makefile.build:443: recipe for target 'scripts/mod' failed
make[1]: *** [scripts/mod] Error 2
make[1]: *** Waiting for unfinished jobs....
HOSTCC scripts/selinux/genheaders/genheaders
HOSTCC scripts/dtc/data.o
HOSTCC scripts/selinux/mdp/mdp
HOSTCC scripts/dtc/dtc-lexer.lex.o
make[1]: 'include/generated/mach-types.h' is up to date.
HOSTCC scripts/dtc/dtc-parser.tab.o
HOSTCC scripts/dtc/dtc.o
HOSTCC scripts/dtc/flattree.o
CC kernel/bounds.s
HOSTCC scripts/dtc/fstree.o
gcc: error: unrecognized argument in option ‘-mabi=aapcs-linux’
gcc: note: valid arguments to ‘-mabi=’ are: ms sysv
gcc: error: unrecognized command line option ‘-mlittle-endian’
gcc: error: unrecognized command line option ‘-mno-thumb-interwork’
/home/sid/kernelmoto/./Kbuild:35: recipe for target 'kernel/bounds.s' failed
make[1]: *** [kernel/bounds.s] Error 1
Makefile:995: recipe for target 'prepare0' failed
make: *** [prepare0] Error 2
make: *** Waiting for unfinished jobs....
HOSTCC scripts/dtc/livetree.o
HOSTCC scripts/dtc/srcpos.o
HOSTCC scripts/dtc/util.o
HOSTCC scripts/dtc/treesource.o
HOSTLD scripts/dtc/dtc
Makefile:515: recipe for target 'scripts' failed
make: *** [scripts] Error 2
[email protected]:~/kernelmoto$
how to fix these errors? any help will be appreciated.
Related
I can't seem to catch a break...
I haven't been able to compile anything with my build environment. For at least a few weeks. I know it should work, because I compiled a build of WD40M0D prior to all my merging of source. I'm using a MacBookPro running OS X 10.5.8
When trying to build a kernel, I get errors on "bounds.s" and "prepare0":
Code:
sean-whitleys-macbook-pro:kernel-msm wdfowty$ make ARCH=arm CROSS_COMPILE=$CCOMPILER
scripts/kconfig/conf -s arch/arm/Kconfig
CHK include/linux/version.h
UPD include/linux/version.h
CHK include/generated/utsrelease.h
UPD include/generated/utsrelease.h
Generating include/generated/mach-types.h
CC kernel/bounds.s
cc1: error: invalid option ‘little-endian’
cc1: error: invalid option ‘abi=aapcs-linux’
cc1: error: invalid option ‘no-thumb-interwork’
kernel/bounds.c:1: error: bad value (armv5t) for -march= switch
kernel/bounds.c:1: error: bad value (armv5t) for -mtune= switch
make[1]: *** [kernel/bounds.s] Error 1
make: *** [prepare0] Error 2
My next error, if I skip the kernel, is in building libgps.so...It claims to not be able to find librpc.so, which to the best of my knowledge is where it's supposed to be (somewhere in the out directory).
Code:
#
/Users/wdfowty/bin/mydroid/prebuilt/darwin-x86/toolchain/arm-eabi-4.4.0/bin/../lib/gcc/arm-eabi/4.4.0/../../../../arm-eabi/bin/ld: warning: librpc.so, needed by out/target/product/passion/obj/lib/libgps.so, not found (try using -rpath or -rpath-link)
Some things I've noticed...
*Kernel error is constant across AOSP and CM source (could it be a bad .config?)
*Errors persist even after running "make clobber" or "make installclean"
I'm hoping someone can help, as I'm running on minimal knowledge and experience...Thank you in advance!
Here's the full librpc.so error on pastebin: http://pastebin.com/VBtAffE0
Here is the steps that how I built the tun.ko for my Incredible S(first of all, you need to root your IS)
My IS kernel version: 2.6.35.9-g529446e
Environment: Ubuntu 11.10 Desktop runing on Virtual Box
Kernel source code: vivo-2.6.35-GB_MR.tar.bz2
Dowloaded in htcdev website,
(I tried vivo-2.6.35-g89aa373,it was sucessful to compile and load tun.ko,but my phone reboot automatic once I ran VPNC)
Compiler: arm-2011.03-41-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2
Downloaded from sourcery.mentor.com/sgpp/lite/arm/portal/[email protected]=lite
(I tried Android NDK,android-ndk-r6b和android-ndk-r5c, it is fine to compile tun.ko,but get "tun: unknown relocation: 3" error when I ran insmod tun.ko)
1. In Ubuntu terminal,I created folder 710e under home directory, uncompress kernel source code and compiler,
tar zvxf vivo-2.6.35-GB_MR.tar.bz2
tar jvxf arm-2011.03-41-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2
the files were put in vivo_GB_MR and arm-2011.03 by default;
2. Get config.gz file:I did this in my Windows 7
Install HTC Sync on Windows, connect IS to PC by USB cable, run below in command line,
adb pull /proc/config.gz
3. transfer config.gz to ~/710/vivo_GB_MR/ in Ubuntu(the rest commands were run in this path)
gunzip config.gz
mv config .config
edit .config, change or add "CONFIG_TUN=m" in .config
4. Modify Makefile
edit Makefile, change "EXTRAVERSION=.9-g529446e" in Makefile
5. run below commands,
export PATH=$PATH:~/710e/arm-2011.03/bin
export ARCH=arm
export CROSS_COMPILE=arm-none-linux-gnueabi-
make modules
Then I got tun.ko under ~/710/vivo_GB_MR/drivers/net/, I ran below command to check and confirm if the tun.ko version is correct,
strings drivers/net/tun.ko | grep 2.6.35
My output was: vermagic=2.6.35.9-g529446e preempt mod_unload ARMv7
6. copy tun.ko to MicroSD card,run below commands in adb on Windows or terminal emulator on phone,
su
mount -o remount,rw /dev/block/mtdblock4 /system
cp /sdcard/tun.ko /system/lib/modules/tun.ko
mount -o remount,ro /dev/block/mtdblock4 /system
insmod /system/lib/modules/tun.ko
tun.ko should be loaded if everything is fine, you can run lsmod check; and you can run dmesg | grep tun to check the error mesage if it goes wrong.
Hi, thanks for your wonderful Guide, i've tried to compile a tun.ko for my htc Flyer under ubuntu 12.04 booted from a Live-USB-Stick, but it doesn't work. I get this output on Step 5:
Code:
[email protected]:/media/Daten/ubuntu/flyer-2.6.35-crc$ export PATH=$PATH:/media/Daten/ubuntu/arm-2011.03/bin
[email protected]:/media/Daten/ubuntu/flyer-2.6.35-crc$ export ARCH=arm
[email protected]:/media/Daten/ubuntu/flyer-2.6.35-crc$ export CROSS_COMPILE=arm-none-linux-gnueabi-
[email protected]:/media/Daten/ubuntu/flyer-2.6.35-crc$ make modules
make: execvp: arm-none-linux-gnueabi-gcc: Keine Berechtigung
HOSTCC scripts/basic/fixdep
/bin/sh: 1: scripts/basic/fixdep: Permission denied
make[2]: *** [scripts/basic/fixdep] Fehler 126
make[1]: *** [scripts_basic] Fehler 2
The present kernel configuration has modules disabled.
Type 'make config' and enable loadable module support.
Then build a kernel with module support enabled.
make: *** [modules] Fehler 1
[email protected]:/media/Daten/ubuntu/flyer-2.6.35-crc$
I've also tried the Compiler-Version arm-2011.09, but same result. I think I have to edit antoher variable in the .config-File, but which?
I doubt it is related to the Ubuntu booted from Live-USB-Stick, maybe you should install the Ubuntu to your harddisk and have another try.
Ok, another try, another fail.
I've installed ubuntu on my Laptop, and i get a bit further: Another output.
Code:
[email protected]:~/Flyer/flyer-2.6.35-crc$ make modules
HOSTCC scripts/basic/fixdep
HOSTCC scripts/basic/docproc
HOSTCC scripts/basic/hash
HOSTCC scripts/kconfig/conf.o
scripts/kconfig/conf.c: In Funktion »conf_sym«:
scripts/kconfig/conf.c:159:6: Warnung: Variable »type« gesetzt, aber nicht verwendet [-Wunused-but-set-variable]
scripts/kconfig/conf.c: In Funktion »conf_choice«:
scripts/kconfig/conf.c:231:6: Warnung: Variable »type« gesetzt, aber nicht verwendet [-Wunused-but-set-variable]
scripts/kconfig/conf.c:307:9: Warnung: Der Rückgabewert von »fgets«, der mit dem Attribut warn_unused_result deklariert wurde, wird ignoriert [-Wunused-result]
scripts/kconfig/conf.c: In Funktion »conf_askvalue«:
scripts/kconfig/conf.c:105:8: Warnung: Der Rückgabewert von »fgets«, der mit dem Attribut warn_unused_result deklariert wurde, wird ignoriert [-Wunused-result]
HOSTCC scripts/kconfig/kxgettext.o
SHIPPED scripts/kconfig/zconf.tab.c
SHIPPED scripts/kconfig/lex.zconf.c
SHIPPED scripts/kconfig/zconf.hash.c
HOSTCC scripts/kconfig/zconf.tab.o
HOSTLD scripts/kconfig/conf
scripts/kconfig/conf -s arch/arm/Kconfig
.config:1110:warning: override: reassigning to symbol TUN
#
# configuration written to .config
#
CHK include/linux/version.h
UPD include/linux/version.h
CHK include/generated/utsrelease.h
UPD include/generated/utsrelease.h
Generating include/generated/mach-types.h
CC kernel/bounds.s
GEN include/generated/bounds.h
CC arch/arm/kernel/asm-offsets.s
GEN include/generated/asm-offsets.h
CALL scripts/checksyscalls.sh
CC scripts/mod/empty.o
HOSTCC scripts/mod/mk_elfconfig
MKELF scripts/mod/elfconfig.h
HOSTCC scripts/mod/file2alias.o
HOSTCC scripts/mod/modpost.o
HOSTCC scripts/mod/sumversion.o
HOSTLD scripts/mod/modpost
HOSTCC scripts/kallsyms
HOSTCC scripts/bin2c
CC [M] drivers/net/wireless/bcm4329_204/dhd_linux.o
drivers/net/wireless/bcm4329_204/dhd_linux.c: In function 'dhd_rx_frame':
drivers/net/wireless/bcm4329_204/dhd_linux.c:1082:24: error: variable 'save_pktbuf' set but not used [-Werror=unused-but-set-variable]
drivers/net/wireless/bcm4329_204/dhd_linux.c: In function 'dhd_os_wd_timer':
drivers/net/wireless/bcm4329_204/dhd_linux.c:2555:14: error: variable 'save_dhd_watchdog_ms' set but not used [-Werror=unused-but-set-variable]
cc1: all warnings being treated as errors
make[4]: *** [drivers/net/wireless/bcm4329_204/dhd_linux.o] Fehler 1
make[3]: *** [drivers/net/wireless/bcm4329_204] Fehler 2
make[2]: *** [drivers/net/wireless] Fehler 2
make[1]: *** [drivers/net] Fehler 2
make: *** [drivers] Fehler 2
But i've seen that the source of the Flyer has the ending ".tar.gz" instead of ".tar.bz2", so I tried to extract it via the commands
Code:
gunzip
tar xvf
The output isn't longer in the Terminal, but it generates a tun.o-File. The pasted output generates nothing, there is just the tun.c-File.
how to compile a driver ? SLOVE
i have problem after,,
#cp arch/arm/configs/htc_msm_android_defconfig .config
#make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- TARGET_BOARD_PLATFORM=msm7k
make: arm-none-linux-gnueabi-gcc: Command not found
scripts/kconfig/conf -s arch/arm/Kconfig
make: arm-none-linux-gnueabi-gcc: Command not found
CHK include/linux/version.h
make[1]: `include/asm-arm/mach-types.h' is up to date.
CHK include/linux/utsrelease.h
CC kernel/bounds.s
/bin/sh: arm-none-linux-gnueabi-gcc: command not found
make[1]: *** [kernel/bounds.s] Error 127
make: *** [prepare0] Error 2
slove after download
codesourcery......com/sgpp/lite/arm/portal/package5383/public/arm-none-linux-gnueabi/arm-2009q3-67-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2
I download the code from htcdev.But it looks like failed to compile it.
[email protected]:/opt/CM-11.0/kernel/htc/m7ul# export PATH=$PATH:/opt/CM-11.0/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin
[email protected]:/opt/CM-11.0/kernel/htc/m7ul# make m7_defconfig
[email protected]:/opt/CM-11.0/kernel/htc/m7ul# make ARCH=arm CROSS_COMPILE=arm-eabi- -j5
CHK include/linux/version.h
CHK include/generated/utsrelease.h
make[1]: `include/generated/mach-types.h' is up to date.
CALL scripts/checksyscalls.sh
CHK include/generated/compile.h
CHK kernel/config_data.h
CC drivers/gpu/msm/adreno_snapshot.o
drivers/gpu/msm/adreno_snapshot.c: In function 'snapshot_rb':
drivers/gpu/msm/adreno_snapshot.c:498: sorry, unimplemented: inlining failed in call to 'parse_ib': recursive inlining
drivers/gpu/msm/adreno_snapshot.c:469: sorry, unimplemented: called from here
make[3]: *** [drivers/gpu/msm/adreno_snapshot.o] Error 1
make[2]: *** [drivers/gpu/msm] Error 2
make[1]: *** [drivers/gpu] Error 2
make[1]: *** Waiting for unfinished jobs....
make: *** [drivers] Error 2
make: *** Waiting for unfinished jobs....
[email protected]:/opt/CM-11.0/kernel/htc/m7ul#
How to solve it?
THX.
Nobody knows?
I have been trying to compile the kernel for our device for the last 2 days.
But all i do is keep running into dead ends.
I have it almost all worked out to work with the linaro toolchain but i still end up with either this error
Code:
make -j9 ARCH=arm CROSS_COMPILE=~/toolchains/arm-2011.09/bin/arm-none-eabi-
CHK include/linux/version.h
make[1]: Nothing to be done for `arch/arm/boot/dtbs'.
CHK include/generated/utsrelease.h
make[1]: `include/generated/mach-types.h' is up to date.
CALL scripts/checksyscalls.sh
CHK include/generated/compile.h
CHK kernel/config_data.h
CC drivers/media/radio/radio-iris.o
CC [M] drivers/media/radio/radio-iris-transport.o
LD drivers/media/radio/built-in.o
LD drivers/media/built-in.o
LD drivers/built-in.o
LD vmlinux.o
MODPOST vmlinux.o
GEN .version
CHK include/generated/compile.h
UPD include/generated/compile.h
CC init/version.o
LD init/built-in.o
LD .tmp_vmlinux1
drivers/built-in.o: In function `video_open':
/home/kalisto/kernel/android_kernel_htc_a11ul/drivers/media/radio/radio-iris.c:5069: undefined reference to `hci_fm_smd_register'
drivers/built-in.o: In function `iris_remove':
/home/kalisto/kernel/android_kernel_htc_a11ul/drivers/media/radio/radio-iris.c:5226: undefined reference to `hci_fm_smd_deregister'
make: *** [.tmp_vmlinux1] Error 1
Or this error
Code:
ERROR: "hci_fm_smd_deregister" [drivers/media/radio/radio-iris.ko] undefined!
ERROR: "hci_fm_smd_register" [drivers/media/radio/radio-iris.ko] undefined!
make[1]: *** [__modpost] Error 1
make: *** [modules] Error 2
make: *** Waiting for unfinished jobs....
Kernel: arch/arm/boot/Image is ready
AS arch/arm/boot/compressed/head.o
GZIP arch/arm/boot/compressed/piggy.gzip
CC arch/arm/boot/compressed/misc.o
CC arch/arm/boot/compressed/decompress.o
CC arch/arm/boot/compressed/string.o
SHIPPED arch/arm/boot/compressed/lib1funcs.S
SHIPPED arch/arm/boot/compressed/ashldi3.S
AS arch/arm/boot/compressed/ashldi3.o
AS arch/arm/boot/compressed/lib1funcs.o
AS arch/arm/boot/compressed/piggy.gzip.o
LD arch/arm/boot/compressed/vmlinux
OBJCOPY arch/arm/boot/zImage
Kernel: arch/arm/boot/zImage is ready
real 3m13.707s
user 18m42.083s
sys 2m24.205s
Anyone that could point me in the right direction would be great
you could try commenting out the aspects of code that are undefined references.that is more of just a hackish workaround and may cause other problems,so say for the error in /drivers/media/radio/radio-iris.c,as long as "hci_fm_smd_register" is just a single line,you could just // it out and it will be commented out,same for the other file,but if they are whole functions you could find the start and fully comment it out with /* all_code_inside_the_function */ <- with this being at the end of the function
pattyboi:) said:
you could try commenting out the aspects of code that are undefined references.that is more of just a hackish workaround and may cause other problems,so say for the error in /drivers/media/radio/radio-iris.c,as long as "hci_fm_smd_register" is just a single line,you could just // it out and it will be commented out,same for the other file,but if they are whole functions you could find the start and fully comment it out with /* all_code_inside_the_function */ <- with this being at the end of the function
Click to expand...
Click to collapse
Turns out i just needed to turn off the radio in the defconfig. Problems solved
kalisto2002 said:
Turns out i just needed to turn off the radio in the defconfig. Problems solved
Click to expand...
Click to collapse
thats odd....i've never had this error