Description: Remove hardcoded GCC optimization flags
 This is necessary in order to make DEB_BUILD_OPTIONS=noopt work as expected.
 .
 Note that the hack on llvm-config --cxxflags is not absolutely needed, because
 the -O2 that it brings come before the -O0 brought by dpkg-buildflags. But I
 leave it for clarity.
Author: Sébastien Villemot <sebastien@debian.org>
Forwarded: not-needed
Last-Update: 2015-11-17
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
---
 Make.inc            |    2 +-
 deps/suitesparse.mk |    2 +-
 src/Makefile        |    2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

--- a/Make.inc
+++ b/Make.inc
@@ -502,7 +502,7 @@ ifneq ($(OS), WINNT)
 JCXXFLAGS += -pedantic
 endif
 DEBUGFLAGS := -O0 -ggdb2 -DJL_DEBUG_BUILD -fstack-protector-all
-SHIPFLAGS := -O3 -ggdb2 -falign-functions
+SHIPFLAGS := -ggdb2 -falign-functions
 endif
 
 ifeq ($(USECLANG),1)
--- a/deps/suitesparse.mk
+++ b/deps/suitesparse.mk
@@ -119,7 +119,7 @@ endif
 
 $(build_shlibdir)/libsuitesparse_wrapper.$(SHLIB_EXT): $(SRCDIR)/SuiteSparse_wrapper.c
 	mkdir -p $(build_shlibdir)
-	$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -O2 -shared $(fPIC) $(SUITESPARSE_INC) $< -o $@ $(SUITESPARSE_LIB)
+	$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -shared $(fPIC) $(SUITESPARSE_INC) $< -o $@ $(SUITESPARSE_LIB)
 	$(INSTALL_NAME_CMD)libsuitesparse_wrapper.$(SHLIB_EXT) $@
 	touch -c $@
 
--- a/src/Makefile
+++ b/src/Makefile
@@ -96,7 +96,7 @@ endif
 PUBLIC_HEADER_TARGETS := $(addprefix $(build_includedir)/julia/,$(notdir $(PUBLIC_HEADERS)) $(UV_HEADERS))
 
 LLVM_LDFLAGS := $(shell $(LLVM_CONFIG_HOST) --ldflags)
-LLVM_CXXFLAGS := $(shell $(LLVM_CONFIG_HOST) --cxxflags)
+LLVM_CXXFLAGS := $(shell $(LLVM_CONFIG_HOST) --cxxflags | sed 's/^/ /;s/$$/ /;s/\s-O.\s/ /')
 
 ifeq ($(JULIACODEGEN),LLVM)
 ifneq ($(USE_SYSTEM_LLVM),0)
