kopia lustrzana https://github.com/pimoroni/pimoroni-pico
Merge pull request #968 from pimoroni/patch-remove-exceptions-patch
Move nano specs hack into our module cmake files.pull/969/head
commit
3fefcb8609
|
@ -95,12 +95,6 @@ jobs:
|
|||
source $BUILD_TOOLS
|
||||
micropython_build_mpy_cross
|
||||
|
||||
- name: "HACK: CMakeLists.txt Disable C++ Exceptions Patch"
|
||||
shell: bash
|
||||
run: |
|
||||
source $BUILD_TOOLS
|
||||
hack_patch_micropython_disable_exceptions
|
||||
|
||||
- name: "HACK: Pico SDK Patch"
|
||||
shell: bash
|
||||
run: |
|
||||
|
|
|
@ -45,12 +45,6 @@ function micropython_version {
|
|||
echo "MICROPY_GIT_HASH=$MICROPYTHON_VERSION-$TAG_OR_SHA" >> $GITHUB_ENV
|
||||
}
|
||||
|
||||
function hack_patch_micropython_disable_exceptions {
|
||||
cd micropython
|
||||
git apply $PIMORONI_PICO_DIR/micropython/micropython_nano_specs.patch
|
||||
cd ../
|
||||
}
|
||||
|
||||
function hack_patch_pico_sdk {
|
||||
# pico-sdk-patch.sh will apply the patch if it exists
|
||||
cd micropython
|
||||
|
|
|
@ -1,21 +0,0 @@
|
|||
diff --git a/ports/rp2/CMakeLists.txt b/ports/rp2/CMakeLists.txt
|
||||
index fcc435b7b..efabcb3a3 100644
|
||||
--- a/ports/rp2/CMakeLists.txt
|
||||
+++ b/ports/rp2/CMakeLists.txt
|
||||
@@ -464,6 +464,16 @@ set_source_files_properties(
|
||||
COMPILE_OPTIONS "-O2"
|
||||
)
|
||||
|
||||
+# Do not include stack unwinding & exception handling for C++ user modules
|
||||
+target_compile_definitions(usermod INTERFACE PICO_CXX_ENABLE_EXCEPTIONS=0)
|
||||
+target_compile_options(usermod INTERFACE $<$<COMPILE_LANGUAGE:CXX>:
|
||||
+ -fno-exceptions
|
||||
+ -fno-unwind-tables
|
||||
+ -fno-rtti
|
||||
+ -fno-use-cxa-atexit
|
||||
+>)
|
||||
+target_link_options(usermod INTERFACE -specs=nano.specs)
|
||||
+
|
||||
set_source_files_properties(
|
||||
${PICO_SDK_PATH}/src/rp2_common/pico_double/double_math.c
|
||||
${PICO_SDK_PATH}/src/rp2_common/pico_float/float_math.c
|
|
@ -39,3 +39,6 @@ include(modules_py/modules_py)
|
|||
|
||||
# C++ Magic Memory
|
||||
include(cppmem/micropython)
|
||||
|
||||
# Disable build-busting C++ exceptions
|
||||
include(micropython-disable-exceptions)
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
# Do not include stack unwinding & exception handling for C++ user modules
|
||||
target_compile_definitions(usermod INTERFACE PICO_CXX_ENABLE_EXCEPTIONS=0)
|
||||
target_compile_options(usermod INTERFACE $<$<COMPILE_LANGUAGE:CXX>:
|
||||
-fno-exceptions
|
||||
-fno-unwind-tables
|
||||
-fno-rtti
|
||||
-fno-use-cxa-atexit
|
||||
>)
|
||||
target_link_options(usermod INTERFACE -specs=nano.specs)
|
|
@ -48,3 +48,6 @@ include(modules_py/modules_py)
|
|||
|
||||
# C++ Magic Memory
|
||||
include(cppmem/micropython)
|
||||
|
||||
# Disable build-busting C++ exceptions
|
||||
include(micropython-disable-exceptions)
|
|
@ -39,3 +39,6 @@ include(modules_py/modules_py)
|
|||
|
||||
# C++ Magic Memory
|
||||
include(cppmem/micropython)
|
||||
|
||||
# Disable build-busting C++ exceptions
|
||||
include(micropython-disable-exceptions)
|
||||
|
|
|
@ -50,3 +50,6 @@ copy_module(inky_frame.py)
|
|||
|
||||
# C++ Magic Memory
|
||||
include(cppmem/micropython)
|
||||
|
||||
# Disable build-busting C++ exceptions
|
||||
include(micropython-disable-exceptions)
|
||||
|
|
|
@ -12,3 +12,6 @@ include(pico_wireless/micropython)
|
|||
|
||||
# C++ Magic Memory
|
||||
include(cppmem/micropython)
|
||||
|
||||
# Disable build-busting C++ exceptions
|
||||
include(micropython-disable-exceptions)
|
|
@ -12,3 +12,6 @@ include(pico_wireless/micropython)
|
|||
|
||||
# C++ Magic Memory
|
||||
include(cppmem/micropython)
|
||||
|
||||
# Disable build-busting C++ exceptions
|
||||
include(micropython-disable-exceptions)
|
||||
|
|
|
@ -14,3 +14,6 @@ enable_ulab()
|
|||
|
||||
# C++ Magic Memory
|
||||
include(cppmem/micropython)
|
||||
|
||||
# Disable build-busting C++ exceptions
|
||||
include(micropython-disable-exceptions)
|
||||
|
|
|
@ -14,3 +14,6 @@ enable_ulab()
|
|||
|
||||
# C++ Magic Memory
|
||||
include(cppmem/micropython)
|
||||
|
||||
# Disable build-busting C++ exceptions
|
||||
include(micropython-disable-exceptions)
|
||||
|
|
|
@ -11,3 +11,6 @@ include(micropython-common)
|
|||
|
||||
# C++ Magic Memory
|
||||
include(cppmem/micropython)
|
||||
|
||||
# Disable build-busting C++ exceptions
|
||||
include(micropython-disable-exceptions)
|
||||
|
|
|
@ -39,3 +39,6 @@ include(modules_py/modules_py)
|
|||
|
||||
# C++ Magic Memory
|
||||
include(cppmem/micropython)
|
||||
|
||||
# Disable build-busting C++ exceptions
|
||||
include(micropython-disable-exceptions)
|
||||
|
|
|
@ -11,3 +11,6 @@ include(micropython-common)
|
|||
|
||||
# C++ Magic Memory
|
||||
include(cppmem/micropython)
|
||||
|
||||
# Disable build-busting C++ exceptions
|
||||
include(micropython-disable-exceptions)
|
||||
|
|
|
@ -45,3 +45,6 @@ include(modules_py/modules_py)
|
|||
|
||||
# C++ Magic Memory
|
||||
include(cppmem/micropython)
|
||||
|
||||
# Disable build-busting C++ exceptions
|
||||
include(micropython-disable-exceptions)
|
Ładowanie…
Reference in New Issue