[Q] [SOLVED] Stock Kernel Build Problems - Nexus 5 Q&A, Help & Troubleshooting

Hello,
Just for the fun (and to learn something) I'm trying to rebuild the stock nexus5 kernel. However I'm miserably failing.
I've found some guides for nexus4 but none for the nexus5, so far.
Host(s): Ubuntu 12.04 x86_64, Ubuntu 13.10 x86_64, Ubuntu 13.10 x86
Kernel source: https://android.googlesource.com/kernel/msm
Toolchain: Android NDK legacy version GCC 4.7
The process I'm following is:
NDK toolchain
From an adb shell I get the GCC version used to compile the kernel "dmesg | grep -i gcc", which is 4.7
Download the legacy NDK which has GCC 4.7 (for x86_64 in my case): https://dl.google.com/android/ndk/android-ndk-r9b-linux-x86_64-legacy-toolchains.tar.bz2
Kernel source
Download: git clone https://android.googlesource.com/kernel/msm
Select device: git checkout remotes/origin/android-msm-hammerhead-3.4-kk-r1
Select commit: git checkout 9eb14ba
Building kernel
export PATH=$PATH:<NDK_PATH>/toolchains/arm-linux-androideabi-4.7/prebuilt/linux-x86_64/bin/
export ARCH=arm
export SUBARCH=arm
export CROSS_COMPILE=arm-linux-androideabi-
make hammerhead_defconfig
make -j2
However the build process fails with:
Code:
[...]
LD vmlinux.o
MODPOST vmlinux.o
ERROR: modpost: Found 2 section mismatch(es).
To see full details build your kernel with:
'make CONFIG_DEBUG_SECTION_MISMATCH=y'
To build the kernel despite the mismatches, build with:
'make CONFIG_NO_ERROR_ON_MISMATCH=y'
(NOTE: This is not recommended)
make[1]: *** [vmlinux.o] Error 1
make: *** [vmlinux.o] Error 2
I've also tried to build with CONFIG_DEBUG_SECTION_MISMATCH=y, but as expected fails (although with more information)
Code:
[...]
CC kernel/kallsyms.o
WARNING: arch/arm/mach-msm/built-in.o(.data+0x679c): Section mismatch in reference from the variable msm_mpm_debug_mask to the funct
ion .init.text:mpm_irq_domain_linear_size()
The variable msm_mpm_debug_mask references
the function __init mpm_irq_domain_linear_size()
If the reference is valid then annotate the
variable with __init* or __refdata (see linux/init.h) or name the variable:
*_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console
WARNING: arch/arm/mach-msm/built-in.o(.data+0x67b4): Section mismatch in reference from the variable msm_mpm_debug_mask to the funct
ion .init.text:mpm_irq_domain_legacy_size()
The variable msm_mpm_debug_mask references
the function __init mpm_irq_domain_legacy_size()
If the reference is valid then annotate the
variable with __init* or __refdata (see linux/init.h) or name the variable:
*_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console
[...]
LD vmlinux.o
MODPOST vmlinux.o
WARNING: vmlinux.o(.data+0x74d4): Section mismatch in reference from the variable msm_mpm_debug_mask to the function .init.text:mpm_irq_domain_linear_size()
The variable msm_mpm_debug_mask references
the function __init mpm_irq_domain_linear_size()
If the reference is valid then annotate the
variable with __init* or __refdata (see linux/init.h) or name the variable:
*_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console
WARNING: vmlinux.o(.data+0x74ec): Section mismatch in reference from the variable msm_mpm_debug_mask to the function .init.text:mpm_irq_domain_legacy_size()
The variable msm_mpm_debug_mask references
the function __init mpm_irq_domain_legacy_size()
If the reference is valid then annotate the
variable with __init* or __refdata (see linux/init.h) or name the variable:
*_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console
To build the kernel despite the mismatches, build with:
'make CONFIG_NO_ERROR_ON_MISMATCH=y'
(NOTE: This is not recommended)
make[1]: *** [vmlinux.o] Error 1
make: *** [vmlinux.o] Error 2
Although it also states that building with CONFIG_NO_ERROR_ON_MISMATCH=y is not recommend I've also tried with this flag. It generated the zImage but I'm not confident with the result.
So the question is what am I doing wrong and how do I compile the android nexus5 kernel?
Wrong kernel?
Wrong commit?
Wrong toolchain? --> use arm-eabi-4.7

Yeah I was having the same error. Using the arm-eabi-4.7 toolchain seems to work fine.

mohit1234 said:
Yeah I was having the same error. Using the arm-eabi-4.7 toolchain seems to work fine.
Click to expand...
Click to collapse
Thanks. That did the trick :good:

