{"id":13580558,"url":"https://github.com/multiarch/crossbuild","last_synced_at":"2026-01-25T06:44:54.427Z","repository":{"id":41553715,"uuid":"47969891","full_name":"multiarch/crossbuild","owner":"multiarch","description":":earth_africa: multiarch cross compiling environments","archived":false,"fork":false,"pushed_at":"2022-03-21T07:38:14.000Z","size":25820,"stargazers_count":948,"open_issues_count":29,"forks_count":145,"subscribers_count":32,"default_branch":"master","last_synced_at":"2025-01-14T12:13:45.446Z","etag":null,"topics":["build-system","build-tool","builder","cross-compiler","crossbuild","multiarch"],"latest_commit_sha":null,"homepage":null,"language":"Dockerfile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/multiarch.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-12-14T11:04:41.000Z","updated_at":"2025-01-13T09:52:12.000Z","dependencies_parsed_at":"2022-08-10T03:10:56.482Z","dependency_job_id":null,"html_url":"https://github.com/multiarch/crossbuild","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/multiarch%2Fcrossbuild","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/multiarch%2Fcrossbuild/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/multiarch%2Fcrossbuild/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/multiarch%2Fcrossbuild/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/multiarch","download_url":"https://codeload.github.com/multiarch/crossbuild/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241809620,"owners_count":20023787,"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":["build-system","build-tool","builder","cross-compiler","crossbuild","multiarch"],"created_at":"2024-08-01T15:01:53.057Z","updated_at":"2026-01-25T06:44:54.372Z","avatar_url":"https://github.com/multiarch.png","language":"Dockerfile","readme":"# crossbuild\n:earth_africa: multiarch cross compiling environments\n\n[![actions](https://github.com/multiarch/crossbuild/actions/workflows/actions.yml/badge.svg)](https://github.com/multiarch/crossbuild/actions/workflows/actions.yml)\n\n![](https://raw.githubusercontent.com/multiarch/dockerfile/master/logo.jpg)\n\nThis is a multiarch Docker build environment image.\nYou can use this image to produce binaries for multiple architectures.\n\n## Supported targets\n\nTriple                 | Aliases                             | linux | osx | windows\n-----------------------|-------------------------------------|-------|-----|--------\nx86_64-linux-gnu       | **(default)**, linux, amd64, x86_64 |   X   |     |\narm-linux-gnueabi      | arm, armv5                          |   X   |     |\narm-linux-gnueabihf    | armhf, armv7, armv7l                |   X   |     |\naarch64-linux-gnu      | arm64, aarch64                      |   X   |     |\nmipsel-linux-gnu       | mips, mipsel                        |   X   |     |\npowerpc64le-linux-gnu  | powerpc, powerpc64, powerpc64le     |   X   |     |\nx86_64-apple-darwin    | osx, osx64, darwin, darwin64        |       |  X  |\nx86_64h-apple-darwin   | osx64h, darwin64h, x86_64h          |       |  X  |\ni386-apple-darwin      | osx32, darwin32                     |       |  X  |\nx86_64-w64-mingw32     | windows, win64                      |       |     |   X\ni686-w64-mingw32       | win32                               |       |     |   X\n\n## Using crossbuild\n\n#### x86_64\n\n```console\n$ docker run --rm -v $(pwd):/workdir multiarch/crossbuild make helloworld\ncc helloworld.c -o helloworld\n$ file helloworld\nhelloworld: ELF 64-bit LSB  executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, BuildID[sha1]=9cfb3d5b46cba98c5aa99db67398afbebb270cb9, not stripped\n```\n\nMisc: using `cc` instead of `make`\n\n```console\n$ docker run --rm -v $(pwd):/workdir multiarch/crossbuild cc test/helloworld.c\n```\n\n#### arm\n\n```console\n$ docker run --rm -v $(pwd):/workdir -e CROSS_TRIPLE=arm-linux-gnueabi multiarch/crossbuild make helloworld\ncc     helloworld.c   -o helloworld\n$ file helloworld\nhelloworld: ELF 32-bit LSB  executable, ARM, EABI5 version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, BuildID[sha1]=c8667acaa127072e05ddb9f67a5e48a337c80bc9, not stripped\n```\n\n#### armhf\n\n```console\n$ docker run --rm -v $(pwd):/workdir -e CROSS_TRIPLE=arm-linux-gnueabihf multiarch/crossbuild make helloworld\ncc     helloworld.c   -o helloworld\n$ file helloworld\nhelloworld: ELF 32-bit LSB  executable, ARM, EABI5 version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, BuildID[sha1]=ad507da0b9aeb78e7b824692d4bae6b2e6084598, not stripped\n```\n\n#### powerpc 64-bit el\n\n```console\n$ docker run --rm -v $(pwd):/workdir -e CROSS_TRIPLE=powerpc64le-linux-gnu multiarch/crossbuild make helloworld\ncc     helloworld.c   -o helloworld\n$ file helloworld\nhelloworld: ELF 64-bit LSB  executable, 64-bit PowerPC or cisco 7500, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, BuildID[sha1]=035c50a8b410361d3069f77e2ec2454c70a140e8, not st\nripped\n```\n\n#### arm64\n\n```console\n$ docker run --rm -v $(pwd):/workdir -e CROSS_TRIPLE=aarch64-linux-gnu multiarch/crossbuild make helloworld\ncc     helloworld.c   -o helloworld\n$ file helloworld\nhelloworld: ELF 64-bit LSB  executable, ARM aarch64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 3.7.0, BuildID[sha1]=dce6100f0bc19504bc19987535f3cc04bd550d60, not stripped\n```\n\n#### mips el\n\n```console\n$ docker run --rm -v $(pwd):/workdir -e CROSS_TRIPLE=mipsel-linux-gnu multiarch/crossbuild make helloworld\ncc     helloworld.c   -o helloworld\n$ file helloworld\nhelloworld: ELF 32-bit LSB  executable, MIPS, MIPS-II version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, BuildID[sha1]=d6b2f608a3c1a56b8b990be66eed0c41baaf97cd, not stripped\n```\n\n#### darwin i386\n\n```console\n$ docker run -it --rm -v $(pwd):/workdir -e CROSS_TRIPLE=i386-apple-darwin  multiarch/crossbuild make helloworld\no32-clang     helloworld.c   -o helloworld\n$ file helloworld\nhelloworld: Mach-O executable i386\n```\n\n#### darwin x86_64\n\n```console\n$ docker run -it --rm -v $(pwd):/workdir -e CROSS_TRIPLE=x86_64-apple-darwin  multiarch/crossbuild make helloworld\no64-clang     helloworld.c   -o helloworld\n$ file helloworld\nhelloworld: Mach-O 64-bit executable x86_64\n```\n\n#### windows i386\n\n```console\n$ docker run -it --rm -v $(pwd):/workdir -e CROSS_TRIPLE=i686-w64-mingw32  multiarch/crossbuild make helloworld\no32-clang     helloworld.c   -o helloworld\n$ file helloworld\nhelloworld: PE32 executable (console) Intel 80386, for MS Windows\n```\n\n#### windows x86_64\n\n```console\n$ docker run -it --rm -v $(pwd):/workdir -e CROSS_TRIPLE=x86_64-w64-mingw32  multiarch/crossbuild make helloworld\no64-clang     helloworld.c   -o helloworld\n$ file helloworld\nhelloworld: PE32+ executable (console) x86-64, for MS Windows\n```\n\n## Using crossbuild in a Dockerfile\n\n```Dockerfile\nFROM multiarch/crossbuild\nRUN git clone https://github.com/bit-spark/objective-c-hello-world\nENV CROSS_TRIPLE=x86_64-apple-darwin\nWORKDIR /workdir/objective-c-hello-world\nRUN crossbuild ./compile-all.sh\n```\n\n## Projects using **crossbuild**\n\n* [scaleway/initrd](https://github.com/scaleway/initrd)\n* [multiarch/build-xnbd-client-static](https://github.com/multiarch/build-xnbd-client-static/)\n* [tencherry10/til](https://github.com/tencherry10/til)\n\n## Credit\n\nThis project is inspired by the [cross-compiler](https://github.com/steeve/cross-compiler) by the venerable [Steeve Morin](https://github.com/steeve)\n\n## Legal note\n\nOSX/Darwin/Apple builds: \n**[Please ensure you have read and understood the Xcode license\n   terms before continuing.](https://www.apple.com/legal/sla/docs/xcode.pdf)**\n\n\n## License\n\nMIT\n","funding_links":[],"categories":["Dockerfile","Dockerfile (37)"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmultiarch%2Fcrossbuild","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmultiarch%2Fcrossbuild","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmultiarch%2Fcrossbuild/lists"}