{"id":27734544,"url":"https://github.com/anod/crosstool-ng-samples","last_synced_at":"2026-02-24T03:32:09.475Z","repository":{"id":13999033,"uuid":"16700289","full_name":"anod/crosstool-ng-samples","owner":"anod","description":"Crosstool NG configuration samples to build toolchains for Android Emulator and ARM device","archived":false,"fork":false,"pushed_at":"2014-02-10T16:38:16.000Z","size":140,"stargazers_count":4,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-28T13:12:52.165Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/anod.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-02-10T15:53:40.000Z","updated_at":"2024-04-13T07:11:48.000Z","dependencies_parsed_at":"2022-08-28T20:41:16.543Z","dependency_job_id":null,"html_url":"https://github.com/anod/crosstool-ng-samples","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/anod/crosstool-ng-samples","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anod%2Fcrosstool-ng-samples","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anod%2Fcrosstool-ng-samples/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anod%2Fcrosstool-ng-samples/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anod%2Fcrosstool-ng-samples/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/anod","download_url":"https://codeload.github.com/anod/crosstool-ng-samples/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anod%2Fcrosstool-ng-samples/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29770767,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-24T03:15:54.600Z","status":"ssl_error","status_checked_at":"2026-02-24T03:15:54.143Z","response_time":75,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-04-28T13:12:50.128Z","updated_at":"2026-02-24T03:32:09.431Z","avatar_url":"https://github.com/anod.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"crosstool-ng-samples\n====================\n\nCrosstool NG configuration samples to build toolchains for Android Emulator and arm device\n\nRequirements\n============\n\n - Ubuntu 12.04 (x86_64)\n - crosstool-ng 1.19.0\n - AOSP android-4.3.1_r1\n - Enough space on data partition (1024M)\n - Android SDK\n\n\nCrosstool-NG configurations\n===========================\n\n|  Host  |  Target  | Linux     | binutils | C compiler             | C library    | Static    | Toolchain |\n| ------ | -------- | --------- | -------- | ---------------------- | ------------ | --------- | --------- |\n| x86_64 | i686     | 2.6.27.62 | 2.20.1a  | gcc 4.6.4              | glibc 2.12.2 | N         | Cross     |\n| i686   | i686     | 2.6.27.62 | 2.20.1a  | gcc 4.6.4              | ulibc 2.12   | Y         | Canadian  |\n| x86_64 | arm      | 3.0.87    | 2.20.1a  | gcc-linaro 4.6-2013.05 | glibc 2.9    | N         | Cross     |\n| arm    | arm      | 3.0.87    | 2.20.1a  | gcc-linaro 4.6-2013.05 | glibc 2.9    | Y         | Canadian  |\n\n\n - GMP version (5.0.2) \n - MPFR version (3.1.2) \n - PPL version (0.11.2)\n - CLooG version (0.15.11)\n - MPC version (1.0.1) \n\n* Debug tools are disabled in order to reduce build time\n\nProcedure\n=========\n\nBuild for emulator x86\n----------------------\n\n```bash\n# Step 1. Download Crosstool-NG configurations \nwget 'https://github.com/anod/crosstool-ng-samples/archive/master.zip'\nunzip master.zip\n\n# Step 2. build toolchains for host x86_64 and target i686\ncd ~/crosstool-ng-samples-master/host-x86_64-target-i686\nct-ng i686-host-linux-gnu\nct-ng build\n# Result can be found in ~/x-tools/i686-host-linux-gnu\n\n# Step3. build toolchains for host i686 and target\ncd ~/crosstool-ng-samples-master/host-i686-target-i686\nct-ng i686-target-linux-gnu\nct-ng build\n# Result can be found in ~/x-tools/i686-target-linux-gnu\n\n# Step4. Push toolchain to the emulator\nadb root\nadb remount\nadb shell rm -rf /data/local/i686-target-linux-gnu\nadb push ~/x-tools/i686-target-linux-gnu /data/local/i686-target-linux-gnu/\n\n# Fix permissions of the files\ncd ~/x-tools\nfind i686-target-linux-gnu -exec stat -c '%a %n'  {} \\;| awk '{ print  \"adb shell chmod\", $1, \"/data/local/\"$2; }' \u003e adb_fix_permissions.sh\nchmod a+x adb_fix_permissions.sh\n./adb_fix_permissions.sh\n```\n\nBuild “Hello World” on Emulator\n-------------------------------\n\n```bash\nadb shell\ncd /data/local/\necho -e \"#include \u003cstdio.h\u003e\\nint main() {\\n    printf(\\\"Hello World.\\\");\\n    return 0;\\n}\" \u003e helloworld.c\n/data/local/i686-target-linux-gnu/bin/i686-target-linux-gnu-gcc helloworld.c -o helloworld -static\n./helloworld\n```\n\nBuild for device\n----------------\n\nBased on “Build for emulator x86”, \nChanges in used names:\n - host-x86_64-target-i686 -\u003e host-x86_64-target-arm\n - host-i686-target-i686 -\u003e host-arm-target-arm\n - i686-host-linux-gnu -\u003e arm-host-linux-gnueabi\n - i686-target-linux-gnu -\u003e arm-target-linux-gnueabi\n\n\nTroubleshooting\n===============\n\n[Emulator] data partition is small\n```bash\n# emulator -partition-size 1024\n```\n\n[Emulator] KitKat doesn’t resize data partition\nUse emulator from JellyBean\n\n[Compile] No such file or directory\nToolchain and program needs to be built with -static option\n\n[Compile] FATAL: kernel too old\nThe toolchain used to recompile needs to have a version of the kernel headers and C library that will work with this kernel.\n\nCheck kernel version:\n```bash\n127|root@generic_x86:/ cat /proc/version\nLinux version 2.6.29 (vchtchetkine@vc-irv.irv.corp.google.com) (gcc version 4.2.1) #29 PREEMPT Thu Nov 17 06:50:36 PST 2011\n```\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanod%2Fcrosstool-ng-samples","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanod%2Fcrosstool-ng-samples","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanod%2Fcrosstool-ng-samples/lists"}