Re: [Q] Stock Kernel Build Problems
Interestingly enough I had to do:
make zImage-dtb
to create the zImage that I then encapsulate in the boot.img for Nexus5, using the tools provided in AOSP 4.4_r1.
out/host/linux-x86/bin/mkbootimg --kernel out/target/product/hammerhead/kernel --ramdisk out/target/product/hammerhead/ramdisk.img --cmdline "console=ttyHSL0,115200,n8 androidboot.hardware=hammerhead user_debug=31 maxcpus=2 msm_watchdog_v2.enable=1" --base 0x00000000 --pagesize 2048 --ramdisk_offset 0x02900000 --tags_offset 0x02700000 --output out/target/product/hammerhead/boot.img
out/target/product/hammerhead/boot.img maxsize=23519232 blocksize=135168 total=8826880 reserve=270336

Makefile Changes for Easy Kernel Builds
boy3dfx said:
Interestingly enough I had to do:
make zImage-dtb
to create the zImage that I then encapsulate in the boot.img for Nexus5, using the tools provided in AOSP 4.4_r1.
out/host/linux-x86/bin/mkbootimg --kernel out/target/product/hammerhead/kernel --ramdisk out/target/product/hammerhead/ramdisk.img --cmdline "console=ttyHSL0,115200,n8 androidboot.hardware=hammerhead user_debug=31 maxcpus=2 msm_watchdog_v2.enable=1" --base 0x00000000 --pagesize 2048 --ramdisk_offset 0x02900000 --tags_offset 0x02700000 --output out/target/product/hammerhead/boot.img
out/target/product/hammerhead/boot.img maxsize=23519232 blocksize=135168 total=8826880 reserve=270336
Click to expand...
Click to collapse
Hey thanks for the zip @boy3dfx . Using this I was able to adapt the build system a little bit so you can just "make updatepackage" or "make bootimage". It requires changes to kernel/AndroidKernel.mk and device/lge/hammerhead . Hopefully though it saves a bit of time in the long run and is less error prone that typing out the whole mkbootimg line each time.
Changes are detailed here: http://nosemaj.org/howto-build-android-kitkat-nexus-5 under "Including the Kernel Sources."
Best,
Jameson

jhwilliams said:
Changes are detailed here: http://nosemaj.org/howto-build-android-kitkat-nexus-5 under "Including the Kernel Sources."
Click to expand...
Click to collapse
Excelent guide, thanks!! :good:

Same error..how to fix

Related

[HELP] Compile error with GCC 4.7

