From 5e7deadb65d6da3b503bc62e5d4729fda4323457 Mon Sep 17 00:00:00 2001 From: Imbus <> Date: Sun, 23 Jun 2024 14:44:19 +0200 Subject: [PATCH 1/2] Cleaning generated assembly --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index fe3f943..727e859 100644 --- a/Makefile +++ b/Makefile @@ -21,11 +21,11 @@ all: $(OBJECTS) @$(CC) $(CFLAGS) -S -masm=intel $< clean: - rm -f $(OBJECTS) + rm -f $(OBJECTS) $(ASMS) asm: $(ASMS) format: clang-format -i $(C_SOURCES) $(C_HEADERS) -.PHONY: all clean format asm \ No newline at end of file +.PHONY: all clean format asm From e24b2f7904f67e9d7ebde822fc3b2c686f9d0128 Mon Sep 17 00:00:00 2001 From: Imbus <> Date: Sun, 23 Jun 2024 15:06:21 +0200 Subject: [PATCH 2/2] Bunch of options to make the machine code slick --- Makefile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Makefile b/Makefile index 727e859..e117a77 100644 --- a/Makefile +++ b/Makefile @@ -4,6 +4,10 @@ CC = gcc CFLAGS = -Wall -Wextra -Werror -Wno-unused-parameter CFLAGS += -Wno-unused-variable -Wno-unused-function CFLAGS += -Wno-unused-but-set-variable -Wno-unused-value -Wno-unused-label +CFLAGS += -Wno-unused-result -Wno-unused-const-variable +CFLAGS += -fno-exceptions -fno-asynchronous-unwind-tables -fno-ident +CFLAGS += -fno-unwind-tables -fno-stack-protector -fno-plt -fno-pic +CFLAGS += -O3 -std=c99 -march=native -mtune=native -fomit-frame-pointer C_SOURCES = $(wildcard *.c) C_HEADERS = $(wildcard *.h) @@ -19,6 +23,7 @@ all: $(OBJECTS) %.s: %.c $(C_HEADERS) @echo "CC $<" @$(CC) $(CFLAGS) -S -masm=intel $< + wc -l $@ clean: rm -f $(OBJECTS) $(ASMS)