Better removing unnecessary flags using `build_unflags` option // Resolve #698
This commit is contained in:
@@ -40,8 +40,7 @@ env.Replace(
|
||||
"-fdata-sections",
|
||||
"-Wall",
|
||||
"-mthumb",
|
||||
"-mcpu=${BOARD_OPTIONS['build']['cpu']}",
|
||||
"-nostdlib"
|
||||
"-mcpu=${BOARD_OPTIONS['build']['cpu']}"
|
||||
],
|
||||
|
||||
CXXFLAGS=[
|
||||
@@ -57,7 +56,9 @@ env.Replace(
|
||||
"-Os",
|
||||
"-Wl,--gc-sections,--relax",
|
||||
"-mthumb",
|
||||
"-mcpu=${BOARD_OPTIONS['build']['cpu']}"
|
||||
"-mcpu=${BOARD_OPTIONS['build']['cpu']}",
|
||||
"-nostdlib",
|
||||
"-nostartfiles"
|
||||
],
|
||||
|
||||
LIBS=["c", "gcc", "m"],
|
||||
|
||||
@@ -71,8 +71,7 @@ env.Replace(
|
||||
"-Wpointer-arith",
|
||||
"-Wno-implicit-function-declaration",
|
||||
"-Wl,-EL",
|
||||
"-fno-inline-functions",
|
||||
"-nostdlib"
|
||||
"-fno-inline-functions"
|
||||
],
|
||||
|
||||
CCFLAGS=[
|
||||
@@ -82,8 +81,7 @@ env.Replace(
|
||||
"-falign-functions=4",
|
||||
"-U__STRICT_ANSI__",
|
||||
"-ffunction-sections",
|
||||
"-fdata-sections",
|
||||
"-MMD" # output dependancy info
|
||||
"-fdata-sections"
|
||||
],
|
||||
|
||||
CXXFLAGS=[
|
||||
|
||||
@@ -264,13 +264,12 @@ env.Replace(
|
||||
)
|
||||
|
||||
# restore external build flags
|
||||
env.ProcessFlags([
|
||||
env.get("BOARD_OPTIONS", {}).get("build", {}).get("extra_flags")
|
||||
])
|
||||
env.ProcessFlags(
|
||||
env.get("BOARD_OPTIONS", {}).get("build", {}).get("extra_flags"))
|
||||
# remove base flags
|
||||
env.ProcessUnFlags(env.get("BUILD_UNFLAGS"))
|
||||
# apply user flags
|
||||
env.ProcessFlags([env.get("BUILD_FLAGS")])
|
||||
env.ProcessFlags(env.get("BUILD_FLAGS"))
|
||||
|
||||
# Hook for K64F and K22F
|
||||
if board_type in ("frdm_k22f", "frdm_k64f"):
|
||||
|
||||
@@ -66,11 +66,6 @@ env.Append(
|
||||
],
|
||||
|
||||
LIBS=["stdc++", "nosys"],
|
||||
|
||||
LINKFLAGS=[
|
||||
"-nostartfiles",
|
||||
"-nostdlib"
|
||||
]
|
||||
)
|
||||
|
||||
#
|
||||
|
||||
@@ -31,13 +31,6 @@ env.Replace(
|
||||
UPLOADCMD='"$UPLOADER" $SOURCES'
|
||||
)
|
||||
|
||||
env.Append(
|
||||
LINKFLAGS=[
|
||||
"-nostartfiles",
|
||||
"-nostdlib"
|
||||
]
|
||||
)
|
||||
|
||||
#
|
||||
# Target: Build executable and linkable firmware
|
||||
#
|
||||
|
||||
Reference in New Issue
Block a user