Hi everybody.
I use Linaro toolchain 2012.05 GCC 4.7 on my Archlinux x86_64 and when I compile Nexus S stock kernel, I have some errors like these:
Code:
[[email protected] samsung]$ make
CHK include/linux/version.h
CHK include/generated/utsrelease.h
make[1]: «include/generated/mach-types.h» è aggiornato.
CC kernel/bounds.s
gcc: error: unrecognized command line option ‘-mlittle-endian’
gcc: error: unrecognized command line option ‘-mapcs’
gcc: error: unrecognized command line option ‘-mno-sched-prolog’
gcc: error: unrecognized argument in option ‘-mabi=aapcs-linux’
gcc: note: valid arguments to ‘-mabi=’ are: ms sysv
gcc: error: unrecognized command line option ‘-mno-thumb-interwork’
make[1]: *** [kernel/bounds.s] Errore 1
make: *** [prepare0] Errore 2
With GCC 4.6 I have another errors. I want to use GCC 4.7 like Thalamus.
Can you help me?
PS:
Code:
export ARCH=arm
export CROSS_COMPILE=
export PATH=$PATH:~/android-toolchain-eabi/arm-eabi/bin/
Q&A Section would be the right place for this.
http://forum.xda-developers.com/forumdisplay.php?f=927
MattScherbatsky said:
PS:
Code:
export ARCH=arm
export CROSS_COMPILE=
export PATH=$PATH:~/android-toolchain-eabi/arm-eabi/bin/
Click to expand...
Click to collapse
Code:
export ARCH=arm
export CROSS_COMPILE=:~/android-toolchain-eabi/arm-eabi/bin/arm-linux-gnueabihf-
Thank you! Now I have some errors.
LD vmlinux.o
MODPOST vmlinux.o
WARNING: vmlinux.o(.data+0x3c64): Section mismatch in reference from the variable s5pv210_driver to the function .init.text:s5pv210_cpu_init()
The variable s5pv210_driver references
the function __init s5pv210_cpu_init()
If the reference is valid then annotate the
variable with __init* or __refdata (see linux/init.h) or name the variable:
*_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console
WARNING: vmlinux.o(.data+0x3c90): Section mismatch in reference from the variable s5pv210_cpufreq_drv to the function .init.text:s5pv210_cpufreq_probe()
The variable s5pv210_cpufreq_drv references
the function __init s5pv210_cpufreq_probe()
If the reference is valid then annotate the
variable with __init* or __refdata (see linux/init.h) or name the variable:
*_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console
WARNING: vmlinux.o(.data+0x9118): Section mismatch in reference from the variable herring_device_rfkill to the function .init.text:herring_rfkill_probe()
The variable herring_device_rfkill references
the function __init herring_rfkill_probe()
If the reference is valid then annotate the
variable with __init* or __refdata (see linux/init.h) or name the variable:
*_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console
WARNING: vmlinux.o(.data+0xcb98): Section mismatch in reference from the variable s5p_systimer to the function .init.text:s5p_timer_init()
The variable s5p_systimer references
the function __init s5p_timer_init()
If the reference is valid then annotate the
variable with __init* or __refdata (see linux/init.h) or name the variable:
*_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console
GEN .version
CHK include/generated/compile.h
UPD include/generated/compile.h
CC init/version.o
LD init/built-in.o
LD .tmp_vmlinux1
KSYM .tmp_kallsyms1.S
AS .tmp_kallsyms1.o
LD .tmp_vmlinux2
KSYM .tmp_kallsyms2.S
AS .tmp_kallsyms2.o
LD vmlinux
SYSMAP System.map
SYSMAP .tmp_System.map
OBJCOPY arch/arm/boot/Image
Kernel: arch/arm/boot/Image is ready
LZMA arch/arm/boot/compressed/piggy.lzma
AS arch/arm/boot/compressed/piggy.lzma.o
CC arch/arm/boot/compressed/misc.o
In file included from arch/arm/plat-samsung/include/plat/uncompress.h:30:0,
from arch/arm/mach-s5pv210/include/mach/uncompress.h:17,
from arch/arm/boot/compressed/misc.c:33:
arch/arm/plat-samsung/include/plat/regs-serial.h:284:27: warning: 'struct uart_port' declared inside parameter list [enabled by default]
arch/arm/plat-samsung/include/plat/regs-serial.h:284:27: warning: its scope is only this definition or declaration, which is probably not what you want [enabled by default]
CC arch/arm/boot/compressed/decompress.o
SHIPPED arch/arm/boot/compressed/lib1funcs.S
AS arch/arm/boot/compressed/lib1funcs.o
LD arch/arm/boot/compressed/vmlinux
arm-eabi-ld: error: DIV usage mismatch between arch/arm/boot/compressed/misc.o and output
arm-eabi-ld: error: DIV usage mismatch between arch/arm/boot/compressed/lib1funcs.o and output
make[2]: *** [arch/arm/boot/compressed/vmlinux] Errore 1
make[1]: *** [arch/arm/boot/compressed/vmlinux] Errore 2
make: *** [zImage] Errore 2
Click to expand...
Click to collapse
Can I risolve it?
Those are warnings, read up on building kernels more.
I use this guide: http://source.android.com/source/building-kernels.html
You'll really get more help if you post this in the correct section. That's what the Q&A section is for - Questions and Answers.
MattScherbatsky said:
I use this guide: http://source.android.com/source/building-kernels.html
Click to expand...
Click to collapse
Try to use the bfd linker, which is also provided at the linaro prebuild toolchain package. For details look at:
http://forum.xda-developers.com/showpost.php?p=27427105&postcount=8

Creating your CM ROM for Galaxy S plus

