All Projects → crazy-max → Xgo

crazy-max / Xgo

Licence: mit
Go CGO cross compiler

Programming Languages

go
31211 projects - #10 most used programming language
golang
3204 projects
cgo
20 projects

Projects that are alternatives of or similar to Xgo

xx
Dockerfile cross-compilation helpers
Stars: ✭ 124 (+244.44%)
Mutual labels:  cross-compiler
Microdot
The Microdot Project guides you to create a fully functional but compact Linux system from scratch
Stars: ✭ 41 (+13.89%)
Mutual labels:  cross-compiler
Zipcpu
A small, light weight, RISC CPU soft core
Stars: ✭ 640 (+1677.78%)
Mutual labels:  cross-compiler
xForth
Experimental Forth cross compiler for tiny devices
Stars: ✭ 53 (+47.22%)
Mutual labels:  cross-compiler
homebrew-i386-elf-toolchain
Homebrew formulas for buildling a valid GCC toolchain for the i386-elf target.
Stars: ✭ 62 (+72.22%)
Mutual labels:  cross-compiler
Raspberry Pi Cross Compilers
Latest GCC Cross Compiler & Native (ARM & ARM64) CI generated precompiled standalone toolchains for all Raspberry Pis. 🍇
Stars: ✭ 261 (+625%)
Mutual labels:  cross-compiler
CAMEL99-V2
Indirect threaded code version of CAMEL99 Forth for TI-99 computer
Stars: ✭ 16 (-55.56%)
Mutual labels:  cross-compiler
Beelzebub
The Lord of Flies - A hobby operating system
Stars: ✭ 24 (-33.33%)
Mutual labels:  cross-compiler
docker-qt
C++ Qt compile environment for Docker (Dynamically Linked, Statically Linked, and Cross-compiled to Windows)
Stars: ✭ 52 (+44.44%)
Mutual labels:  cross-compiler
Crossbuild
🌍 multiarch cross compiling environments
Stars: ✭ 632 (+1655.56%)
Mutual labels:  cross-compiler
rust-crosscompiler-arm
Docker images for Rust dedicated to cross compilation for ARM v6 and more
Stars: ✭ 48 (+33.33%)
Mutual labels:  cross-compiler
how-to-qemu-arm-gdb-gtest
How to run, debug, and unit test ARM code on X86 ubuntu
Stars: ✭ 19 (-47.22%)
Mutual labels:  cross-compiler
Shecc
A self-hosting and educational C compiler
Stars: ✭ 286 (+694.44%)
Mutual labels:  cross-compiler
alpine
🌍 `alpine` Docker image for multiple architectures
Stars: ✭ 81 (+125%)
Mutual labels:  cross-compiler
Musl Cross Make
Simple makefile-based build for musl cross compiler
Stars: ✭ 646 (+1694.44%)
Mutual labels:  cross-compiler
ewxb-gcc-cross-compiler-builder
A script for building a full GCC + glibc toolchain from scratch (with Go support via gccgo) in multiple stages.
Stars: ✭ 18 (-50%)
Mutual labels:  cross-compiler
diy-linux-guide
An LFS like guide for cross-bootstrapping a small system for the Raspberry Pi
Stars: ✭ 26 (-27.78%)
Mutual labels:  cross-compiler
Mxe
MXE (M cross environment)
Stars: ✭ 858 (+2283.33%)
Mutual labels:  cross-compiler
Linux Lab
Docker/Qemu Based Linux Kernel Learning, Development and Testing Environment; New Linux ELF Video Course from this project author: https://www.cctalk.com/m/group/88089283
Stars: ✭ 771 (+2041.67%)
Mutual labels:  cross-compiler
Hlsl2glslfork
HLSL to GLSL language translator based on ATI's HLSL2GLSL. Used in Unity.
Stars: ✭ 488 (+1255.56%)
Mutual labels:  cross-compiler

GitHub release Total downloads Build Status Test Status Docker Stars Docker Pulls Go Report Card

Become a sponsor Donate Paypal


About

Although Go strives to be a cross platform language, cross compilation from one platform to another is not as simple as it could be, as you need the Go sources bootstrapped to each platform and architecture.

The first step towards cross compiling was Dave Cheney's golang-crosscompile package, which automatically bootstrapped the necessary sources based on your existing Go installation. Although this was enough for a lot of cases, certain drawbacks became apparent where the official libraries used CGO internally: any dependency to third party platform code is unavailable, hence those parts don't cross compile nicely (native DNS resolution, system certificate access, etc).

A step forward in enabling cross compilation was Alan Shreve's gonative package, which instead of bootstrapping the different platforms based on the existing Go installation, downloaded the official pre-compiled binaries from the golang website and injected those into the local toolchain. Since the pre-built binaries already contained the necessary platform specific code, the few missing dependencies were resolved, and true cross compilation could commence... of pure Go code.

However, there was still one feature missing: cross compiling Go code that used CGO itself, which isn't trivial since you need access to OS specific headers and libraries. This becomes very annoying when you need access only to some trivial OS specific functionality (e.g. query the CPU load), but need to configure and maintain separate build environments to do it.

Fork

This repository is a fork of karalabe/xgo to push images and tags to a single docker repository on several registries to make things more consistent for users:

Registry Image
Docker Hub crazymax/xgo
GitHub Container Registry ghcr.io/crazy-max/xgo

I use GitHub Actions to build the images instead of using automated builds of Docker Hub (see workflows).

This also creates a standalone xgo executable that can be used on many platforms.

Build

Build xgo yourself using Docker buildx bake:

git clone https://github.com/crazy-max/xgo.git xgo
cd xgo

# Build base image and output to docker with xgo:base tag
docker buildx bake base-local

# Build go-1.16 image and output to docker with xgo:1.16 tag
BASE_IMAGE=xgo:base docker buildx bake --set "*.tags=xgo:1.16" --set "*.output=type=docker" go-1.16

# Tests
BASE_IMAGE=xgo:1.16 docker buildx bake test-c
BASE_IMAGE=xgo:1.16 docker buildx bake test-cpp
BASE_IMAGE=xgo:1.16 docker buildx bake test-gorm

# Create xgo artifacts in ./dist
docker buildx bake artifact-all

Documentation

How can I help?

All kinds of contributions are welcome 🙌! The most basic way to show your support is to star 🌟 the project, or to raise issues 💬 You can also support this project by becoming a sponsor on GitHub 👏 or by making a Paypal donation to ensure this journey continues indefinitely! 🚀

Thanks again for your support, it is much appreciated! 🙏

License

MIT. See LICENSE for more details.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].