Skip to content

Commit

Permalink
Improve support for assembly programming
Browse files Browse the repository at this point in the history
  • Loading branch information
ivankravets committed May 27, 2022
1 parent 36487d0 commit b5dbf48
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 18 deletions.
4 changes: 1 addition & 3 deletions builder/frameworks/_bare.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
build_mcu = env.get("BOARD_MCU", board.get("build.mcu", ""))

env.Append(
ASFLAGS=["-x", "assembler-with-cpp"],
ASPPFLAGS=["-x", "assembler-with-cpp"],

CFLAGS=[
"-std=gnu11"
Expand Down Expand Up @@ -83,5 +83,3 @@
]
)

# copy CCFLAGS to ASFLAGS (-x assembler-with-cpp mode)
env.Append(ASFLAGS=env.get("CCFLAGS", [])[:])
18 changes: 11 additions & 7 deletions builder/frameworks/arduino/arduino-common.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,20 +42,26 @@

assert os.path.isdir(FRAMEWORK_DIR)

machine_flags = [
"-mcpu=%s" % board.get("build.cpu"),
"-mthumb",
]

env.Append(
ASFLAGS=["-x", "assembler-with-cpp"],
ASFLAGS=machine_flags,
ASPPFLAGS=[
"-x", "assembler-with-cpp",
],

CFLAGS=[
"-std=gnu11"
],

CCFLAGS=[
CCFLAGS=machine_flags + [
"-Os", # optimize for size
"-ffunction-sections", # place each function in its own section
"-fdata-sections",
"-Wall",
"-mcpu=%s" % board.get("build.cpu"),
"-mthumb",
"-nostdlib",
"--param", "max-inline-insns-single=500"
],
Expand All @@ -77,10 +83,8 @@
os.path.join(FRAMEWORK_DIR, "libraries")
],

LINKFLAGS=[
LINKFLAGS=machine_flags + [
"-Os",
"-mcpu=%s" % board.get("build.cpu"),
"-mthumb",
"-Wl,--gc-sections",
"-Wl,--check-sections",
"-Wl,--unresolved-symbols=report-all",
Expand Down
4 changes: 0 additions & 4 deletions builder/frameworks/arduino/arduino-sam.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,6 @@
LIBS=["sam_sam3x8e_gcc_rel", "gcc"]
)

env.Append(
ASFLAGS=env.get("CCFLAGS", [])[:]
)

#
# Target: Build Core Library
#
Expand Down
4 changes: 0 additions & 4 deletions builder/frameworks/arduino/arduino-samd.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,10 +171,6 @@
]
)

env.Append(
ASFLAGS=env.get("CCFLAGS", [])[:],
)

#
# Target: Build Core Library
#
Expand Down

0 comments on commit b5dbf48

Please sign in to comment.