Skip to content

Commit 5d88dde

Browse files
authored
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]: llvm/llvm-project#133579 [2]: llvm/llvm-project#127651 (comment) Signed-off-by: Dakkshesh <dakkshesh5@gmail.com>
1 parent 56c46b6 commit 5d88dde

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

platform.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@ compiler.warning_flags.all=-Wall -Wextra
1919

2020
# Default "compiler.path" is correct, change only if you want to override the initial value
2121
compiler.path={runtime.tools.cba-llvm.path}/bin/
22-
compiler.c.cmd=clang-wrapper
23-
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
24-
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}
22+
compiler.c.cmd=clang
23+
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
24+
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}
2525
compiler.c.elf.cmd=clang++-wrapper
2626
compiler.S.flags=--target=avr --sysroot={runtime.tools.cba-avr-sysroot.path} -c -g -x assembler-with-cpp -flto -MMD
27-
compiler.cpp.cmd=clang++-wrapper
28-
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
27+
compiler.cpp.cmd=clang++
28+
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
2929
compiler.ar.cmd=llvm-ar
3030
compiler.ar.flags=rcs
3131
compiler.objcopy.cmd=llvm-objcopy

0 commit comments

Comments
 (0)