kassane / zig-mos-bootstrap

zig with llvm-mos backend
3 stars 1 forks source link
6502 6502-compiler llvm llvm-mos mos6502 zig

Zig LLVM-MOS Bootstrap

This project is a fork of zig-bootstrap, originally created by Andrew Kelley, the creator of Zig programming language. The aim of this fork, zig-mos-bootstrap, is to switch the LLVM upstream dependency over to LLVM-mos in order to add support for a new target based on mos6502 architecture.

Project Objective

The primary goal of this project is to minimize system dependencies while achieving a fully functional Zig compiler for various targets.

Acknowledgements

This project owes its existence to the invaluable contributions of several individuals and communities:

Version Information

This repository copies sources from upstream. Patches listed below. Use git to find and inspect the patch diffs.

For other versions, check the git tags of this repository.

Patches

Host System Dependencies

Build Instructions

./build <arch>-<os>-<abi> <mcpu>

All parameters are required:

Please be aware of the following two CMake environment variables that can significantly affect how long it takes to build:

When it succeeds, output can be found in out/zig-<triple>-<cpu>/.

Windows Build Instructions

Bootstrapping on Windows with MSVC is also possible via build.bat, which takes the same arguments as build above.

This script requires that the "C++ CMake tools for Windows" component be installed via the Visual Studio installer.

The script must be run within the Developer Command Prompt for VS 2019 shell:

build.bat <arch>-<os>-<abi> <mcpu>

To build for x86 Windows, run the script within the x86 Native Tools Command Prompt for VS 2019.

Supported Triples

If you try a "not tested" one and find a problem please file an issue, and a pull request linking to the issue in the table.

If you try a "not tested" one and find that it works, please file a pull request changing the status to "OK".

If you try an "OK" one and it does not work, please check if there is an existing issue, and if not, file an issue.

Note: Generally, for Linux targets, we prefer the musl libc builds over the glibc builds here, because musl builds end up producing a static binary, which is more portable across Linux distributions.

triple support status
aarch64_be-linux-gnu #90
aarch64_be-linux-musl #92
aarch64_be-windows-gnu #94
aarch64-linux-gnu OK
aarch64-linux-musl OK
aarch64-windows-gnu OK
aarch64-macos-none OK
armeb-linux-gnueabi #96
armeb-linux-gnueabihf #97
armeb-linux-musleabi #98
armeb-linux-musleabihf #99
armeb-windows-gnu #100
arm-linux-gnueabi #101
arm-linux-gnueabihf #102
arm-linux-musleabi #103
arm-linux-musleabihf OK
arm-windows-gnu #105
i386-linux-gnu not tested
i386-linux-musl OK
i386-windows-gnu OK
mips64el-linux-gnuabi64 #106
mips64el-linux-gnuabin32 #107
mips64el-linux-musl #3
mips64-linux-gnuabi64 #108
mips64-linux-gnuabin32 #109
mips64-linux-musl #110
mipsel-linux-gnu #111
mipsel-linux-musl #12
mips-linux-gnu #112
mips-linux-musl not tested
powerpc64le-linux-gnu #24
powerpc64le-linux-musl OK
powerpc64-linux-gnu #113
powerpc64-linux-musl OK
powerpc-linux-gnu #114
powerpc-linux-musl OK
riscv64-linux-gnu #115
riscv64-linux-musl OK
s390x-linux-gnu #116
s390x-linux-musl #52
sparc-linux-gnu #117
sparcv9-linux-gnu ziglang/zig#4931
x86_64-freebsd-gnu #45
x86_64-linux-gnu OK
x86_64-linux-gnux32 #20
x86_64-linux-musl OK
x86_64-windows-gnu OK
x86_64-macos-none OK
loongarch64-linux-musl #164
loongarch64-linux-gnu #166

Other Notable Targets Known to Work