1
0
Fork 0
mirror of https://github.com/sockspls/badfish synced 2025-04-30 08:43:09 +00:00

Disable flto when debugging

Link-time optimization does not work well with
generation of debugging information:

http://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html

Reported by Louis Zulli

No functional change.
This commit is contained in:
Marco Costalba 2013-07-03 08:21:21 +02:00
parent 12c0dfc113
commit ddcb572c41

View file

@ -231,7 +231,7 @@ ifeq ($(COMP),clang)
endif endif
### 3.2 General compiler settings ### 3.2 General compiler settings
CXXFLAGS = -g -Wall -Wcast-qual -fno-exceptions -fno-rtti $(EXTRACXXFLAGS) CXXFLAGS = -Wall -Wcast-qual -fno-exceptions -fno-rtti $(EXTRACXXFLAGS)
ifeq ($(comp),gcc) ifeq ($(comp),gcc)
CXXFLAGS += -ansi -pedantic -Wno-long-long -Wextra -Wshadow CXXFLAGS += -ansi -pedantic -Wno-long-long -Wextra -Wshadow
@ -275,6 +275,8 @@ endif
### 3.4 Debugging ### 3.4 Debugging
ifeq ($(debug),no) ifeq ($(debug),no)
CXXFLAGS += -DNDEBUG CXXFLAGS += -DNDEBUG
else
CXXFLAGS += -g
endif endif
### 3.5 Optimization ### 3.5 Optimization
@ -354,6 +356,7 @@ endif
### needs access to the optimization flags. ### needs access to the optimization flags.
ifeq ($(comp),gcc) ifeq ($(comp),gcc)
ifeq ($(optimize),yes) ifeq ($(optimize),yes)
ifeq ($(debug),no)
GCC_MAJOR := `$(CXX) -dumpversion | cut -f1 -d.` GCC_MAJOR := `$(CXX) -dumpversion | cut -f1 -d.`
GCC_MINOR := `$(CXX) -dumpversion | cut -f2 -d.` GCC_MINOR := `$(CXX) -dumpversion | cut -f2 -d.`
ifeq (1,$(shell expr \( $(GCC_MAJOR) \> 4 \) \| \( $(GCC_MAJOR) \= 4 \& $(GCC_MINOR) \>= 5 \))) ifeq (1,$(shell expr \( $(GCC_MAJOR) \> 4 \) \| \( $(GCC_MAJOR) \= 4 \& $(GCC_MINOR) \>= 5 \)))
@ -361,6 +364,7 @@ ifeq ($(comp),gcc)
LDFLAGS += $(CXXFLAGS) LDFLAGS += $(CXXFLAGS)
endif endif
endif endif
endif
endif endif
### ========================================================================== ### ==========================================================================