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

Add GCC stack protector support (#611)

parent 04ec75e5
This diff is collapsed.
......@@ -43,7 +43,7 @@ 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 {build.flags.exceptions}
compiler.flags=-march=armv6-m -mcpu=cortex-m0plus -mthumb -ffunction-sections -fdata-sections {build.flags.exceptions} {build.flags.stackprotect}
compiler.wrap="@{runtime.platform.path}/lib/platform_wrap.txt"
compiler.libpico="{runtime.platform.path}/lib/libpico.a"
......@@ -89,6 +89,7 @@ build.fs_end=
build.usbstack_flags=
build.flags.libstdcpp=-lstdc++
build.flags.exceptions=-fno-exceptions
build.flags.stackprotect=
build.boot2=boot2_generic_03h_4_padded_checksum
......
......@@ -50,6 +50,12 @@ def BuildRTTI(name):
print("%s.menu.rtti.Enabled=Enabled" % (name))
print("%s.menu.rtti.Enabled.build.flags.rtti=" % (name))
def BuildStackProtect(name):
print("%s.menu.stackprotect.Disabled=Disabled" % (name))
print("%s.menu.stackprotect.Disabled.build.flags.stackprotect=" % (name))
print("%s.menu.stackprotect.Enabled=Enabled" % (name))
print("%s.menu.stackprotect.Enabled.build.flags.stackprotect=-fstack-protector" % (name))
def BuildExceptions(name):
print("%s.menu.exceptions.Disabled=Disabled" % (name))
print("%s.menu.exceptions.Disabled.build.flags.exceptions=-fno-exceptions" % (name))
......@@ -120,6 +126,7 @@ def BuildGlobalMenuList():
print("menu.freq=CPU Speed")
print("menu.opt=Optimize")
print("menu.rtti=RTTI")
print("menu.stackprotect=Stack Protector")
print("menu.exceptions=C++ Exceptions")
print("menu.dbgport=Debug Port")
print("menu.dbglvl=Debug Level")
......@@ -155,6 +162,7 @@ def MakeBoard(name, vendor_name, product_name, vid, pid, pwr, boarddefine, flash
BuildFreq(n)
BuildOptimize(n)
BuildRTTI(n)
BuildStackProtect(n)
BuildExceptions(n)
BuildDebugPort(n)
BuildDebugLevel(n)
......
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