[HOWTO][GUIDE][LINARO] Build ROM With Linaro Toolchain

Search This thread

Dri94

Senior Member
Oct 9, 2011
2,058
645
Florida

linaro-logo.png

Warning:
I am not responsible for anything you do to your phone


THIS GUIDE IS VERY OUTDATED AND NOT PROPER. I'M VERY BUSY AND DON'T EVEN BUILD MY OWN ROMS ANYMORE. I'LL UPDATE WITH A NEW METHOD WHEN I HAVE TIME TO RESEARCH ONE.

This is all infromation i recieved from atc3030 so please stop by his profile and hit that beautiful thanks button. I am posting this after numerous requests from people on how to compile ROMs with the Linaro toolchain

What you'll need
  • Basic knowledge of how to compile a ROM
  • Common Sense
  • Fingers to stop by atc3030 profile to thank him.
  • Read Through instructions once before executing, there short so don't complain.

Lets Get Started!
  1. Navigate To Root Of Your Source In Terminal
  2. Run: "cd prebuilts/gcc/linux-x86/arm/"
    cdarmchain_zps2a12ce3a.png
  3. Run:
    ICS "wget http://releases.linaro.org/12.07/components/android/toolchain/4.7/android-toolchain-eabi-linaro-4.7-2012.07-3-2012-06-19_14-52-07-linux-x86.tar.bz2"
    JB "wget http://releases.linaro.org/12.11/components/android/toolchain/4.7/android-toolchain-eabi-linaro-4.7-2012.11-1-2012-11-16_21-55-58-linux-x86.tar.bz2"
    wget_zps845acf1d.png
  4. Run: "bunzip2 *.tar.bz2"
  5. Run: "tar -xvf *.tar"
  6. In Your File Browser Navigate To Root Folder Of Your Source
  7. Navigate To ~/build
    navbuild_zpse910250b.png
  8. Open envsetup.sh In Your Favorite Text Editor
  9. Modify The Arm Toolchain Line To Reflect Your Linaro Folder (Check Picture)
    modifyenvsetupsh_zpsc535cc70-1_zps635bf880.jpg
  10. Now: Enjoy :]
I will try to keep toolchain links updated. If one is released without me updating the post then PM me.
 
Last edited:

mert2go

Senior Member
Aug 11, 2011
175
29
You are awesome!!! Thanks for this Post!!! :)

Sent from my Galaxy Nexus using xda app-developers app
 
  • Like
Reactions: fesu597

beekay201

Senior Member
Nov 8, 2010
5,224
1,221
I installed the toolchain system-wide. Build it from src/create a pkg for your package manager, install. Point build system to it.
Thanks for the time spent creating this thread, but this is a rather hackish way of doing it.

Sent from my i9250
 

Dri94

Senior Member
Oct 9, 2011
2,058
645
Florida
I installed the toolchain system-wide. Build it from src/create a pkg for your package manager, install. Point build system to it.
Thanks for the time spent creating this thread, but this is a rather hackish way of doing it.

Sent from my i9250

if you have a better way PM me, ill add things in and edit things (with your name by it ofcourse lol)
 
  • Like
Reactions: fesu597

apascual89

Inactive Recognized Contributor
Jan 17, 2011
5,558
13,306
Atlanta, GA
when you add the linaro toolchain files into the folder. the arm-linux file need to be deleted (tahts the old toolchain).

Where would that file be? Have been building for a while, but never messed with the toolchain before.

There are some in ndk/toolchains and more in external/valgrind/main/exp-bbv/tests
 
Last edited:

Dri94

Senior Member
Oct 9, 2011
2,058
645
Florida
Where would that file be? Have been building for a while, but never messed with the toolchain before.

There are some in ndk/toolchains and more in external/valgrind/main/exp-bbv/tests

Prebuilts toolchain. Sane place you d download the file to

____________________________________________________________
"A foot is the ultimate stocking stuffer."
 

Dri94

Senior Member
Oct 9, 2011
2,058
645
Florida
Ok so i was informed that 4.2 changes everything, if you know enough then simply putting the files in the new toolhain folder (prebuilts,gcc,arm) is enough though dirtier and more hacksih then this method. I will be updating the OP once i find a cleaner method
 

wKovacs64

Member
Dec 23, 2010
20
1
Is it just a matter of replacing /prebuilts/gcc/linux-x86/arm/arm-eabi-4.6 with the android-toolchain-eabi directory from the Linaro archive (renaming it to arm-eabi-4.6)? Or is there more to it than that?
 

Dri94

Senior Member
Oct 9, 2011
2,058
645
Florida
Is it just a matter of replacing /prebuilts/gcc/linux-x86/arm/arm-eabi-4.6 with the android-toolchain-eabi directory from the Linaro archive (renaming it to arm-eabi-4.6)? Or is there more to it than that?

Yes you can do that. I was trying to get it to point to the 4.7 since that is Lindsay. I think is just modifying the envsetup





