Skip to content

Commit 5282cd4

Browse files
author
Filip Jagodzinski
committed
GCC: Use 'common' flags at link time
According to gcc man: It is recommended that you compile all the files participating in the same link with the same options and also specify those options at link time.
1 parent 3953e9c commit 5282cd4

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

tools/profiles/release.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
{
22
"GCC_ARM": {
3-
"common": ["-c", "-Wall", "-Wextra",
3+
"common": ["-Wall", "-Wextra",
44
"-Wno-unused-parameter", "-Wno-missing-field-initializers",
55
"-fmessage-length=0", "-fno-exceptions",
66
"-ffunction-sections", "-fdata-sections", "-funsigned-char",
77
"-MMD", "-fno-delete-null-pointer-checks",
88
"-fomit-frame-pointer", "-Os", "-flto", "-DNDEBUG", "-g"],
9-
"asm": ["-x", "assembler-with-cpp"],
10-
"c": ["-std=gnu11"],
11-
"cxx": ["-std=gnu++14", "-fno-rtti", "-Wvla"],
9+
"asm": ["-c", "-x", "assembler-with-cpp"],
10+
"c": ["-c", "-std=gnu11"],
11+
"cxx": ["-c", "-std=gnu++14", "-fno-rtti", "-Wvla"],
1212
"ld": ["-Wl,--gc-sections", "-Wl,--wrap,main", "-Wl,--wrap,_malloc_r",
1313
"-Wl,--wrap,_free_r", "-Wl,--wrap,_realloc_r", "-Wl,--wrap,_memalign_r",
1414
"-Wl,--wrap,_calloc_r", "-Wl,--wrap,exit", "-Wl,--wrap,atexit",
15-
"-Wl,-n", "-Os", "-flto"]
15+
"-Wl,-n"]
1616
},
1717
"ARMC6": {
1818
"common": ["-c", "--target=arm-arm-none-eabi", "-mthumb", "-Oz",

tools/toolchains/gcc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ def __init__(self, target, notify=None, macros=None, build_profile=None,
124124
self.cc += self.flags['c'] + self.flags['common']
125125
self.cppc += self.flags['cxx'] + self.flags['common']
126126

127-
self.flags['ld'] += self.cpu
127+
self.flags['ld'] += self.cpu + self.flags['common']
128128
self.ld = [join(tool_path, "arm-none-eabi-gcc")] + self.flags['ld']
129129
self.sys_libs = ["stdc++", "supc++", "m", "c", "gcc", "nosys"]
130130
self.preproc = [join(tool_path, "arm-none-eabi-cpp"), "-E", "-P"]

0 commit comments

Comments
 (0)