Tweak optimization flags for libbsc.

Reduce max opt level on OS X to avoid crashes due to Gcc code generation quirks.
This commit is contained in:
Moinak Ghosh 2014-05-09 22:53:47 +05:30
parent a62e1aa5f7
commit 63509327e4
3 changed files with 8 additions and 4 deletions

View file

@ -311,11 +311,11 @@ $(ARCHIVEOBJS): $(ARCHIVESRCS) $(ARCHIVEHDRS)
$(COMPILE) $(GEN_OPT) $(VEC_FLAGS) $(CPPFLAGS) $(@:.o=.c) -o $@ $(COMPILE) $(GEN_OPT) $(VEC_FLAGS) $(CPPFLAGS) $(@:.o=.c) -o $@
$(PJPGOBJS): $(PJPGSRCS) $(PJPGHDRS) $(PJPGOBJS): $(PJPGSRCS) $(PJPGHDRS)
$(COMPILE_cpp) $(COMMON_VEC_FLAGS) @SSE_OPT_FLAGS@ -O2 -fsched-spec-load \ $(COMPILE_cpp) $(COMMON_VEC_FLAGS) @SSE_OPT_FLAGS@ @USE_CLANG_AS@ -O2 -fsched-spec-load \
$(VEC_FLAGS) -DBUILD_LIB $(COMMON_CPPFLAGS_cpp) $(@:.o=.cpp) -o $@ $(VEC_FLAGS) -DBUILD_LIB $(COMMON_CPPFLAGS_cpp) $(@:.o=.cpp) -o $@
$(DISPACKOBJS): $(DISPACKSRCS) $(DISPACKHDRS) $(DISPACKOBJS): $(DISPACKSRCS) $(DISPACKHDRS)
$(COMPILE_cpp) $(COMMON_VEC_FLAGS) @DEBUG_STATS_CPPFLAGS@ @SSE_OPT_FLAGS@ -O2 -fsched-spec-load \ $(COMPILE_cpp) $(COMMON_VEC_FLAGS) @DEBUG_STATS_CPPFLAGS@ @SSE_OPT_FLAGS@ @USE_CLANG_AS@ -O2 -fsched-spec-load \
-Wno-variadic-macros $(VEC_FLAGS) $(COMMON_CPPFLAGS_cpp) $(@:.o=.cpp) -o $@ -Wno-variadic-macros $(VEC_FLAGS) $(COMMON_CPPFLAGS_cpp) $(@:.o=.cpp) -o $@
$(SKEIN_BLOCK_OBJ): $(SKEIN_BLOCK_SRC) $(SKEIN_BLOCK_OBJ): $(SKEIN_BLOCK_SRC)
@ -383,7 +383,7 @@ $(PROGOBJS): $(PROGSRCS) $(PROGHDRS)
$(COMPILE) $(GEN_OPT) $(LOOP_OPTFLAGS) $(CPPFLAGS) $(@:.o=.c) -o $@ $(COMPILE) $(GEN_OPT) $(LOOP_OPTFLAGS) $(CPPFLAGS) $(@:.o=.c) -o $@
$(LIBBSCLIB): $(LIBBSCLIB):
(cd $(LIBBSCDIR); make CC=$(GPP)) (cd $(LIBBSCDIR); make CC=$(GPP) OPTFLAGS="@SSE_OPT_FLAGS@ @USE_CLANG_AS@")
$(LIB): $(OBJS) $(LIBBSCLIB) $(LIB): $(OBJS) $(LIBBSCLIB)
$(LINK.LIB) -Wl,-soname$(LIB).$(LIBVER) -o $(LIB).$(LIBVER) $(OBJS) $(LDLIBS) $(LINK.LIB) -Wl,-soname$(LIB).$(LIBVER) -o $(LIB).$(LIBVER) $(OBJS) $(LDLIBS)

View file

@ -24,7 +24,7 @@ CFLAGS = -g -Wall -fPIC
CFLAGS += -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 CFLAGS += -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
# Comment out CFLAGS line below to disable optimizations # Comment out CFLAGS line below to disable optimizations
CFLAGS += -O3 -fomit-frame-pointer -fstrict-aliasing CFLAGS += -O2 -fomit-frame-pointer -fstrict-aliasing -ftree-vectorize $(OPTFLAGS)
# Comment out CFLAGS line below to disable OpenMP optimizations # Comment out CFLAGS line below to disable OpenMP optimizations
CFLAGS += -fopenmp -DLIBBSC_OPENMP_SUPPORT CFLAGS += -fopenmp -DLIBBSC_OPENMP_SUPPORT

4
config
View file

@ -102,6 +102,8 @@ soname_opt="soname,"
rpath="-R" rpath="-R"
dtag_val=',--enable-new-dtags' dtag_val=',--enable-new-dtags'
lrt="-lrt" lrt="-lrt"
default_opt="O3"
max_opt="O3"
if [ -x /bin/echo ] if [ -x /bin/echo ]
then then
@ -388,6 +390,7 @@ then
rpath="-rpath," rpath="-rpath,"
dtag_val="" dtag_val=""
lrt="" lrt=""
max_opt="O2"
fi fi
# Detect OpenSSL library # Detect OpenSSL library
@ -718,6 +721,7 @@ s#@YASM_GAS@#${yasm_params_gas}#g
s#@RPATH@#${rpath}#g s#@RPATH@#${rpath}#g
s#@LRT@#${lrt}#g s#@LRT@#${lrt}#g
s#soname#${soname_opt}#g s#soname#${soname_opt}#g
s#${default_opt}#${max_opt}#g
s#@DTAGS@#${dtag_val}#g s#@DTAGS@#${dtag_val}#g
s#@${linkvar}@#\\\$\\(${typ}_${linkvar}\\)#g s#@${linkvar}@#\\\$\\(${typ}_${linkvar}\\)#g
s#@${compilevar}@#\\\$\\(${typ}_${compilevar}\\)#g s#@${compilevar}@#\\\$\\(${typ}_${compilevar}\\)#g