From 32cd070c969ffd0b405460ef75f6fa095ed9657e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Milutin=20Jovanovi=C4=87?= Date: Sun, 10 Jun 2012 20:58:48 -0400 Subject: [PATCH] osx: Removed some optimizations for x86 builds as they were causing seg faults. When using gcc compiler (as opposed to llvm) to build 32 bit tcc, compiler flags -mpreferred-stack-boundary=2, -march=i386 and -falign-functions=2 were being used. -march is redundant as -m32 is already being used. The other two seem to be corrupting stack. I am not sure why this is the case, as the explanation of the flags states that only running code size should be affected, but it does. I think that is is safe to remove these flags altogether for all compilers and platforms, especially since they are not being used for 64 bit builds. However I do not want to apply such wide change without agreement from the people on the mailing list. --- .gitignore | 1 + Makefile | 2 ++ 2 files changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index 8d0588f7..bfcf93a1 100644 --- a/.gitignore +++ b/.gitignore @@ -42,6 +42,7 @@ tags .DS_Store *.swp lib/x86_64 +lib/i386 tcc-doc.info conftest* tiny_libmaker diff --git a/Makefile b/Makefile index 10e1cd4c..3b6acdd8 100644 --- a/Makefile +++ b/Makefile @@ -15,6 +15,7 @@ CFLAGS+=-Wno-pointer-sign -Wno-sign-compare -D_FORTIFY_SOURCE=0 endif endif +ifneq ($(TARGETOS),Darwin) ifeq ($(ARCH),i386) CFLAGS+=-mpreferred-stack-boundary=2 ifeq ($(GCC_MAJOR),2) @@ -23,6 +24,7 @@ else CFLAGS+=-march=i386 -falign-functions=0 endif endif +endif ifdef CONFIG_WIN64 CONFIG_WIN32=yes -- 2.11.4.GIT