Unverified Commit 420d669a authored by Earle F. Philhower, III's avatar Earle F. Philhower, III Committed by GitHub

Add C++ exception option to menus (#607)

Depends on new toolchain from
https://github.com/earlephilhower/pico-quick-toolchain/pull/11

Fixes #251
parent 9e3f6ade
This diff is collapsed.
This diff is collapsed.
......@@ -43,10 +43,9 @@ compiler.warning_flags.all=-Wall -Wextra -Werror=return-type -Wno-ignored-qualif
compiler.defines={build.led} {build.usbstack_flags} -DCFG_TUSB_MCU=OPT_MCU_RP2040 -DUSB_VID={build.vid} -DUSB_PID={build.pid} '-DUSB_MANUFACTURER={build.usb_manufacturer}' '-DUSB_PRODUCT={build.usb_product}'
compiler.includes="-iprefix{runtime.platform.path}/" "@{runtime.platform.path}/lib/platform_inc.txt"
compiler.flags=-march=armv6-m -mcpu=cortex-m0plus -mthumb -ffunction-sections -fdata-sections -fno-exceptions
compiler.flags=-march=armv6-m -mcpu=cortex-m0plus -mthumb -ffunction-sections -fdata-sections {build.flags.exceptions}
compiler.wrap="@{runtime.platform.path}/lib/platform_wrap.txt"
compiler.libpico="{runtime.platform.path}/lib/libpico.a"
compiler.libstdcpp="-lstdc++"
compiler.c.cmd=arm-none-eabi-gcc
compiler.c.flags=-c {compiler.warning_flags} {compiler.defines} {compiler.flags} {compiler.includes} -std=gnu17 -g
......@@ -88,6 +87,8 @@ build.flags.rtti=-fno-rtti
build.fs_start=
build.fs_end=
build.usbstack_flags=
build.flags.libstdcpp=-lstdc++
build.flags.exceptions=-fno-exceptions
build.boot2=boot2_generic_03h_4_padded_checksum
......@@ -119,7 +120,7 @@ recipe.hooks.linking.prelink.1.pattern="{runtime.tools.pqt-python3.path}/python3
recipe.hooks.linking.prelink.2.pattern="{compiler.path}{compiler.S.cmd}" {compiler.c.elf.flags} {compiler.c.elf.extra_flags} -c "{runtime.platform.path}/boot2/{build.boot2}.S" "-I{runtime.platform.path}/pico-sdk/src/rp2040/hardware_regs/include/" "-I{runtime.platform.path}/pico-sdk/src/common/pico_binary_info/include" -o "{build.path}/boot2.o"
## Combine gc-sections, archives, and objects
recipe.c.combine.pattern="{compiler.path}{compiler.c.elf.cmd}" "-L{build.path}" {compiler.c.elf.flags} {compiler.c.elf.extra_flags} {compiler.ldflags} "-Wl,--script={build.path}/memmap_default.ld" "-Wl,-Map,{build.path}/{build.project_name}.map" -o "{build.path}/{build.project_name}.elf" -Wl,--start-group {object_files} "{build.path}/{archive_file}" "{build.path}/boot2.o" {compiler.libraries.ldflags} {compiler.libpico} -lm -lc {compiler.libstdcpp} -lc -Wl,--end-group
recipe.c.combine.pattern="{compiler.path}{compiler.c.elf.cmd}" "-L{build.path}" {compiler.c.elf.flags} {compiler.c.elf.extra_flags} {compiler.ldflags} "-Wl,--script={build.path}/memmap_default.ld" "-Wl,-Map,{build.path}/{build.project_name}.map" -o "{build.path}/{build.project_name}.elf" -Wl,--start-group {object_files} "{build.path}/{archive_file}" "{build.path}/boot2.o" {compiler.libraries.ldflags} {compiler.libpico} -lm -lc {build.flags.libstdcpp} -lc -Wl,--end-group
## Create output (UF2 file)
recipe.objcopy.uf2.pattern="{runtime.tools.pqt-elf2uf2.path}/elf2uf2" "{build.path}/{build.project_name}.elf" "{build.path}/{build.project_name}.uf2"
......
......@@ -50,6 +50,14 @@ def BuildRTTI(name):
print("%s.menu.rtti.Enabled=Enabled" % (name))
print("%s.menu.rtti.Enabled.build.flags.rtti=" % (name))
def BuildExceptions(name):
print("%s.menu.exceptions.Disabled=Disabled" % (name))
print("%s.menu.exceptions.Disabled.build.flags.exceptions=-fno-exceptions" % (name))
print("%s.menu.exceptions.Disabled.build.flags.libstdcpp=-lstdc++" % (name))
print("%s.menu.exceptions.Enabled=Enabled" % (name))
print("%s.menu.exceptions.Enabled.build.flags.exceptions=-fexceptions" % (name))
print("%s.menu.exceptions.Enabled.build.flags.libstdcpp=-lstdc++-exc" % (name))
def BuildBoot(name):
for l in [ ("Generic SPI /2", "boot2_generic_03h_2_padded_checksum"), ("Generic SPI /4", "boot2_generic_03h_4_padded_checksum"),
("IS25LP080 QSPI /2", "boot2_is25lp080_2_padded_checksum"), ("IS25LP080 QSPI /4", "boot2_is25lp080_4_padded_checksum"),
......@@ -112,6 +120,7 @@ def BuildGlobalMenuList():
print("menu.freq=CPU Speed")
print("menu.opt=Optimize")
print("menu.rtti=RTTI")
print("menu.exceptions=C++ Exceptions")
print("menu.dbgport=Debug Port")
print("menu.dbglvl=Debug Level")
print("menu.boot2=Boot Stage 2")
......@@ -146,6 +155,7 @@ def MakeBoard(name, vendor_name, product_name, vid, pid, pwr, boarddefine, flash
BuildFreq(n)
BuildOptimize(n)
BuildRTTI(n)
BuildExceptions(n)
BuildDebugPort(n)
BuildDebugLevel(n)
if a == "picodebug":
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment