build: Use -O0 on Darwin. Seems that Darwin's GCC optimizations break rustrt.

This commit is contained in:
Patrick Walton 2011-04-07 18:14:13 -07:00
parent afa6d85d61
commit ed14ea1d3f
1 changed files with 7 additions and 5 deletions

View File

@ -11,7 +11,7 @@ endif
CFG_INFO := $(info cfg: building on $(CFG_OSTYPE) $(CFG_CPUTYPE))
CFG_GCC_CFLAGS := -O2 -fno-strict-aliasing
CFG_GCC_CFLAGS := -fno-strict-aliasing
CFG_GCC_LINK_FLAGS :=
CFG_BOOT_FLAGS := $(BOOT_FLAGS)
CFG_RUSTC_FLAGS := -nowarn -O
@ -23,7 +23,7 @@ CFG_DSYMUTIL := true
ifeq ($(CFG_OSTYPE), FreeBSD)
CFG_LIB_NAME=lib$(1).so
CFG_GCC_CFLAGS += -fPIC -march=i686 -I/usr/local/include
CFG_GCC_CFLAGS += -fPIC -march=i686 -I/usr/local/include -O2
CFG_GCC_LINK_FLAGS += -shared -fPIC -lpthread -lrt
ifeq ($(CFG_CPUTYPE), x86_64)
CFG_GCC_CFLAGS += -m32
@ -36,7 +36,7 @@ endif
ifeq ($(CFG_OSTYPE), Linux)
CFG_LIB_NAME=lib$(1).so
CFG_GCC_CFLAGS += -fPIC -march=i686
CFG_GCC_CFLAGS += -fPIC -march=i686 -O2
CFG_GCC_LINK_FLAGS += -shared -fPIC -ldl -lpthread -lrt
CFG_GCC_DEF_FLAG := -Wl,-whole-archive,--export-dynamic,--dynamic-list=
CFG_GCC_POST_LIB_FLAGS := -Wl,-no-whole-archive
@ -59,7 +59,9 @@ ifeq ($(CFG_OSTYPE), Darwin)
# "on an i386" when the whole userspace is 64-bit and the compiler
# emits 64-bit binaries by default. So we just force -m32 here. Smarter
# approaches welcome!
CFG_GCC_CFLAGS += -m32
#
# NB: Currently GCC's optimizer breaks rustrt (task-comm-1 hangs) on Darwin.
CFG_GCC_CFLAGS += -m32 -O0
CFG_GCC_LINK_FLAGS += -m32
CFG_DSYMUTIL := dsymutil
CFG_DEF_SUFFIX := .darwin.def
@ -90,7 +92,7 @@ ifdef CFG_WINDOWSY
ifdef CFG_FLEXLINK
CFG_BOOT_NATIVE := 1
endif
CFG_GCC_CFLAGS += -march=i686
CFG_GCC_CFLAGS += -march=i686 -O2
CFG_GCC_LINK_FLAGS += -shared -fPIC
CFG_DEF_SUFFIX := .def
endif