Credits:
Thanks to Arco, Realtyem and andres_a whose posts helped me to build the ROM from sources.
Most of the post is copied from the guide YardE's guide and a pdf whose author I could not find later. (Please let me know if I have missed somebody.)
*******************************************************
First get the build tools:
*******************************************************
1. Get the packages required for building the ROM.
On 10.04
Code:
sudo apt-get install git-core gnupg flex bison gperf build-essential \
zip curl zlib1g-dev libc6-dev lib32ncurses5-dev ia32-libs \
x11proto-core-dev libx11-dev lib32readline5-dev lib32z-dev \
libgl1-mesa-dev g++-multilib mingw32 tofrodos python-markdown \
libxml2-utils
sudo ln -s /usr/lib32/mesa/libGL.so.1 /usr/lib32/mesa/libGL.so
2. Download repo tool,
Code:
curl [url]https://dl-ssl.google.com/dl/googlesource/git-repo/repo[/url] > /tmp/repo
sudo mv /tmp/repo /usr/local/bin
export PATH=$PATH:/usr/local/bin
*******************************************************
Next: Get the source
*******************************************************
I have tried to build the source code from CyanogenMod for ICS version of Android and the device Samsung Galaxy S plus. (Already ported by Arco )
This example uses their repositories to download the code,
1. Get the android source code:
Code:
cd ~/work/cyanogenmod
repo init -u git://github.com/CyanogenMod/android.git -b ics
repo sync
The repo sync command takes some time which depends on your internet connection speed.
2. The above commands download the generic source code. For creating the ROM for the device Galaxy S Plus, we need to use the Arco's repositories.
3. Create a local_manifest.xml in ~/work/cyanogenmod/.repo as follows
Code:
<?xml version="1.0" encoding="UTF-8"?>
<manifest>
<remote name="arco" fetch="https://github.com/arco"/>
<project path="device/samsung/ariesve" name="android_device_samsung_ariesve" revision="ics" remote="arco"/>
<project path="kernel/ariesve" name="samsung-kernel-ariesve" remote="arco" revision="ics"/>
<project path="vendor/samsung/ariesve" name="android_vendor_samsung_ariesve" remote="arco" revision="ics"/>
<project path="frameworks/base" name="android_frameworks_base" remote="arco" revision="ics" />
<project path="kernel/msm7x30" name="samsung-kernel-msm7x30" remote="arco" revision="ics-2.6.35" />
</manifest>
4. Perform repo sync.
Code:
repo sync
*******************************************************
Building Kernel
*******************************************************
It is not necessary to build kernel – the one Arco have build is already located in ~/work/cyanogenmod/device/samsung/ariesve/prebuilt.
But if you still want to do that by our own, you should do the next thing: Download running kernel's config from your dvevice, then ungzip it and
save it as ~/work/cyanogenmod/kernel/ariesve/.config
Code:
adb pull /proc/config.gz
cat config.gz | gunzip > ~/work/cyanogenmod/kernel/ariesve/.config
rm config.gz
After that you should declare cross-compiler path variable:
Code:
export CCOMPILER=~/work/cyanogenmod/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin/arm-eabi-
Next step is to run
Code:
make oldconfig
Feel free to modify config, for example in ncurses gui:
Code:
make menuconfig
When you're done just execute
Code:
make ARCH=arm CROSS_COMPILE=$CCOMPILER -j5
where -j5 is number of your CPU cores+1;
When compile is over, the resulting zImage will be located in ~/work/cyanogenmod/kernel/ariesve/arch/arm/boot
As mentioned before, you should place it into ~/work/cyanogenmod/device/samsung/ariesve/prebuilt
So when kernel is ready, it's time for the greatest thing:
*******************************************************
Building CyanogenMod 9
*******************************************************
So when all the sources are downloaded, and (optional) kernel is built
let's start to build the CM.
First of all, download prebuilds:
Code:
~/work/cyanogenmod/vendor/cm/get-prebuilts
If you skipped kernel build chapter, please, export CCOMPILER
variable as mentioned there.
Next, edit file: ~/work/cyanogenmod/vendor/samsung/ariesve/device-vendorblobs.mk
and change “ancora” to “ariesve” on lines 25-28
and file ~/work/cyanogenmod/device/samsung/ariesve/BoardConfig.mk
and change “ancora” to “ariesve” on line 132.
The final part is actually building:
Code:
cd ~/work/cyanogenmod
bash
source build/envsetup.sh
lunch full_ariesve-eng
I wrote “bash” in the list of commands because envsetup.sh script
doesn't support some other shells.
Run the make command.
*******************************************************
Build issues.
*******************************************************
1. If you face an issue due to OverlayHtc.h file not found as below:
Code:
Notice file: hardware/libhardware_legacy/NOTICE -- out/target/product/ariesve/obj/NOTICE_FILES/src//system/lib/libpower.so.txt
Copy: out/target/product/ariesve/obj/lib/libaudioalsa.so
Copy: out/target/product/ariesve/obj/lib/libcamera.
target thumb C++: camera.msm7x30 <= device/samsung/ariesve/camerahal/cameraHAL.cpp
device/samsung/ariesve/camerahal/cameraHAL.cpp:31:27: error: ui/OverlayHtc.h: No such file or directory
Notice file: hardware/qcom/display/libcopybit/NOTICE -- out/target/product/ariesve/obj/NOTICE_FILES/src//system/lib/hw/copybit.msm7x30.so.txt
device/samsung/ariesve/camerahal/cameraHAL.cpp: In function 'camera_memory_t* wrap_memory_data(priv_camera_device_t*, const android::sp<android::IMemory>&)':
device/samsung/ariesve/camerahal/cameraHAL.cpp:268: warning: format '%x' expects type 'unsigned int', but argument 4 has type 'ssize_t'
device/samsung/ariesve/camerahal/cameraHAL.cpp: In function 'int camera_set_preview_window(camera_device*, preview_stream_ops*)':
device/samsung/ariesve/camerahal/cameraHAL.cpp:488: error: invalid use of incomplete type 'struct android::eek:verlay'
device/samsung/ariesve/camerahal/CameraHardwareInterface.h:29: error: forward declaration of 'struct android::eek:verlay'
make: *** [out/target/product/ariesve/obj/SHARED_LIBRARIES/camera.msm7x30_intermediates/cameraHAL.o] Error 1
make: *** Waiting for unfinished jobs....
You need to get the fix by using following command:
Code:
cd ~/work/cyanogenmod/frameworks/base/ && git fetch [url]http://review.cyanogenmod.com/CyanogenMod/android_frameworks_base[/url] refs/changes/85/13285/8 && git cherry-pick FETCH_HEAD
(Thanks to the post on xda: http://forum.xda-developers.com/showthread.php?p=27475486#post27475486)
2. If you face an issue in compiling charger.c with following error:
Code:
prebuilt/linux-x86/toolchain/arm-linux-androideabi-4.4.x/bin/../lib/gcc/arm-linux-androideabi/4.4.3/../../../../arm-linux-androideabi/bin/ld: out/target/product/crespo/obj/EXECUTABLES/charger_intermediates/charger.o: in function main:system/core/charger/charger.c:958: error: undefined reference to 'gr_font_size'
prebuilt/linux-x86/toolchain/arm-linux-androideabi-4.4.x/bin/../lib/gcc/arm-linux-androideabi/4.4.3/../../../../arm-linux-androideabi/bin/ld: out/target/product/crespo/obj/EXECUTABLES/charger_intermediates/charger.o: in function main:system/core/charger/charger.c:991: error: undefined reference to 'gr_fb_blank'
prebuilt/linux-x86/toolchain/arm-linux-androideabi-4.4.x/bin/../lib/gcc/arm-linux-androideabi/4.4.3/../../../../arm-linux-androideabi/bin/ld: out/target/product/crespo/obj/EXECUTABLES/charger_intermediates/charger.o: in function main:system/core/charger/charger.c:699: error: undefined reference to 'gr_fb_blank'
prebuilt/linux-x86/toolchain/arm-linux-androideabi-4.4.x/bin/../lib/gcc/arm-linux-androideabi/4.4.3/../../../../arm-linux-androideabi/bin/ld: out/target/product/crespo/obj/EXECUTABLES/charger_intermediates/charger.o: in function main:system/core/charger/charger.c:732: error: undefined reference to 'gr_fb_blank'
If you aren't afraid of doing some editing, grab the function "gr_fb_blank"(line 377) and "gr_font_size" (line 210) out of bootable/recovery/minui/graphics.c and paste them into device/samsung/crespo/graphics.c (at the end of the file, and at line 158, respectively) for now. Tested booting, and tested system off charging and both seem to be ok. I'm not gonna look at logs since nothing is acting wonky lol.
(Thanks to the post on xda: http://forum.xda-developers.com/showthread.php?t=1399035&page=676)
==================================================
Ref. threads:
http://forum.xda-developers.com/showthread.php?t=1650615
Nice, but I don't recommend to use the outdated framework/base repo by arco.
Instead I suggest to use the CM repo and do the following.
Needs to be done once
Code:
cd frameworks/base
git remote add arco git://github.com/arco/android_frameworks_base.git
git fetch arco
Needs to be done after every repo sync
Code:
git cherry-pick 748a5e5f70858e5f5f77c65b7c185ec980f821f5
git cherry-pick f6d9aa858cbcabb29c1f941e2e8f0672360985ba
git cherry-pick 1a3e62ddae28b3f871ced2c1d40a18c7d8a6ea7d
So you can use the CM9 repo with the necessary changes made by arco.
EDIT:
And the CODE-Tags will make your post better readable.
I think that unknown pdf file tutorial is of vpukin..
Sent from my GT-I9001 using Tapatalk 2
also this isnt needed to synch in manifest.xml
<project path="vendor/samsung/ancora" name="android_vendor_samsung_ancora" remote="arco" revision="ics"/>
Click to expand...
Click to collapse
it isnt i9001 related
texten said:
also this isnt needed to synch in manifest.xml
it isnt i9001 related
Click to expand...
Click to collapse
right.
"ancora" is Galaxy W I8150, arco's phone
...but...where is the sense of this thread? only a cm9 tutorial for...build another ones?
Good guide , But why is there a $ in front of each command ? , when i enter them it gives error
PS: You can surround all codes with CODE Tags
Thanks for suggestion.
I would update the guide with code tags.
what packages I need to download for ubuntu 12.04?[finded]
hemansan said:
2. Download repo tool,
Code:
curl [url]https://dl-ssl.google.com/dl/googlesource/git-repo/repo[/url] > /tmp/repo
sudo mv /tmp/repo /usr/local/bin
export PATH=$PATH:/usr/local/bin
Click to expand...
Click to collapse
one command is missing
Code:
sudo chmod +x /usr/local/bin/repo

[BUILD] Use Raspberry Pi to build Android Project (AOSP)

Hi all !
My current project is to use my Raspberry Pi as a Build Machine to build all Android sources (AOSP). In fact, I'll not build AOSP but the CyanogenMod (wich is mainly a fork from AOSP).
I know this may sound crazy, dumb or useless (according to Google, a 64-bit environment is required, and a lot (>> 4GB) of RAM if you're in a hurry), especially to use an ARM processor to build while all the Makefiles has been written to be used on x86...
But what I'm thinking about is a really cheap, silent, but working build machine, to sync the repo and build nightlies everyday. The first build will take some days but then, only the changes will be build so I think that only some hours per day will be required.
If I success, I'll create a big tutorial to explain what changes was required.
First of all, I had to add the Linux-armv61 arch as Host OS/ARCH :
Code:
[email protected] ~/buildspace/android/system/build $ git diff
diff --git a/core/envsetup.mk b/core/envsetup.mk
index 862b7f0..34eb31a 100644
--- a/core/envsetup.mk
+++ b/core/envsetup.mk
@@ -77,6 +77,10 @@ ifneq (,$(findstring Power,$(UNAME)))
HOST_ARCH := ppc
endif
[COLOR="SeaGreen"]+ifneq (,$(findstring arm,$(UNAME)))
+ HOST_ARCH := armv61
+endif
+[/COLOR]
BUILD_ARCH := $(HOST_ARCH)
ifeq ($(HOST_ARCH),)
then, I did this (because the raspbian ld doesn't support --icf) :
AdamOutler said:
so I did a
Code:
[email protected] ~/adb $ grep -r 'icf=safe' ./*
./build/core/combo/TARGET_linux-arm.mk: -Wl,--icf=safe \
and I removed that icf parameter.
Click to expand...
Click to collapse
-->
Code:
[email protected] ~/buildspace/android/system/build $ git diff
diff --git a/core/combo/TARGET_linux-arm.mk b/core/combo/TARGET_linux-arm.mk
index b36111f..24e0d99 100644
--- a/core/combo/TARGET_linux-arm.mk
+++ b/core/combo/TARGET_linux-arm.mk
@@ -146,7 +146,6 @@ TARGET_GLOBAL_LDFLAGS += \
-Wl,-z,relro \
-Wl,-z,now \
-Wl,--warn-shared-textrel \
[COLOR="Red"]- -Wl,--icf=safe \[/COLOR]
$(arch_variant_ldflags)
# We only need thumb interworking in cases where thumb support
but now I am stuck with this error :
Code:
make -C kernel/samsung/smdk4210 O=/media/totoext4part/cyanogenmod/system/out/target/product/n7000/obj/KERNEL_OBJ ARCH=arm CROSS_COMPILE=" /media/totoext4part/cyanogenmod/system/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi-" headers_install
make[1]: Entering directory `/media/totoext4part/cyanogenmod/system/kernel/samsung/smdk4210'
/media/totoext4part/cyanogenmod/system/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi-gcc: 1: /media/totoext4part/cyanogenmod/system/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi-gcc: Syntax error: "(" unexpected
CHK include/linux/version.h
make[1]: Leaving directory `/media/totoext4part/cyanogenmod/system/kernel/samsung/smdk4210'
/bin/bash: r: command not found
make: [/media/totoext4part/cyanogenmod/system/out/target/product/n7000/obj/lib/crtbegin_static.o] Error 127 (ignored)
[COLOR="SeaGreen"]target SharedLib[/COLOR]: libdl (/media/totoext4part/cyanogenmod/system/out/target/product/n7000/obj/SHARED_LIBRARIES/libdl_intermediates/LINKED/libdl.so)
/usr/bin/ld: error: /media/totoext4part/cyanogenmod/system/out/target/product/n7000/obj/SHARED_LIBRARIES/libdl_intermediates/LINKED/libdl.so uses VFP register arguments, /media/totoext4part/cyanogenmod/system/out/target/product/n7000/obj/SHARED_LIBRARIES/libdl_intermediates/libdl.o does not
/usr/bin/ld: failed to merge target specific data of file /media/totoext4part/cyanogenmod/system/out/target/product/n7000/obj/SHARED_LIBRARIES/libdl_intermediates/libdl.o
/usr/bin/ld: warning: creating a DT_TEXTREL in a shared object.
collect2: ld returned 1 exit status
make: *** [/media/totoext4part/cyanogenmod/system/out/target/product/n7000/obj/SHARED_LIBRARIES/libdl_intermediates/LINKED/libdl.so] Error 1
I don't really know what I have to do and if it is because the HOST is an arm arch...
It have been a long time since I didn't put my hands in this kind of things and I need help to solve this problems... Thanks in advance !

[HELP] Android Kernel Building Errors. permission denied :(

Hi every body, i'm now building android kernel for SKY-VEGA-S5 phone ( IM-A840S).
I followed these steps on the homepage of SKY .
They're :
1. How to build Kernel source of UI18760_kernel
a.First, Get Toolchain from android git server and etc ¡Š
GCC correct version is arm-eabi-4.4.3
b.modify Makefile
edit "CROSS_COMPILE" to toolchain path ( You downloaded )
ex) CROSS_COMPILE=$(You Download directory)/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi-
c.make CONFIG_DEBUG_SECTION_MISMATCH=y ARCH=arm msm8960_ef44s_tp20_defconfig
d.make CONFIG_DEBUG_SECTION_MISMATCH=y ARCH=arm
2. Kernel Image Location is arch/arm/boot/zImage
Module Image Location is drivers/*/*.ko
3. How to Clean Kernel object files
a.make ARCH=arm clean
______________________________________________________________________________________
I downloaded the kernel package and extract to the /home folder.
And toolchain ..... /prebuilt folder is also extracted to the /home folder.
I modified Makefile.
CROSS_COMPILE ?=$/home/vip7009pro/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi-
Then I step by step followed the guide. But i got many error... ( I think the PATH was wrong, but I dont know how to correctly edit it ==' ).
Here they are :
__________________________________________________________________________________________
[email protected]:~/kernel$ make CONFIG_DEBUG_SECTION_MISMATCH=y ARCH=arm
"======================LINUX INCLUDE==========================================================="
-I/home/vip7009pro/kernel/arch/arm/include -Iarch/arm/include/generated -Iinclude -include include/generated/autoconf.h
"=============================================================================================="
"KERNEL ======================================================================================"
-Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration -Wno-format-security -fno-delete-null-pointer-checks -DT_EF44S -I ./include/pantech -include ./include/pantech/CUST_PANTECH.h -DFIRM_VER=\"S0215141\" -DSYS_MODEL_NAME=\"EF44S\" -DPANTECH_MODEL_NAME=\"IM-A840S\" -DFS_USER_DATA_VER=37 -DPANTECH_STORAGE_INTERNAL_EMUL -DFEATURE_AARM_RELEASE_MODE -D__KERNELBUILD__
"=============================================================================================="
CHK include/linux/version.h
CHK include/generated/utsrelease.h
make[1]: `include/generated/mach-types.h' is up to date.
CC kernel/bounds.s
/home/vip7009pro/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi-gcc -Wp,-MD,kernel/.bounds.s.d -nostdinc -isystem /home/vip7009pro/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi-gcc -print-file-name=include [Errno 13] Permission denied -I/home/vip7009pro/kernel/arch/arm/include -Iarch/arm/include/generated -Iinclude -include include/generated/autoconf.h -D__KERNEL__ -mlittle-endian -Iarch/arm/mach-msm/include -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration -Wno-format-security -fno-delete-null-pointer-checks -DT_EF44S -I ./include/pantech -include ./include/pantech/CUST_PANTECH.h -DFIRM_VER="S0215141" -DSYS_MODEL_NAME="EF44S" -DPANTECH_MODEL_NAME="IM-A840S" -DFS_USER_DATA_VER=37 -DPANTECH_STORAGE_INTERNAL_EMUL -DFEATURE_AARM_RELEASE_MODE -D__KERNELBUILD__ -O2 -fstack-protector -mabi=aapcs-linux -mno-thumb-interwork -funwind-tables -D__LINUX_ARM_ARCH__=7 -march=armv5t -Wa,-march=armv7-a -msoft-float -Uarm -fomit-frame-pointer -g -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 13] Permission denied
make[1]: *** [kernel/bounds.s] Error 13
make: *** [prepare0] Error 2
[email protected]:~/kernel$
____________________________________________________________________________________________________________
Can any one tell me what do these errors mean and how to fix them ..
I'm looking forward to receiving answers from y0u all, soon .. Thanks

Guide To Build Sultanxda CM13

since i'm a flashaholic and a great fan of sultan's cm13, i'm trying my hands on android rom development and i thought the first step would be to learn how to compile a rom from source and the best choice was cm13 by sultan.
i'm using google's cloud platform for vm instance and using ubuntu 14.04.
i've used @akhilnarang script (link to his github:github.com/akhilnarang/scripts ) to setup the build environment and followed these commands to build the rom.
Code:
~$ repo init -u git://github.com/CyanogenMod/android.git -b stable/cm-13.0-ZNH2K
~$ mkdir .repo/local_manifests
~$ curl https://raw.githubusercontent.com/sultanxda/android/master/bacon/cm-13.0-stable/local_manifest.xml > .repo/local_manifests/local_manifest.xml
~$ repo sync -c -j10
~$ ./patcher/patcher.sh
~$ make clobber
~$ . build/envsetup.sh
~$ lunch cm_bacon-user
~$ time mka bacon -j8
but after 1h or so the compiler spilled these errors
Code:
Package OTA: /home/arjunmanoj1995/out/target/product/bacon/cm_bacon-ota-f59d4b6456.zip
Traceback (most recent call last):
File "./build/tools/releasetools/ota_from_target_files", line 1782, in <module>
main(sys.argv[1:])
File "./build/tools/releasetools/ota_from_target_files", line 1674, in main
], extra_option_handler=option_handler)
File "/home/arjunmanoj1995/build/tools/releasetools/common.py", line 826, in ParseOptions
if extra_option_handler is None or not extra_option_handler(o, a):
File "./build/tools/releasetools/ota_from_target_files", line 1644, in option_handler
from backports import lzma
ImportError: No module named backports
make: *** [/home/arjunmanoj1995/out/target/product/bacon/cm_bacon-ota-f59d4b6456.zip] Error 1
make: Leaving directory `/home/arjunmanoj1995'
#### make failed to build some targets (01:07:57 (hh:mm:ss)) ####
can someone plz help me resolve this error.
baconxda said:
since i'm a flashaholic and a great fan of sultan's cm13, i'm trying my hands on android rom development and i thought the first step would be to learn how to compile a rom from source and the best choice was cm13 by sultan.
i'm using google's cloud platform for vm instance and using ubuntu 14.04.
i've used @akhilnarang script (link to his github:github.com/akhilnarang/scripts ) to setup the build environment and followed these commands to build the rom.
Code:
~$ repo init -u git://github.com/CyanogenMod/android.git -b stable/cm-13.0-ZNH2K
~$ mkdir .repo/local_manifests
~$ curl https://raw.githubusercontent.com/sultanxda/android/master/bacon/cm-13.0-stable/local_manifest.xml > .repo/local_manifests/local_manifest.xml
~$ repo sync -c -j10
~$ ./patcher/patcher.sh
~$ make clobber
~$ . build/envsetup.sh
~$ lunch cm_bacon-user
~$ time mka bacon -j8
but after 1h or so the compiler spilled these errors
Code:
Package OTA: /home/arjunmanoj1995/out/target/product/bacon/cm_bacon-ota-f59d4b6456.zip
Traceback (most recent call last):
File "./build/tools/releasetools/ota_from_target_files", line 1782, in <module>
main(sys.argv[1:])
File "./build/tools/releasetools/ota_from_target_files", line 1674, in main
], extra_option_handler=option_handler)
File "/home/arjunmanoj1995/build/tools/releasetools/common.py", line 826, in ParseOptions
if extra_option_handler is None or not extra_option_handler(o, a):
File "./build/tools/releasetools/ota_from_target_files", line 1644, in option_handler
from backports import lzma
ImportError: No module named backports
make: *** [/home/arjunmanoj1995/out/target/product/bacon/cm_bacon-ota-f59d4b6456.zip] Error 1
make: Leaving directory `/home/arjunmanoj1995'
#### make failed to build some targets (01:07:57 (hh:mm:ss)) ####
can someone plz help me resolve this error.
Click to expand...
Click to collapse
It seems like your missing the backports module to build certain parts of the rom. As i looked at the prepare script you used I noticed an commented piece of code in there refering exectly to your error regarding lzma backports:
Code:
#echo Cloning LZMA repo
#git clone https://github.com/peterjc/backports.lzma /tmp/backports.lzma
#cd /tmp/backports.lzma
#sudo python2 setup.py install
#python2 test/test_lzma.py
#rm -rf /tmp/backports.lzma
#echo LZMA compression for ROMs enabled
#echo "WITH_LZMA_OTA=true" >> ~/.bashrc
Running this, or running the prepare script again with this uncommented might acctualy fix your import problem
gs-crash-24-7 said:
It seems like your missing the backports module to build certain parts of the rom. As i looked at the prepare script you used I noticed an commented piece of code in there refering exectly to your error regarding lzma backports:
Code:
#echo Cloning LZMA repo
#git clone https://github.com/peterjc/backports.lzma /tmp/backports.lzma
#cd /tmp/backports.lzma
#sudo python2 setup.py install
#python2 test/test_lzma.py
#rm -rf /tmp/backports.lzma
#echo LZMA compression for ROMs enabled
#echo "WITH_LZMA_OTA=true" >> ~/.bashrc
Running this, or running the prepare script again with this uncommented might acctualy fix your import problem
Click to expand...
Click to collapse
thanks mate, i'll give this a try and report back
edit: thanks .... it worked...:good:
I can't install the backports thing... I can't use the script to setup the build environment. How did you do it @baconxda? I uncommented those lines and it says that it doesn't have the lzma.h thing.
gs-crash-24-7 said:
It seems like your missing the backports module to build certain parts of the rom. As i looked at the prepare script you used I noticed an commented piece of code in there refering exectly to your error regarding lzma backports:
Code:
#echo Cloning LZMA repo
#git clone https://github.com/peterjc/backports.lzma /tmp/backports.lzma
#cd /tmp/backports.lzma
#sudo python2 setup.py install
#python2 test/test_lzma.py
#rm -rf /tmp/backports.lzma
#echo LZMA compression for ROMs enabled
#echo "WITH_LZMA_OTA=true" >> ~/.bashrc
Running this, or running the prepare script again with this uncommented might acctualy fix your import problem
Click to expand...
Click to collapse
Cesaragus said:
I can't install the backports thing... I can't use the script to setup the build environment. How did you do it @baconxda? I uncommented those lines and it says that it doesn't have the lzma.h thing.
Click to expand...
Click to collapse
just run the script then run those commands quoted above, thats it.
@baconxda Any idea if this ROM could be built for any other device?
Has.007 said:
@baconxda Any idea if this ROM could be built for any other device?
Click to expand...
Click to collapse
only for devices supported by @Sultanxda.

Categories

Resources