From 5d88ddef86ce75fffadc195aab2200f86403719d Mon Sep 17 00:00:00 2001 From: Dakkshesh Date: Sat, 29 Mar 2025 22:32:46 +0530 Subject: [PATCH 1/2] platform: Add `-mno-relax` for final link As reported in [1] and verified in [2] adding -mno-relax seems to fix the LED blinking issues without needing to disable LTO for the affected files. Use this as a temporary workaround until the issue is fixed. Remove the usage of clang-wrapper for c and cpp cmds since its not required anymore. [1]: https://github.com/llvm/llvm-project/issues/133579 [2]: https://github.com/llvm/llvm-project/issues/127651#issuecomment-2763720447 Signed-off-by: Dakkshesh --- platform.txt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/platform.txt b/platform.txt index 268502cb..5a9dfd76 100644 --- a/platform.txt +++ b/platform.txt @@ -19,13 +19,13 @@ compiler.warning_flags.all=-Wall -Wextra # Default "compiler.path" is correct, change only if you want to override the initial value compiler.path={runtime.tools.cba-llvm.path}/bin/ -compiler.c.cmd=clang-wrapper -compiler.c.flags=--target=avr -c -g -Os {compiler.warning_flags} --skip-lto=wiring.c --sysroot={runtime.tools.cba-avr-sysroot.path} -std=gnu11 -ffunction-sections -fdata-sections -MMD -flto -fno-fat-lto-objects -compiler.c.elf.flags=--target=avr {compiler.warning_flags} --sysroot={runtime.tools.cba-avr-sysroot.path} -Os -g -flto -fuse-linker-plugin -ffunction-sections -fdata-sections -Wl,--gc-sections --bfd-dir={runtime.tools.cba-avr-bfd.path} --llvmgold-dir={runtime.tools.cba-llvmgold.path} +compiler.c.cmd=clang +compiler.c.flags=--target=avr -c -g -Os {compiler.warning_flags} --sysroot={runtime.tools.cba-avr-sysroot.path} -std=gnu11 -ffunction-sections -fdata-sections -MMD -flto -fno-fat-lto-objects +compiler.c.elf.flags=--target=avr -mno-relax {compiler.warning_flags} --sysroot={runtime.tools.cba-avr-sysroot.path} -Os -g -flto -fuse-linker-plugin -ffunction-sections -fdata-sections -Wl,--gc-sections --bfd-dir={runtime.tools.cba-avr-bfd.path} --llvmgold-dir={runtime.tools.cba-llvmgold.path} compiler.c.elf.cmd=clang++-wrapper compiler.S.flags=--target=avr --sysroot={runtime.tools.cba-avr-sysroot.path} -c -g -x assembler-with-cpp -flto -MMD -compiler.cpp.cmd=clang++-wrapper -compiler.cpp.flags=--target=avr -c -g -Os {compiler.warning_flags} --skip-lto=HardwareSerial0.cpp --sysroot={runtime.tools.cba-avr-sysroot.path} -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fno-rtti -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -MMD -flto +compiler.cpp.cmd=clang++ +compiler.cpp.flags=--target=avr -c -g -Os {compiler.warning_flags} --sysroot={runtime.tools.cba-avr-sysroot.path} -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fno-rtti -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -MMD compiler.ar.cmd=llvm-ar compiler.ar.flags=rcs compiler.objcopy.cmd=llvm-objcopy From 230866559e4e826b3c3a2103db7047fe6e763ecf Mon Sep 17 00:00:00 2001 From: Dakkshesh Date: Mon, 31 Mar 2025 10:39:38 +0530 Subject: [PATCH 2/2] core: main: Dont check for `serialEventRun` as its always defined Signed-off-by: Dakkshesh --- cores/arduino/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cores/arduino/main.cpp b/cores/arduino/main.cpp index 434cd403..e5b9248c 100644 --- a/cores/arduino/main.cpp +++ b/cores/arduino/main.cpp @@ -44,7 +44,7 @@ int main(void) for (;;) { loop(); - if (serialEventRun) serialEventRun(); + serialEventRun(); } return 0;