Skip to main content

Building Android Cross Compiler with Crosstool-ng

In order for you to rebuilt a kernel (or even a ROM) for Android from your laptop, you need a cross compiler to do that.

For Android ecosystem there are several popular cross compilers that being used:


  1. Android NDK
  2. Android Toolchain (which I believe a subset of the NDK)
  3. Linaro customized cross compiler 
  4. Self-made cross compiled built by using crosstool-ng
  5. You do it yourself (but I never succeed this one)
I currently use crosstool-ng cross compiler "cooking tool" as it has several features;

You can save a stage for the built process. For example, I just got my laptop shutdown automatically (perhaps due to CPU overheating.. never shut it down for approx due days).. and since I chose the option for saving the compile state, the process just can be restarted at the previous stage:

Just use the build.log and parse the related info


najmi@vostro:~/toolchain/build-cng$ cat build.log |grep "Saving state"
[EXTRA]  Saving state to restart at step 'libc_check_config'...
[EXTRA]  Saving state to restart at step 'companion_libs_for_build'...
[EXTRA]  Saving state to restart at step 'binutils_for_build'...
[EXTRA]  Saving state to restart at step 'companion_libs_for_host'...
[EXTRA]  Saving state to restart at step 'binutils_for_host'...
[EXTRA]  Saving state to restart at step 'cc_core_pass_1'...
[EXTRA]  Saving state to restart at step 'kernel_headers'...
[EXTRA]  Saving state to restart at step 'libc_start_files'...
[EXTRA]  Saving state to restart at step 'cc_core_pass_2'...
[EXTRA]  Saving state to restart at step 'libc'...
[EXTRA]  Saving state to restart at step 'cc_for_build'...
[EXTRA]  Saving state to restart at step 'cc_for_host'...
najmi@vostro:~/toolchain/build-cng$ ct-ng cc_for_host+

 
The problem with abruptly terminated compilation process could also due to error in the compilation process. That way you just have to start where you suspect the compilation error occurs;

Simply with you can continue from the last saved state onwards;


najmi@vostro:~/toolchain/build-cng$ unset LD_LIBRARY_PATH
najmi@vostro:~/toolchain/build-cng$ ct-ng cc_for_host+
[INFO ]  Performing some trivial sanity checks
[INFO ]  Build started 20131130.102737
[INFO ]  Building environment variables
[EXTRA]  Preparing working directories
[EXTRA]  Restoring state at step 'cc_for_host', as requested.
[INFO ]  =================================================================
[INFO ]  Installing final compiler
[EXTRA]    Configuring gcc
[EXTRA]    Building gcc
[07:57] / 



Comments

Popular posts from this blog

Panduan Bas Ekspres Kuala Lumpur (TBS) - Skudai

Nota ringkas untuk saya. Bas dari KL (Terminal Bas Bersepadu Selatan, TBS) ke Johor Bahru (Larkin Terminal) secara umum bermula 8 pagi hingga ke pukul 12 malam. Ada banyak syarikat yang ke sana jadi boleh dikatakan tiket boleh dibeli secara on-spot tanpa belian awal.
Harga tiket adalah sekitar RM31-32 bergantung kepada syarikat. Sesetengah syarikat mengenakan caj tambahan 10 sen untuk insurans. 
TBS boleh dihubungkan dengan stesen Komuter, ERL, dan LRT. LRT akan tamat perkhidmatan pada pukul 1130 malam jadi rancang perjalanan supaya tak perlu ambil perkhidmatan teksi yang cekik darah.. contohnya dari TBS ke Taman Cempaka Ampang kalau naik LRT hanya RM1.60, naik "Teksi Bajet" (bajet la sangat) adalah RM33 
Bas dari KL-JB turun di Larkin. Sekiranya belajar/ada urusan di UTM Skudai, beritahu pemandu bas untuk turun di Taman Sri Putri/Sri Putri. Kemudian boleh ambil teksi di seberang jalan (naik jejantas), untuk ambil teksi sapu atau teksi berdaftar. Jangkaan harga teksi adalah…

Cara Renew Passport Pembantu Rumah di Kedutaan Indonesia 2015

Tulisan ni sah sehingga 17 Febuari 2015 semalam.


Ceritanya aku bermula dari seminggu sebelum 17 Feb 2015 tu lagi.. passport bibik aku expired pada Oktober 2015, jadi cadang nak buat sementara aku tengah cuti belajar ni.. ingat settle sehari macam ditulis pada kebanyakan blog, tapi disebabkan kedutaan NKRI ni tengah berubah kepada sistem biometrik (dia ambil cap 10 jari, semua tangan kanan dan kiri!).. Ginilah ceritanya:


Minggu satu
Hari Selasa : Datang pukul 7. Pukul 9 bukak gate. Pengawal kata.. nombor ambik Isnin atau Khamis sahaja

Hari Khamis: Datang pukul 7 pagi. Pukul 9 pagi bukak gate.. dalam pukul 10 pagi dapat nombor..
serah 3 borang kontrak dan dokumen
datang esok untuk buat passport

Hari Jumaat: Datang pukul 9 PAGI.. sebab nombor dah ada.. pukul 1230tghari staf embassy kata "DATANG BALIK LEPAS JUMAAT". so balik rumah solat jumaat.. pukul 3ptg datang balik. ambik gambar PUKUL LAPAN MALAM HAHAHAHA
Datang lagi ye.. Hari Selasa depan.. PUKUL DUA PETANG


Minggu dua
Hari Selasa: D…