How would we go back if we dont like the results?

What's there not to like? I guess you could Google the default toolchain

edit: if you followed instructions you can just rename the .old file back to regular, and delete the linaro

____________________________________________________________
"A foot is the ultimate stocking stuffer."
 
Last edited:

KBizzle

Senior Member
Oct 30, 2008
4,200
4,410
Knoxville
Yes you can do that. I was trying to get it to point to the 4.7 since that is Lindsay. I think is just modifying the envsetup







What's there not to like? I guess you could Google the default toolchain

edit: if you followed instructions you can just rename the .old file back to regular, and delete the linaro

____________________________________________________________
"A foot is the ultimate stocking stuffer."

I did read it. Just lost track of the steps and wanted to make sure.

Sent from my SCH-I605 using Tapatalk 2
 

wKovacs64

Member
Dec 23, 2010
20
1
Yes you can do that. I was trying to get it to point to the 4.7 since that is Lindsay. I think is just modifying the envsetup

I tried replacing the arm-eabi-4.6 directory like I mentioned above, but I'm not convinced it actually used it. No way to tell, I suppose? Maybe I'll just wait til you have the cleaner method. :) Thanks for your efforts in this thread, by the way.

What's there not to like? I guess you could Google the default toolchain

edit: if you followed instructions you can just rename the .old file back to regular, and delete the linaro

Also, a 'repo sync' should wipe it out and revert to the default toolchain in whatever you're building.
 

Dri94

Senior Member
Oct 9, 2011
2,058
645
Florida
I tried replacing the arm-eabi-4.6 directory like I mentioned above, but I'm not convinced it actually used it. No way to tell, I suppose? Maybe I'll just wait til you have the cleaner method. :) Thanks for your efforts in this thread, by the way.



Also, a 'repo sync' should wipe it out and revert to the default toolchain in whatever you're building.

It used it if you did it right. There is no other toolchain for it to use lol. It looks in a location to find the toolchain. Add .bak to the end of the folder and it won't be able to locate the toolchain.... Repo sync doesn't effect it. Although it might in the future based on some open commits I saw

____________________________________________________________
"A foot is the ultimate stocking stuffer."
 
  • Like
Reactions: ketann

wKovacs64

Member
Dec 23, 2010
20
1
It used it if you did it right.

Depends on what "did it right" means, I guess. In /prebuilts/gcc/linux-x86/arm, I replaced the arm-eabi-4.6 directory with the renamed android-toolchain-eabi directory from the linaro archive.


There is no other toolchain for it to use lol. It looks in a location to find the toolchain. Add .bak to the end of the folder and it won't be able to locate the toolchain....

I'm not so sure that's true, at least in the case of the folder I mentioned earlier (/prebuilts/gcc/linux-x86/arm/arm-eabi-4.6). I just blew that directory away completely (arm-eabi-4.6) and compiled. It built just fine. So, maybe that isn't the folder it's looking at in 4.2?


Repo sync doesn't effect it. Although it might in the future based on some open commits I saw

