From bc28a2bc4c9560cb25baa985707ce661dea5d1e5 Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Tue, 11 Mar 2008 19:32:38 -0400 Subject: [PATCH] Force functions marked as inline to always be inlined. Inline alters stack usage, so don't let gcc uninline. Also, gcc seems to include multiple copies of uninlined functions when using -combine. With inlining forced on, the no null check optimization causes problems, so disable it. --- Makefile | 3 ++- src/types.h | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 6938bef..7415f6a 100644 --- a/Makefile +++ b/Makefile @@ -18,7 +18,8 @@ cc-option = $(shell if test -z "`$(1) $(2) -S -o /dev/null -xc \ # Default compiler flags COMMONCFLAGS = -Wall -Os -MD -m32 -march=i386 -mregparm=2 \ - -ffreestanding -fwhole-program -fomit-frame-pointer + -ffreestanding -fwhole-program -fomit-frame-pointer \ + -fno-delete-null-pointer-checks COMMONCFLAGS += $(call cc-option,$(CC),-nopie,) COMMONCFLAGS += $(call cc-option,$(CC),-fno-stack-protector,) COMMONCFLAGS += $(call cc-option,$(CC),-fno-stack-protector-all,) diff --git a/src/types.h b/src/types.h index b1bf2ef..0a7e2f7 100644 --- a/src/types.h +++ b/src/types.h @@ -34,6 +34,8 @@ typedef u32 size_t; #define barrier() __asm__ __volatile__("": : :"memory") +#define inline inline __attribute__((always_inline)) + #define __stringify_1(x) #x #define __stringify(x) __stringify_1(x) -- 2.39.5