"zig cc" Cross-Compiler: Difference between revisions
[unchecked revision] | [unchecked revision] |
Content deleted Content added
No edit summary |
m Bot: Replace deprecated source tag with syntaxhighlight |
||
(4 intermediate revisions by 2 users not shown) | |||
Line 6:
* [https://ziglang.org/download/ Zig] (tested with version 0.6.0)
*
* [[NASM]]
Start off with the standard [[Bare Bones]] setup, but use the <kbd>boot.asm</kbd> file provided in [[Bare Bones with NASM]] instructions (since Zig does not come with an assembler, just a C compiler). At that point, you can continue with [[Bare Bones]], but instead of using <kbd>i686-elf-gcc</kbd>, use the following command to build <kbd>kernel.c</kbd>:
<
This should create a <kbd>kernel.o</kbd> file, just the same as if you had used gcc.
Line 17:
When you get to the linking step, we won't be able to use <kbd>i686-elf-gcc</kbd>, but luckily, modern versions of [[LD|GNU <kbd>ld</kbd>]] are able to emulate almost any other linker, so we can use the system <kbd>ld</kbd> like so:
<
And at that point, you can carry on with [[Bare Bones]], and you should have an operating system, compiled without having to compile your own cross-compiler!
[[Category:Compilers]]
[[Category:Zig]]
|