Maybe that varies based on which ROM you're building, but in AOKP a 'repo sync' will overwrite some files in that directory and repopulate missing ones. Again though, we might be looking at the wrong directory for 4.2.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 134

    linaro-logo.png

    Warning:
    I am not responsible for anything you do to your phone


    THIS GUIDE IS VERY OUTDATED AND NOT PROPER. I'M VERY BUSY AND DON'T EVEN BUILD MY OWN ROMS ANYMORE. I'LL UPDATE WITH A NEW METHOD WHEN I HAVE TIME TO RESEARCH ONE.

    This is all infromation i recieved from atc3030 so please stop by his profile and hit that beautiful thanks button. I am posting this after numerous requests from people on how to compile ROMs with the Linaro toolchain

    What you'll need
    • Basic knowledge of how to compile a ROM
    • Common Sense
    • Fingers to stop by atc3030 profile to thank him.
    • Read Through instructions once before executing, there short so don't complain.

    Lets Get Started!
    1. Navigate To Root Of Your Source In Terminal
    2. Run: "cd prebuilts/gcc/linux-x86/arm/"
      cdarmchain_zps2a12ce3a.png
    3. Run:
      ICS "wget http://releases.linaro.org/12.07/components/android/toolchain/4.7/android-toolchain-eabi-linaro-4.7-2012.07-3-2012-06-19_14-52-07-linux-x86.tar.bz2"
      JB "wget http://releases.linaro.org/12.11/components/android/toolchain/4.7/android-toolchain-eabi-linaro-4.7-2012.11-1-2012-11-16_21-55-58-linux-x86.tar.bz2"
      wget_zps845acf1d.png
    4. Run: "bunzip2 *.tar.bz2"
    5. Run: "tar -xvf *.tar"
    6. In Your File Browser Navigate To Root Folder Of Your Source
    7. Navigate To ~/build
      navbuild_zpse910250b.png
    8. Open envsetup.sh In Your Favorite Text Editor
    9. Modify The Arm Toolchain Line To Reflect Your Linaro Folder (Check Picture)
      modifyenvsetupsh_zpsc535cc70-1_zps635bf880.jpg
    10. Now: Enjoy :]
    I will try to keep toolchain links updated. If one is released without me updating the post then PM me.
    9
    Anyone ever get this error and know how to fix? On ubuntu 12.10..
    Trying to build cm 10.1 with Linaro 4.7. Used these patches http://review.cyanogenmod.org/#/q/owner:"Evan+McClain"+status:open,n,z

    Code:
    Export includes file: external/oprofile/libpopt/Android.mk -- /home/juston/cm/out/host/linux-x86/obj/STATIC_LIBRARIES/liboprofile_popt_intermediates/export_includes
    Export includes file: external/oprofile/libop/Android.mk -- /home/juston/cm/out/host/linux-x86/obj/STATIC_LIBRARIES/liboprofile_op_intermediates/export_includes
    make: *** No rule to make target `/home/juston/cm/out/host/linux-x86/obj/STATIC_LIBRARIES/libbfd_intermediates/export_includes', needed by `/home/juston/cm/out/host/linux-x86/obj/EXECUTABLES/opannotate_intermediates/import_includes'.  Stop.
    make: *** Waiting for unfinished jobs....

    Yes, if you're using linaro's toolchain you need to set HAVE_LIBBFD := false in external/oprofile/common.mk
    Depending on how you named the folder containing the toolchain you have to put an if statement that sets HAVE_LIBBFD := false
    For example I named the folder linaro-4.7 and this is what I did:
    Changed this
    Code:
    ifeq ($(TARGET_ARCH),arm)
    toolchain := prebuilts/gcc/$(HOST_PREBUILT_TAG)/arm/arm-linux-androideabi-4.6
    common_host_c_includes := $(common_c_includes) $(toolchain)/include
    common_host_cflags := $(common_cflags) -fexceptions -DANDROID_HOST -DHAVE_XCALLOC
    common_host_ldlibs_libiconv :=
    
    ifeq ($(HOST_OS)-$(HOST_ARCH),darwin-x86)
    HAVE_LIBBFD := true
    common_host_cflags += -DMISSING_MREMAP
    common_host_ldlibs_libiconv := -liconv
    else
    ifeq ($(HOST_OS)-$(HOST_ARCH),linux-x86)
    HAVE_LIBBFD := true
    endif
    endif
    
    endif
    to this
    Code:
    ifeq ($(TARGET_ARCH),arm)
    toolchain := prebuilts/gcc/$(HOST_PREBUILT_TAG)/arm/arm-linux-androideabi-4.6
    common_host_c_includes := $(common_c_includes) $(toolchain)/include
    common_host_cflags := $(common_cflags) -fexceptions -DANDROID_HOST -DHAVE_XCALLOC
    common_host_ldlibs_libiconv :=
    
    ifeq ($(HOST_OS)-$(HOST_ARCH),darwin-x86)
    HAVE_LIBBFD := true
    common_host_cflags += -DMISSING_MREMAP
    common_host_ldlibs_libiconv := -liconv
    else
    [COLOR="Lime"]ifeq ($(findstring linaro,$(TARGET_TOOLS_PREFIX)),)[/COLOR]
    ifeq ($(HOST_OS)-$(HOST_ARCH),linux-x86)
    HAVE_LIBBFD := true
    endif
    endif
    [COLOR="lime"]endif[/COLOR]
    endif

    In this way it will set HAVE_LIBBFD := true only if the toolchain path doesn't contain the string linaro
    8
    hey guys whats your recommendation for toolchains?

    right now im building a custom aicp build for the lg g2 d802 using sabermod 4.8.3 for rom and sabermod 4.10 for kernel.

    should i change something?
    Check out https://github.com/SaberDroid and https://bitbucket.org/SaberTeam for latest

    Install libcloog-isl-dev on your system because they have graphite enabled, and the toolchain requires this even if graphite flags are not used. Reason is is because I have runtime libs enabled to help graphite compile better.

    Also if you use the prebuilts/gcc/linux-x86/host toolchains you'll need to edit this file like this:
    https://github.com/SaberDroid/prebuilts_tools/commit/6456275252b4741becb08011fedae3d6c885eb17

    For these you'll need to install libcap-dev for a missing header file needed by android and gcc 4.8
    For Graphite see the build repo and vendor/sd for the optimizations such as graphite. I just updated graphite to newer sources so enjoy
    7
    @sparksco @infected_
    I just booted up into CM12 compiled with SM 4.9.3 - both android and kernel. It works finaly! I just tried phone call and incall audio works (because it was issue on kitkat).
    I cherry picked those patches for ART and bluetooth:
    http://review.android.git.linaro.org/#/c/15334/
    http://review.android.git.linaro.org/#/c/15335/

    I need to test more things, but it looks like working well :).