Skip to content

Commit

Permalink
Windows gcc-4.4.0 -O is broken.
Browse files Browse the repository at this point in the history
Remove optimizations for mingw-gcc-4.4.0
  • Loading branch information
dgud authored and tonyrog committed Sep 22, 2010
1 parent eec2697 commit b8c6a92
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions c_src/Makefile
Expand Up @@ -34,28 +34,28 @@ endif
ifeq ($(TYPE), release)
OBJDIR=../obj/release
LIBDIR=../lib/release
CFLAGS += -O3 -Wall -Wextra -Wswitch-default -Wswitch-enum -D_THREAD_SAFE -D_REENTRANT -fno-common
CFLAGS += -Wall -Wextra -Wswitch-default -Wswitch-enum -D_THREAD_SAFE -D_REENTRANT -fno-common
endif

ifeq ($(OSNAME), Linux)
LINUX = Yes
ifeq ($(WORDSIZE), 32)
CFLAGS += -fPIC -m32 -DWORDSIZE=32
CFLAGS += -O3 -fPIC -m32 -DWORDSIZE=32
endif
ifeq ($(WORDSIZE), 64)
CFLAGS += -fPIC -m64 -DWORDSIZE=64
CFLAGS += -O3 -fPIC -m64 -DWORDSIZE=64
endif
LD_SHARED := $(CC) -shared -lOpenCL
endif

ifeq ($(OSNAME), Darwin)
MAC_OS_X = Yes
ifeq ($(WORDSIZE), 32)
CFLAGS += -fPIC -m32 -DWORDSIZE=32 -DDARWIN -no-cpp-precomp
CFLAGS += -O3 -fPIC -m32 -DWORDSIZE=32 -DDARWIN -no-cpp-precomp
LD_SHARED := $(CC) -m32 -bundle -flat_namespace -undefined suppress
endif
ifeq ($(WORDSIZE), 64)
CFLAGS += -fPIC -m64 -DWORDSIZE=64 -DDARWIN -no-cpp-precomp
CFLAGS += -O3 -fPIC -m64 -DWORDSIZE=64 -DDARWIN -no-cpp-precomp
LD_SHARED := $(CC) -m64 -bundle -flat_namespace -undefined suppress
endif
endif
Expand All @@ -77,6 +77,13 @@ endif
ifeq ($(WORDSIZE), 64)
CFLAGS += -shared -I/opt/local/include -m64 -DWIN32 -DWORDSIZE=64
endif

## Optimizations is broken on mingw 4.4.0 (it crashes with it on)
GCC_VERSION = $(shell gcc -dumpversion)
ifneq ($(GCC_VERSION), 4.4.0)
CFLAGS += -O3
endif

LD_SHARED := $(CC) -shared
endif

Expand Down

0 comments on commit b8c6a92

Please sign in to comment.