Guest User

GCC 2.6.3 for android

a guest
May 29th, 2012
673
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. TOOLCHAIN NOTES:
  2. ----------------
  3.  
  4. GCC v4.6.3
  5. GDB v7.1.x
  6. MPC v0.9
  7. GMP v5.0.5
  8. MPFR v2.4.2
  9. BinUtil v2.21
  10.  
  11.  
  12. BUILDING FROM SOURCE:
  13. ---------------------
  14.  
  15. The following was used to build this package from source
  16.  
  17. 1) Get initial toolchain source code
  18. repo init -u https://android.googlesource.com/toolchain/manifest
  19.  
  20. 2) sync and lock the projects to the following versions (or drop this over the current manifest and sync)
  21. (.repo/manifest.xml)
  22.  
  23. <?xml version="1.0" encoding="UTF-8"?>
  24. <manifest>
  25. <remote fetch=".." name="aosp" review="https://android-review.googlesource.com/"/>
  26.  
  27. <default remote="aosp" revision="master" sync-j="4"/>
  28.  
  29. <project name="toolchain/avr-libc" path="avr-libc" revision="9b9d708c6a8a66a75d9fdf8eb6b35305bb1712e3"/>
  30. <project name="toolchain/benchmark" path="benchmark" revision="c7949005d4283c0be18307ffb8410780e9a4a0c3"/>
  31. <project name="toolchain/binutils" path="binutils" revision="07e1f1545d1f8f81a67ce17256f96df8ab7f70e3"/>
  32. <project name="toolchain/build" path="build" revision="6d144f8edfd3879d3c241713331460d9a6e3ee86"/>
  33. <project name="toolchain/expat" path="expat" revision="40172a0ae9d40a068f1e1a48ffcf6a1ccf765ed5"/>
  34. <project name="toolchain/gcc" path="gcc" revision="5f2f4ef69e2f64970aad2c303a529c49789021d8"/>
  35. <project name="toolchain/gdb" path="gdb" revision="b3007e980fad8bf4fc0fca1d3823aff648339798"/>
  36. <project name="toolchain/gmp" path="gmp" revision="e6b9669dafc6a5f83c80b4b4176359b78bccdc90"/>
  37. <project name="toolchain/gold" path="gold" revision="8d401cf711539af5a2f78d12447341d774892618"/>
  38. <project name="toolchain/mpc" path="mpc" revision="a4109ccc6e07f72f41c397a17fdfbed3e5e19c66"/>
  39. <project name="toolchain/mpfr" path="mpfr" revision="bde731396c38c8d5b0bca800aace6a690d0d2978"/>
  40. </manifest>
  41.  
  42. 3) Get the existing toolchain (for sysroot)
  43. git clone https://android.googlesource.com/platform/prebuilt -b master
  44.  
  45. 4) checkout the correct version
  46.  
  47. cd prebuilt
  48. git checkout -f a4062cc40fcaa0776dc880ce591b4c515d36f420
  49. cd ..
  50.  
  51. 5) cd into the mpc directory
  52. cd mpc
  53.  
  54. 6) download mpc v0.9
  55. wget http://www.multiprecision.org/mpc/download/mpc-0.9.tar.gz
  56.  
  57. 7) cd into the gcc directory
  58. cd ../gcc
  59.  
  60. 8) Download gcc-4.6.3.tar.bz2 from one of the mirrors
  61. http://www.gnu.org/software/gcc/gcc-4.6/
  62.  
  63. (example for the ftp.mirrorservice.org mirror valid as of May29th 2012):
  64.  
  65. wget ftp://ftp.mirrorservice.org/sites/sourceware.org/pub/gcc/releases/gcc-4.6.3/gcc-4.6.3.tar.bz2
  66.  
  67. 9) Download the patch at: http://gcc.gnu.org/bugzilla/attachment.cgi?id=24879
  68.  
  69.  
  70. wget 'http://gcc.gnu.org/bugzilla/attachment.cgi?id=24879'
  71.  
  72. 10) extract gcc
  73.  
  74. tar -xjvf gcc-4.6.3.tar.bz2
  75.  
  76. 11) change into the gcc-4.6.3 directory
  77.  
  78. cd gcc-4.6.3
  79.  
  80. 12) apply the patch
  81. patch -p 1 < ../attachment.cgi\?id\=24879
  82.  
  83. 13) cd to the root of the toolchain repo, then cd into build
  84.  
  85. cd ../../build/
  86.  
  87. 14) edit Makefile.in and apply the following:
  88.  
  89. diff --git a/Makefile.in b/Makefile.in
  90. index eb78661..bb22b35 100644
  91. --- a/Makefile.in
  92. +++ b/Makefile.in
  93. @@ -444,7 +444,7 @@ CFLAGS_FOR_TARGET += -DTARGET_POSIX_IO -fno-short-enums
  94. # ARM specific options.
  95. ifeq ($(target_cpu),arm)
  96. GCC_CONFIG_ARGS += --with-float=soft --with-fpu=vfp --with-arch=armv5te \
  97. - --enable-target-optspace
  98. + --enable-target-optspace --disable-libquadmath --with-pic
  99.  
  100. ifneq ($(target_os),linux-androideabi)
  101. GCC_CONFIG_ARGS += --with-abi=aapcs
  102.  
  103. 15) run
  104. CFLAGS="-m32 -fPIC" ./configure --with-gcc-version=4.6.3 --with-binutils-version=2.21 --with-gmp-version=5.0.5 --with-mpfr-version=2.4.2 --with-gdb-version=7.1.x --with-mpc-version=0.9 --with-sysroot=`pwd`/../prebuilt/linux-x86/toolchain/i686-linux-glibc2.7-4.4.3/sysroot --target arm-linux-androideabi --host i686 --build i686
  105.  
  106. 16) CFLAGS="-m32" make build
  107. (optional add the '-j <number of CPU cores +1>' to this step to speed up the build)
  108.  
  109. 17) make prefix=`pwd`/../toolchain-4.6.3 install
RAW Paste Data