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-01
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/Make.inc
+++ b/Make.inc
@@ -270,7 +270,7 @@ JCFLAGS = -std=gnu99 -pipe $(fPIC) -fno-
 JCPPFLAGS =
 JCXXFLAGS = -pipe $(fPIC) -fno-rtti
 DEBUGFLAGS = -O0 -ggdb3 -DJL_DEBUG_BUILD -fstack-protector-all
-SHIPFLAGS = -O3 -ggdb3 -falign-functions
+SHIPFLAGS = -ggdb3 -falign-functions
 endif
 
 ifeq ($(USECLANG),1)
--- a/deps/Rmath/Make.inc
+++ b/deps/Rmath/Make.inc
@@ -4,12 +4,11 @@ OS = $(shell uname)
 ARCH = $(shell uname -m)
 
 FC = gfortran
-FFLAGS-add += -O3
 
 USEGCC = 1
 USECLANG = 0
 
-CFLAGS-add += -Wall -O3
+CFLAGS-add += -Wall
 
 ifeq ($(USECLANG),1)
 USEGCC = 0
--- a/deps/Makefile
+++ b/deps/Makefile
@@ -545,7 +545,7 @@ install-pcre: $(PCRE_OBJ_TARGET)
 
 ## Grisu floating-point printing library ##
 
-GRISU_OPTS = $(CXXFLAGS) -O3 -fvisibility=hidden $(fPIC)
+GRISU_OPTS = $(CXXFLAGS) -fvisibility=hidden $(fPIC)
 GRISU_OBJ_TARGET = $(build_shlibdir)/libgrisu.$(SHLIB_EXT)
 
 double-conversion-$(GRISU_VER).tar.gz:
@@ -1386,7 +1386,7 @@ $(build_shlibdir)/libsuitesparse_wrapper
 endif
 
 $(build_shlibdir)/libsuitesparse_wrapper.$(SHLIB_EXT): SuiteSparse_wrapper.c
-	$(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
@@ -53,7 +53,7 @@ HEADERS = julia.h julia_internal.h optio
 %.do: %.c $(HEADERS)
 	@$(call PRINT_CC, $(CC) $(CPPFLAGS) $(CFLAGS) $(DEBUGFLAGS) -c $< -o $@)
 %.o: %.cpp $(HEADERS)
-	@$(call PRINT_CC, $(CXX) $(call exec,$(LLVM_CONFIG) --cxxflags) $(CPPFLAGS) $(CXXFLAGS) $(SHIPFLAGS) -c $< -o $@)
+	@$(call PRINT_CC, $(CXX) $(call exec,$(LLVM_CONFIG) --cxxflags | sed 's/^/ /;s/$$/ /;s/\s-O.\s/ /') $(CPPFLAGS) $(CXXFLAGS) $(SHIPFLAGS) -c $< -o $@)
 %.do: %.cpp $(HEADERS)
 	@$(call PRINT_CC, $(CXX) $(call exec,$(LLVM_CONFIG) --cxxflags) $(CPPFLAGS) $(CXXFLAGS) $(DEBUGFLAGS) -c $< -o $@)
 
