{"id":13648998,"url":"https://github.com/GregorR/musl-cross","last_synced_at":"2025-04-22T12:32:57.526Z","repository":{"id":3849032,"uuid":"4933338","full_name":"GregorR/musl-cross","owner":"GregorR","description":"A small suite of scripts and patches for building musl libc cross compilers.","archived":false,"fork":false,"pushed_at":"2024-12-03T14:51:13.000Z","size":367,"stargazers_count":211,"open_issues_count":12,"forks_count":69,"subscribers_count":27,"default_branch":"master","last_synced_at":"2024-12-03T15:43:06.363Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Shell","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/GregorR.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":"2012-07-07T02:05:23.000Z","updated_at":"2024-12-03T14:56:43.000Z","dependencies_parsed_at":"2022-08-09T11:08:34.327Z","dependency_job_id":null,"html_url":"https://github.com/GregorR/musl-cross","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GregorR%2Fmusl-cross","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GregorR%2Fmusl-cross/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GregorR%2Fmusl-cross/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GregorR%2Fmusl-cross/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GregorR","download_url":"https://codeload.github.com/GregorR/musl-cross/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250241050,"owners_count":21397922,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":"2024-08-02T01:04:41.777Z","updated_at":"2025-04-22T12:32:57.171Z","avatar_url":"https://github.com/GregorR.png","language":"Shell","funding_links":[],"categories":["Shell","Active","Uncategorized"],"sub_categories":["Uncategorized"],"readme":"About musl-cross\n================\n\nThis is a small suite of scripts and patches to build a musl libc\ncross-compiler. \u003cstrike\u003ePrebuilt cross and native compilers are available at\nhttp://musl.codu.org/\u003c/strike\u003e\n\nFor the impatient, `./build.sh` should build a cross compiler to\n`/opt/cross/\u003carch\u003e-linux-musl`, no muss, no fuss. Otherwise, you can edit\nconfig.sh to make cross-compilers to other architectures, and even copy\nconfig.sh to another directory then run `build.sh` from there to avoid polluting\nthe source dir.\n\nProject Scope\n=============\nSupported are GCC 4.0.3 until 5.3.0.\nfor newer GCCs check out the [musl-cross-make project][0].\n\nNotes on building normal cross compilers\n========================================\n\n* For ARM, you must set the triple to `arm-linux-musleabi` (`eabi` is the important\n  bit here)\n\n* You can set versions of binutils, GCC or musl in `config.sh` with:\n\n        BINUTILS_VERSION=\u003cversion\u003e\n        GCC_VERSION=\u003cversion\u003e\n        MUSL_VERSION=\u003cversion\u003e\n\n* You can set configure flags for each step:\n\n        BINUTILS_CONFFLAGS=...\n        GCC_BOOTSTRAP_CONFFLAGS=...\n        MUSL_CONFFLAGS=...\n        GCC_CONFFLAGS=...\n\n* You can use a git checkout of musl with:\n\n        MUSL_VERSION=\u003cgit tag or commit\u003e\n        MUSL_GIT=yes\n\n* If you do not have the GMP, MPFR and/or MPC development libraries on your\n  host, you can build them along with GCC with a config.sh line:\n\n        GCC_BUILTIN_PREREQS=yes\n\n\nRecommendations\n===============\n\n* If you would like to target a specific CPU revision, usually this is done by\n  GCC configuration options like so:\n\n        GCC_BOOTSTRAP_CONFFLAGS=\"--with-cpu=armv4t\"\n        GCC_CONFFLAGS=\"--with-cpu=armv4t\"\n\n  For ix86 however, it is more common to do this by the target name, e.g.\n  `i486-linux-musl` instead of `i686-linux-musl`.\n\n\nUpgrading cross compilers\n=========================\n\nIt is possible to upgrade the musl version in a musl-cross cross compiler\nwithout rebuilding the entire cross compiler prefix from scratch. Simply\ndownload and extract the new version of musl, then configure it like so:\n\n    ./configure --prefix=\"\u003cprefix\u003e/\u003ctriple\u003e\" CC=\"\u003ctriple\u003e-gcc\"\n\nWhere `\u003cprefix\u003e` is the prefix the cross compiler root was installed/extracted\nto, and `\u003ctriple\u003e` is the GNU-style target triple (e.g. `i486-linux-musl`).\n\n\nOther scripts and helpers\n=========================\n\n* `config.sh` is an example configuration file. In many cases, it will do exactly\n  what you want it to do with no modification, which is why it's simply named\n  `config.sh` instead of, e.g., `config-sample.sh`\n\n* `extra/build-gcc-deps.sh` will build the dependencies for GCC into the build\n  prefix specified by `config.sh`, which are just\n  often a nice thing to have. It is of course not necessary.\n\n* `extra/build-tarballs.sh` builds convenient musl cross-compiler tarballs in a\n  rather inconvenient way. It first builds a musl cross-compiler to the host\n  platform (e.g. `i686`), then it uses that to build static cross-compilers to\n  various platforms. As a result, building e.g. three cross-compiler tarballs\n  involves eight compiler build phases (read: this is slow). However, the\n  resultant tarballs are cross-compilers statically linked against musl, making\n  them stable and portable.\n\n* `config-static.sh` is an example configuration file for building a static\n  cross-compiler. You can use this if, e.g., you already have a build of musl\n  (and so have `musl-gcc`) but would like to make a complete, static\n  cross-compiler based on that, or if you already have a musl cross-compiler\n  (and so have `\u003carch\u003e-linux-musl-gcc`) but would like to make a static\n  cross-compiler itself compiled against musl.\n\n\nRequirements\n============\n\nmusl-cross depends on:\n\n* shell and coreutils (busybox is fine)\n* mercurial or git (for checkout only)\n* wget (busybox is fine)\n* patch\n* gcc\n* make\n* awk (busybox is fine)\n\nThe following are GCC dependencies, which can be installed on the host system,\nor installed automatically using `GCC_BUILTIN_PREREQS=yes`:\n\n* gmp\n* mpfr\n* mpc\n\nBuilding GMP additionally requires `m4`.\n\n\nCompiler/Arch Compatibility Matrix\n==================================\n|       | i?86 | x86_64 | x32 | mips | powerpc | arm7 | armhf | mb  | sh4 | or1k|\n|:------|:-----|:-------|:----|:-----|:--------|:-----|:------|:----|:----|:---:|\n| 4.4.7 | yes  | yes    |     | yes  | yes     | yes  |       |     |     |     |\n| 4.5.4 | yes  | yes    |     | yes  | yes     | yes  |       |     |     |     |\n| 4.6.4 | yes  | yes    |     | yes  | yes     | yes  |       |     |     |     |\n| 4.7.4 | yes  | yes    |     | yes  | yes     | yes  | yes   |     | yes |     |\n| 4.8.5 | yes  | yes    | yes | yes  | yes     | yes  | yes   | yes | yes |     |\n| 4.9.3 | yes  | yes    | yes | yes  | yes     | yes  | yes   | yes | yes |     |\n| 5.3.0 | yes  | yes    | yes | yes  | yes     | yes  | yes   | yes | yes | *   |\n\n`*` or1k requires integration of a patch (issue #61)\n\n[0]:https://github.com/richfelker/musl-cross-make\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FGregorR%2Fmusl-cross","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FGregorR%2Fmusl-cross","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FGregorR%2Fmusl-cross/lists"}