Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,738,368 Members 51,621 Now Online
XDA Developers Android and Mobile Development Forum

[Q] How and where to get linaro patches for CM kernel/ROM build

Tip us?
 
redhavoc
Old
(Last edited by redhavoc; 29th January 2014 at 11:28 AM.) Reason: updated instructions
#1  
Junior Member - OP
Thanks Meter 1
Posts: 4
Join Date: Jan 2014
Location: Cheltenham
Default [Q] How and where to get linaro patches for CM kernel/ROM build

Hello
I've been trying to build my own cyanogenmod 11 build using the linaro toolchains on a galaxy S (i9000), with mixed success. At the moment I can compile everything with 4.8. I would preferably like to add strict-aliasing, and the -fmodulo-sched -fmodulo-sched-allow-regmoves flags for kernel, and rom (arm/thumb) builds. If possible I would like to add the -O3 flag too, but the -fpredictive-commoning and the vectorising options definitely create segmentation faults in the compilation.

Also I hear the linaro has some library patches to improve memory operations, and maybe optimisations to other libraries. Is there a link or tutorial or a list of what I need to get in order to get a successful build with most optimisations in?

Last, is there a nice reliable way to test a ROM rather than put it in my phone all the time. I usually appaly it to my phone and restoring can be very difficult.


For people who are looking for similar information and to point what I have done so far is the following. (Unfortunately XDA forum does not allow me to post links yet) I put in a quote to differentiate.

Quote:
mkdir ~/android
cd ~/android


Download the latest linaro gcc 4.8
Google 'linaro downloads 13.12' and find in the page the links for android-toolchain 4.8
[i]tar -xjf android-toolchain-eabi-4.8-2013.12-x86.tar.bz2
mv android-toolchain-eabi android-toolchain-eabi-4.8

Follow the cyanogenmod wiki up the point of running the 'lunch <device command>'
Google 'How to Build CyanogenMod for the Galaxy S galaxysmtd' to get the link (XDA does not let me post it)
It is for galaxy S i9000 but every other device should be similar

After that there were a couple of choices, but what I prefer is doing the following
in the directory ~/android/system//prebuilts/gcc/linux-x86/arm
I run the following commands to link the linaro gcc tools to the default gcc-4.8 toolchain used by cyanogenmod
ln -s ~/android/android-toolchain-eabi-4.8 arm-eabi-4.8
ln -s ~/android/android-toolchain-eabi-4.8 arm-linux-androideabi-4.8


changed flags in ~/android/system/build/core/combo/TARGET_linux-arm.mk
change variable TARGET_GCC_VERSION from "4.7" to "4.8"

in file ~/android/system/system/vold/Android.mk
for variable common_cflags
add the flag -Wno-error=unused-parameter
so it should look like
common_cflags += -Werror -Wno-error=unused-parameter

in file ~/android/system/bootable/recovery/voldclient/Android.mk
for variable LOCAL_CFLAGS
add the flag -Wno-error=unused-parameter
it should look like
LOCAL_CFLAGS := -DMINIVOLD -Werror -Wno-error=unused-parameter

then to finish the build
croot
brunch galaxysmtd
I would really appreciate some help, and hope my post helps some newbies like me
 
redhavoc
Old
#2  
Junior Member - OP
Thanks Meter 1
Posts: 4
Join Date: Jan 2014
Location: Cheltenham
Anybody has anything to add?
 
SetiroN
Old
(Last edited by SetiroN; 4th February 2014 at 09:08 PM.)
#3  
SetiroN's Avatar
Senior Member
Thanks Meter 281
Posts: 268
Join Date: Aug 2010

 
DONATE TO ME
Take a look at this thread:

http://forum.xda-developers.com/show....php?t=2330970

With an obvious degree of uncertainty, everything should work on CM11 and your device as well: all those patches aren't device specific, they mostly allow you to avoid aliasing issues (such as switching from SLUB to SLAB or selectively use fno-strict-aliasing within certain problematic areas) or fix small things that are still largely identical between different android releases and devices.
I would suggest doing the patching manually, cherry-picking one by one, instead of creating a script - so that you can more easily detect conflicts.
https://github.com/SetiroN/
Find me on #vorkKernel@irc.freenode.net or Twitter @set_iroN
The Following User Says Thank You to SetiroN For This Useful Post: [ Click to Expand ]
 
redhavoc
Old
#4  
Junior Member - OP
Thanks Meter 1
Posts: 4
Join Date: Jan 2014
Location: Cheltenham
I actually took the same path as provided in the thread for enabling strict aliasing for thumb compilations. At the moment I dont have a solution for the kernel, but I will take a look on the sony kernel provided in the thread and maybe it can guide me through.

It would still be nice to know more about these magical linaro patches, haven't been able to find anything solid other than people mentioning that they have builds with them.

Thank you for the answer, really appreciate it
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes