The Day 1 exercise now works. It did compile yesterday, but didn't link.

I installed the package `gcc-multilib` to fix this.
This commit is contained in:
Simon Brooke 2026-04-06 15:06:50 +01:00
parent 643d255a21
commit 74b47f4380

View file

@ -3,10 +3,15 @@
* *
* Grendel: a compiling Beowulf reimplementation. * Grendel: a compiling Beowulf reimplementation.
* *
* Day 1 of work towards a compiler... eventually.. * Day 1 of work towards a compiler... eventually...
* *
* This is a straight copy of Noah Zentzis' work. There's no original work of * This is a straight copy of Noah Zentzis' work. There's no original work of
* mine here, yet * mine here, yet.
*
* See: https://generalproblem.net/lets_build_a_compiler/01-starting-out/
*
* I needed to install (on Debian) the package `gcc-multilib` to get this to
* link.
* *
* (c) 2026 Simon Brooke <simon@journeyman.cc> * (c) 2026 Simon Brooke <simon@journeyman.cc>
* Licensed under GPL version 2.0, or, at your option, any later version. * Licensed under GPL version 2.0, or, at your option, any later version.
@ -16,6 +21,12 @@
#include <stdint.h> #include <stdint.h>
#include <string.h> #include <string.h>
/*
* "The `__attribute__((__cdecl__))` part is a GCC-specific syntax extension
* that tells the compiler to use the
* "[cdecl](https://en.wikipedia.org/wiki/X86_calling_conventions#cdecl)"
* calling convention when executing the function."
*/
__attribute__((__cdecl__)) __attribute__((__cdecl__))
extern int lisp_entry(); extern int lisp_entry();