Improve support for hand-written asm source files
This commit is contained in:
@@ -21,7 +21,7 @@ from SCons.Script import DefaultEnvironment
|
||||
env = DefaultEnvironment()
|
||||
|
||||
env.Append(
|
||||
ASFLAGS=["-x", "assembler-with-cpp"],
|
||||
ASPPFLAGS=["-x", "assembler-with-cpp"],
|
||||
|
||||
CCFLAGS=[
|
||||
"-Os", # optimize for size
|
||||
@@ -58,6 +58,3 @@ if "BOARD" in env:
|
||||
"-mcpu=%s" % env.BoardConfig().get("build.cpu")
|
||||
]
|
||||
)
|
||||
|
||||
# copy CCFLAGS to ASFLAGS (-x assembler-with-cpp mode)
|
||||
env.Append(ASFLAGS=env.get("CCFLAGS", [])[:])
|
||||
|
||||
Submodule builder/frameworks/libopencm3 updated: 462313f515...50c0b2467b
@@ -215,18 +215,22 @@ def process_dsp_lib():
|
||||
)
|
||||
|
||||
|
||||
env.Replace(AS="$CC", ASCOM="$ASPPCOM")
|
||||
machine_flags = [
|
||||
"-mthumb",
|
||||
"-mcpu=%s" % board.get("build.cpu"),
|
||||
]
|
||||
|
||||
env.Append(
|
||||
ASFLAGS=["-x", "assembler-with-cpp"],
|
||||
ASFLAGS=machine_flags,
|
||||
ASPPFLAGS=[
|
||||
"-x", "assembler-with-cpp",
|
||||
],
|
||||
|
||||
CCFLAGS=[
|
||||
CCFLAGS=machine_flags + [
|
||||
"-Os", # optimize for size
|
||||
"-ffunction-sections", # place each function in its own section
|
||||
"-fdata-sections",
|
||||
"-Wall",
|
||||
"-mthumb",
|
||||
"-mcpu=%s" % board.get("build.cpu"),
|
||||
"-nostdlib",
|
||||
],
|
||||
|
||||
@@ -267,11 +271,9 @@ env.Append(
|
||||
"-fno-exceptions"
|
||||
],
|
||||
|
||||
LINKFLAGS=[
|
||||
LINKFLAGS=machine_flags + [
|
||||
"-Os",
|
||||
"-Wl,--gc-sections,--relax",
|
||||
"-mthumb",
|
||||
"-mcpu=%s" % board.get("build.cpu"),
|
||||
"--specs=nano.specs",
|
||||
"--specs=nosys.specs",
|
||||
],
|
||||
@@ -283,9 +285,6 @@ env.Append(
|
||||
LIBS=["c", "gcc", "m", "stdc++", "nosys"],
|
||||
)
|
||||
|
||||
# copy CCFLAGS to ASFLAGS (-x assembler-with-cpp mode)
|
||||
env.Append(ASFLAGS=env.get("CCFLAGS", [])[:])
|
||||
|
||||
if not board.get("build.ldscript", ""):
|
||||
env.Replace(LDSCRIPT_PATH=get_linker_script(
|
||||
board.get("build.mcu", ""), board.get("build.cpu", "")))
|
||||
|
||||
Reference in New Issue
Block a user