How to build your own toolchain (on ICS, for non-SSE3 CPUs)

578 views
Skip to first unread message

StefanS

unread,
Feb 2, 2012, 5:19:58 AM2/2/12
to andro...@googlegroups.com
Dear group.

since the prebuilt ICS toolchain is not ideal for everyone, here is how to build your own:
in "prebuilt", apply patch-prebuilt.patch and in "ndk" apply patch-ndk.patch (modify this as you see fit, e.g. I added "-mno-sse3 -mtune=pentium-m").

Then, in the root of the ICS tree, run "prebuilt/linux-x86/toolchain/i686-android-linux-4.4.3/build-toolchain.sh"

That worked mostly for me, although some packages still seem to use wrong compiler options.

Stefan
P.S.: Let me know if this works, then I'll probably add this information to www.android-x86.org
patch-ndk.patch
patch-prebuilt.patch

Chih-Wei Huang

unread,
Feb 2, 2012, 7:48:36 AM2/2/12
to andro...@googlegroups.com
The toolchains in honeycomb-x86 doesn't have the issue.
Maybe we should just revert to the old toolchain.

Or, there maybe a simpler solution if you have both
honeycomb-x86 and ics-x86 source tree.
Just create a buildspec.mk, put

TARGET_TOOLS_PREFIX:=$(HC-x86-top)/prebuilt/linux-x86/toolchain/i686-android-linux-4.4.3/bin/i686-android-linux-

I didn't try, but I think it should work.

2012/2/2 StefanS <and...@stefanseidel.info>:


> Dear group.
> since the prebuilt ICS toolchain is not ideal for everyone, here is how to
> build your own:
> in "prebuilt", apply patch-prebuilt.patch and in "ndk" apply patch-ndk.patch
> (modify this as you see fit, e.g. I added "-mno-sse3 -mtune=pentium-m").
>
> Then, in the root of the ICS tree, run
> "prebuilt/linux-x86/toolchain/i686-android-linux-4.4.3/build-toolchain.sh"
>
> That worked mostly for me, although some packages still seem to use wrong
> compiler options.

--
Chih-Wei
Android-x86 project
http://www.android-x86.org

veer

unread,
Feb 15, 2012, 3:46:19 AM2/15/12
to andro...@googlegroups.com

veer

unread,
Feb 15, 2012, 3:53:30 AM2/15/12
to andro...@googlegroups.com
Hi Stefans,

As per above ,while i am tring  to run "prebuilt/linux-x86/toolchain/
i686-android-linux-4.4.3/build-toolchain.sh",it's not showing any thing for me.please let me know your suggestion to make it work for me.

Regards
Raj

StefanS

unread,
Feb 15, 2012, 3:58:21 AM2/15/12
to andro...@googlegroups.com
Hi Raj,

once you have built the toolchain, the script will delete itself. To
do it again, run
cd prebuilt
git checkout linux-x86/toolchain/i686-android-linux-4.4.3/build-toolchain.sh

Stefan

> --
> You received this message because you are subscribed to the Google Groups
> "Android-x86" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/android-x86/-/n9L0tz6BqX0J.
>
> To post to this group, send email to andro...@googlegroups.com.
> To unsubscribe from this group, send email to
> android-x86...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/android-x86?hl=en.

StefanS

unread,
Feb 16, 2012, 8:57:43 AM2/16/12
to andro...@googlegroups.com, pcb
Hi,

you need to change the compiler settings in the NDK patch. Try
something like "-march=pentium-mmx -mfpmath=387".
Not sure if it will work.

Stefan


On Thu, Feb 16, 2012 at 14:38, pcb <prab...@gmail.com> wrote:
> Hi Stefan,
>
> I am trying to port ICS on i586 processor related device. When i am
> trying to boot iso image on the same, it gives error as below and goes
> to panic.
>
> Error is:
> Running MirBSD Korn Shell ...
> Illegal instruction
> Kernel panic - not syncing: Attempted to kill init!
> Pid: 1, comm: chroot Not tainted 3.0.8-android-x86+eeepc ....
>
> What i feel is its due to some hardware related stuff. May be due to
> SSE flags that is not supported by the Device -with i586 processor.
> Can you please let me know the solution for the same.
>
> When i see the cpuinfo of the device it seems to be supporting  fpu
> tsc cx8 mmx flags only.
>
> I tried your suggested method, but after running build-toolchain.sh as
> suggested by you, it shows it is trying to download some thing from
> the git, and finally does not download anything, it stays in loop.
> Can you please let me know the solution for the same.
>
> Thanks and best regards,
> pcb

>>  patch-ndk.patch
>> < 1KViewDownload
>>
>>  patch-prebuilt.patch
>> 1KViewDownload

