From b20795b9411dde987dff59eb6e47bdc86cba14b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Lov=C3=A9n?= Date: Tue, 1 Nov 2016 14:19:02 +0100 Subject: [PATCH] Update old post about using C headers in ASM --- pages/2012-06-18-C-Headers-In-Asm.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/pages/2012-06-18-C-Headers-In-Asm.md b/pages/2012-06-18-C-Headers-In-Asm.md index 5ad0ff0..192e917 100644 --- a/pages/2012-06-18-C-Headers-In-Asm.md +++ b/pages/2012-06-18-C-Headers-In-Asm.md @@ -3,6 +3,18 @@ title: "C headers in Asm" subtitle: "Cleaning up the build chain" tags: [osdev] +> **NOTE (2016-11-01)** +> +> Since people are apparently still finding this page four years later (yay! Cool URLs don't change!): I've since found a better and more correct way of doing this. +> +> If you're compiling using `gcc`, you can just name your assembly files (with includes and macros and stuff) `whatever.S` (capital S), and compile them right down to `whatever.o` as you normally would (using `gcc`, not `as`). +> +> GNU make also has a builtin rule that does this automatically... yeah... +> +> From this I've learned the following +> - Trust make. It's terribly powerful if you trust it to be. +> - GCC is not the GNU C Compiler. It's the GNU Compiler Collection. + Something that always annoyed me is how hard it is to synchronize constants between assembly and c code. In assembler, you define a constant value as