Moved the LTO etc. flags from CXXFLAGS_STD to CXXFLAGS

This commit is contained in:
Simon John 2017-09-02 15:32:52 +01:00
parent 5fcd04cdef
commit fa82c3a9db
3 changed files with 16 additions and 11 deletions

View file

@ -1045,7 +1045,7 @@ endif
ifndef CFLAGS_STD
ifeq ($(shell expr $(CC_VERNUM) '>' 490), 1)
CFLAGS_STD = -std=gnu11 -flto -fno-fat-lto-objects -fdiagnostics-color
CFLAGS_STD = -std=gnu11
else
CFLAGS_STD =
endif
@ -1056,7 +1056,7 @@ endif
ifndef CXXFLAGS_STD
ifeq ($(shell expr $(CC_VERNUM) '>' 490), 1)
CXXFLAGS_STD = -std=gnu++11 -fno-threadsafe-statics -flto -fno-devirtualize -fdiagnostics-color
CXXFLAGS_STD = -std=gnu++11
else
CXXFLAGS_STD =
endif
@ -1069,7 +1069,9 @@ CFLAGS += $(CFLAGS_STD)
CXXFLAGS += -fpermissive -fno-exceptions $(CXXFLAGS_STD)
ASFLAGS += -x assembler-with-cpp
ifeq ($(shell expr $(CC_VERNUM) '>' 490), 1)
ASFLAGS += -flto
ASFLAGS += -flto
CXXFLAGS += -fno-threadsafe-statics -flto -fno-devirtualize -fdiagnostics-color
CFLAGS += -flto -fno-fat-lto-objects -fdiagnostics-color
endif
LDFLAGS += -$(MCU_FLAG_NAME)=$(MCU) -Wl,--gc-sections -O$(OPTIMIZATION_LEVEL)
ifeq ($(shell expr $(CC_VERNUM) '>' 490), 1)

View file

@ -8,6 +8,7 @@ I tried to give credit whenever possible. If I have missed anyone, kindly add it
- Fix: Add -fno-devirtualize flag to workaround g++ segfault bug (issue #486). (https://github.com/sej7278)
- Fix: Quote the prefix tag in the space_pad_to function
- Tweak: Set ARDMK_VERSION to 1.6 (https://github.com/sej7278)
- Tweak: Move non-standard-related items from CxxFLAGS_STD to CxxFLAGS (issue #523) (https://github.com/sej7278)
- New: Added -fdiagnostics-color to *STD flags (https://github.com/sej7278)
### 1.6.0 (2017-07-11)

View file

@ -912,7 +912,7 @@ OTHER_LIBS = -lsomeplatformlib
Controls, *exclusively*, which C standard is to be used for compilation.
Defaults to `undefined` on 1.0.x or `-std=gnu11 -flto -fno-fat-lto-objects` on 1.5+ or if you install AVR toolchain > 4.9.0
Defaults to `undefined` on 1.0.x or `-std=gnu11` on 1.5+ or if you install AVR toolchain > 4.9.0
Possible values:
@ -927,14 +927,14 @@ Possible values:
* `-std=c11`
* `-std=gnu89`
* `-std=gnu99`
* `-std=gnu11 -flto -fno-fat-lto-objects` - This is the default for C code
* `-std=gnu11` - This is the default for C code
For more information, please refer to the [Options Controlling C Dialect](https://gcc.gnu.org/onlinedocs/gcc/C-Dialect-Options.html)
**Example:**
```Makefile
CFLAGS_STD = = -std=gnu89
CFLAGS_STD = -std=gnu89
```
**Requirement:** *Optional*
@ -947,7 +947,7 @@ CFLAGS_STD = = -std=gnu89
Controls, *exclusively*, which C++ standard is to be used for compilation.
Defaults to `undefined` on 1.0 or `-std=gnu++11 -fno-threadsafe-statics -flto` on AVR toolchain > 4.9.0 (e.g. IDE 1.6.10+)
Defaults to `undefined` on 1.0 or `-std=gnu++11` on AVR toolchain > 4.9.0 (e.g. IDE 1.6.10+)
Possible values:
@ -964,7 +964,7 @@ Possible values:
* `-std=c++1y`
* `-std=c++14`
* `-std=gnu++98`
* `-std=gnu++11 -fno-threadsafe-statics -flto` - This is the default for C++ code
* `-std=gnu++11` - This is the default for C++ code
* `-std=gnu++1y`
* `-std=gnu++14`
@ -973,7 +973,7 @@ For more information, please refer to the [Options Controlling C Dialect](https:
**Example:**
```Makefile
CXXFLAGS_STD = = -std=gnu++98
CXXFLAGS_STD = -std=gnu++98
```
**Requirement:** *Optional*
@ -987,7 +987,7 @@ CXXFLAGS_STD = = -std=gnu++98
Flags passed to compiler for files compiled as C. Add more flags to this
variable using `+=`.
Defaults to all flags required for a typical build.
Defaults to `undefined` on 1.0 or `-flto -fno-fat-lto-objects -fdiagnostics-color` on AVR toolchain > 4.9.0 (e.g. IDE 1.6.10+)
**Example:**
@ -1006,7 +1006,9 @@ CFLAGS += -my-c-only-flag
Flags passed to the compiler for files compiled as C++. Add more flags to this
variable using `+=`.
Defaults to `-fpermissive -fno-exceptions`
Defaults to `-fpermissive -fno-exceptions` on 1.0
or `-fpermissive -fno-exceptions -fno-threadsafe-statics -flto -fno-devirtualize -fdiagnostics-color`
on AVR toolchain > 4.9.0 (e.g. IDE 1.6.10+)
**Example:**