veer

unread,
Feb 17, 2012, 1:08:59 AM2/17/12
to Android-x86
Hi Stefan,

I tried as per your previous comment but i am facing following error.
root@raj:~/android#
prebuilt/linux-x86/toolchain/i686-android-linux-4.4.3/build-
toolchain.sh
Download toolchain patches to:
/tmp/i686-android-linux-4.4.3-20120217/toolchain-sources
Using git
clone prefix: git://android.git.kernel.org/toolchain
downloading
sources for toolchain/binutils
cloning
git://android.git.kernel.org/toolchain/binutils.git
<=====================
cd: 170: can't cd to binutils
fatal:
Not a git repository (or any of the parent directories): .git
Using
sources for date '2011-02-23': toolchain/binutils revision
ERROR:
Could not checkout binutils ?
PANIC: Could not download toolchain
sources!


Regrads
Raj

StefanS

unread,
Feb 17, 2012, 1:22:36 AM2/17/12
to andro...@googlegroups.com
Hi raj,

you didn't apply the patch.
You can now also check my github repository where I have committed a
shell script and the patches which build the toolchain.
See https://github.com/seidler2547/android-x86-ibm-thinkpad-x41t/tree/x86/ics-x86/patches

Stefan

veer

unread,
Feb 17, 2012, 2:32:00 AM2/17/12
to Android-x86
Hi Stefan,
sorry, still i can see following on console
root@raj-desktop:~/android# ls
abi bionic build development external hardware
libcore ndk packages prebuilt.patch system
apply.sh bootable dalvik device frameworks kernel
Makefile ndk.patch prebuilt sdk
root@prabhu-desktop:~/android# ./apply.sh
Download toolchain patches to: /tmp/i686-android-linux-4.4.3-20120217/
toolchain-sources
Using git clone prefix: https://android.googlesource.com/toolchain
downloading sources for toolchain/binutils

Regards
Raj


On Feb 17, 11:22 am, StefanS <andr...@stefanseidel.info> wrote:
> Hi raj,
>
> you didn't apply the patch.
> You can now also check my github repository where I have committed a
> shell script and the patches which build the toolchain.
> Seehttps://github.com/seidler2547/android-x86-ibm-thinkpad-x41t/tree/x86...

StefanS

unread,
Feb 17, 2012, 5:09:12 AM2/17/12
to andro...@googlegroups.com
Yes, that looks good. Even on my 32MBit internet connection it took a
good while to download all the resources, but in total including
download and build it didn't take more than 10 minutes to build.

Stefan

Message has been deleted

StefanS

unread,
Feb 21, 2012, 10:52:55 AM2/21/12
to andro...@googlegroups.com

Hi Raj,

I don't know what else to do. Maybe you need to try manually with
"git clone https://android.googlesource.com/toolchain"
and check if there is an error.

Stefan

On Feb 21, 2012 1:19 PM, "veer" <rajkum...@gmail.com> wrote:
Hi Stefan,

as you per previous blog discussion , i find the speed issue with my
connection , so that i kept it for the day

root@raj-desktop:~/android# ./prebuilt/linux-x86/toolchain/i686-
android-linux-4.4.3/build-toolchain.sh
Download toolchain patches to: /tmp/i686-android-linux-4.4.3-20120221/

toolchain-sources
Using git clone prefix: https://android.googlesource.com/toolchain
downloading sources for toolchain/binutils

here finally,/tmp/i686-android-linux-4.4.3-20120221/toolchain-sources
folder is created but i din't find any content inside the folder.could
you please suggest me for any other way to download it.i have already
tried all possible way, which i have know.

Regards
Raj

veer

unread,
Feb 22, 2012, 12:29:56 AM2/22/12
to Android-x86
Hi Sefans,

i can see following error log


root@raj-desktop:~/android# ./prebuilt/linux-x86/toolchain/i686-
android-linux-4.4.3/build-toolchain.sh
Download toolchain patches to: /tmp/i686-android-linux-4.4.3-20120221/
toolchain-sources
Using git clone prefix: https://android.googlesource.com/toolchain
downloading sources for toolchain/binutils
Using sources for date '2011-02-23': toolchain/binutils revision
a4316ba2b7698435a68e9826cabd87ae43dad182
downloading sources for toolchain/build
Using sources for date '2011-02-23': toolchain/build revision
2037ad5fa2969e0e77142548feb8cf54dc7b0a04
downloading sources for toolchain/gcc
Using sources for date '2011-02-23': toolchain/gcc revision
80934e7f7db429984fb56756a4cc893ba412b7b5
downloading sources for toolchain/gdb
Using sources for date '2011-02-23': toolchain/gdb revision
3954a66c7a6939e2c7bed362ec4df06b9f921bcf
downloading sources for toolchain/gmp
Using sources for date '2011-02-23': toolchain/gmp revision
9fb242a79dd122d7fbf867daf5620dba6927bd2e
downloading sources for toolchain/gold
Using sources for date '2011-02-23': toolchain/gold revision
8d401cf711539af5a2f78d12447341d774892618
downloading sources for toolchain/mpfr
Using sources for date '2011-02-23': toolchain/mpfr revision
da6dfde986af1b56f0f41e9f5de61d093fa8af90
Patching toolchain sources
Toolchain sources downloaded and copied to /tmp/i686-android-
linux-4.4.3-20120221/toolchain-sources
Cleaning up...
Done.
Copy development/ndk to: /tmp/i686-android-linux-4.4.3-20120221/devel
Generate platform files into: /tmp/i686-android-linux-4.4.3-20120221/
ndk-install
WARNING: --abi=<names> is deprecated. Use --arch=<names> instead!
Copying android-14 platform files
Copying android-3 platform files
Copying android-4 platform files
Copying android-5 platform files
Copying android-8 platform files
Copying android-9 platform files
Copying system files into: /tmp/i686-android-linux-4.4.3-20120221/ndk-
install/sysroot
Building i686-android-linux-4.4.3 now (this can be long).
### ndk/build/tools/build-gcc.sh --sysroot=/tmp/i686-android-
linux-4.4.3-20120221/ndk-install/sysroot --build-out=/tmp/i686-android-
linux-4.4.3-20120221/toolchain-build --mpfr-version=2.4.1 --gdb-
version=6.6 --binutils-version=2.20.1 /tmp/i686-android-
linux-4.4.3-20120221/toolchain-sources /tmp/i686-android-
linux-4.4.3-20120221/ndk-install x86-4.4.3
To follow build in another terminal, please use: tail -F /tmp/i686-
android-linux-4.4.3-20120221/toolchain-build/config.log
Using C compiler: /root/android/ndk/../prebuilt/linux-x86/toolchain/
i686-linux-glibc2.7-4.4.3/bin/i686-linux-gcc
Using C++ compiler: /root/android/ndk/../prebuilt/linux-x86/toolchain/
i686-linux-glibc2.7-4.4.3/bin/i686-linux-g++
Sysroot : Copying: /tmp/i686-android-linux-4.4.3-20120221/ndk-install/
sysroot --> /tmp/i686-android-linux-4.4.3-20120221/ndk-install/
toolchains/x86-4.4.3/prebuilt/linux-x86/sysroot
Forcing -nostartfiles: -nostartfiles /tmp/i686-android-
linux-4.4.3-20120221/ndk-install/toolchains/x86-4.4.3/prebuilt/linux-
x86/sysroot/usr/lib/crtbegin_dynamic.o /tmp/i686-android-
linux-4.4.3-20120221/ndk-install/toolchains/x86-4.4.3/prebuilt/linux-
x86/sysroot/usr/lib/crtend_android.o
Configure: x86-4.4.3 toolchain build
Building : x86-4.4.3 toolchain [this can take a long time].
Error while building toolchain. See /tmp/i686-android-
linux-4.4.3-20120221/toolchain-build/config.log
PANIC: Could not build compiler!
root@praj-desktop:~/android#

are we missing any step here.

Raj


On Feb 17, 3:09 pm, StefanS <andr...@stefanseidel.info> wrote:

StefanS

unread,
Feb 22, 2012, 3:11:09 AM2/22/12
to andro...@googlegroups.com
Hi Raj,

On Wed, Feb 22, 2012 at 06:29, veer <rajkum...@gmail.com> wrote:
> Error while building toolchain. See /tmp/i686-android-
> linux-4.4.3-20120221/toolchain-build/config.log

> are we missing any step here.
Checking the file above? Probably you're missing a library or package
on your system.

Stefan

Mohd Zainy Brahim

unread,
Feb 22, 2012, 5:01:42 AM2/22/12
to andro...@googlegroups.com
dear stefan...
how to apply those patches
tq
p.s saya dari malaysia

veer

unread,
Feb 23, 2012, 12:06:52 AM2/23/12
to Android-x86
Hi Stefan,

Great !!!...
Its' working fine...finally,i can see ICS -GUI.
Issue :here, i can see initial ICS-GUI image is tilted to +90 degree
from the normal image on screen.what settings needs to be done to get
proper GUI-image

Thanks a lot.

Raj


On Feb 22, 1:11 pm, StefanS <andr...@stefanseidel.info> wrote:
> Hi Raj,
>
Reply all
Reply to author
Forward
0 new messages