From 89f73ea32671f66c2c7775a5607e7b55e9efa3f3 Mon Sep 17 00:00:00 2001 From: erhankur Date: Tue, 5 Nov 2024 23:39:32 +0100 Subject: [PATCH] remove espressif linker fragment file --- esp32-led-blink-sdk/main/CMakeLists.txt | 10 ++++++++-- esp32-led-blink-sdk/main/linker.lf | 20 -------------------- esp32-led-strip-sdk/main/CMakeLists.txt | 10 ++++++++-- esp32-led-strip-sdk/main/linker.lf | 20 -------------------- 4 files changed, 16 insertions(+), 44 deletions(-) delete mode 100644 esp32-led-blink-sdk/main/linker.lf delete mode 100644 esp32-led-strip-sdk/main/linker.lf diff --git a/esp32-led-blink-sdk/main/CMakeLists.txt b/esp32-led-blink-sdk/main/CMakeLists.txt index 8795d351..6ddb5a41 100644 --- a/esp32-led-blink-sdk/main/CMakeLists.txt +++ b/esp32-led-blink-sdk/main/CMakeLists.txt @@ -2,7 +2,6 @@ idf_component_register( SRCS /dev/null # We don't have any C++ sources PRIV_INCLUDE_DIRS "." - LDFRAGMENTS "linker.lf" ) idf_build_get_property(target IDF_TARGET) @@ -42,7 +41,7 @@ endforeach() target_compile_options(${COMPONENT_LIB} PUBLIC "$<$:SHELL: -target riscv32-none-none-eabi -Xfrontend -function-sections -enable-experimental-feature Embedded -wmo -parse-as-library -Osize - -Xcc -march=${march_flag} -Xcc -mabi=${mabi_flag} + -Xcc -march=${march_flag} -Xcc -mabi=${mabi_flag} -Xcc -fno-pic -Xcc -fno-pie -pch-output-dir /tmp -Xfrontend -enable-single-module-llvm-emission @@ -65,3 +64,10 @@ target_sources(${COMPONENT_LIB} Main.swift Led.swift ) + +add_custom_command( + TARGET ${COMPONENT_LIB} + POST_BUILD + COMMAND ${CMAKE_OBJCOPY} --remove-section .swift_modhash + $ $ +) diff --git a/esp32-led-blink-sdk/main/linker.lf b/esp32-led-blink-sdk/main/linker.lf deleted file mode 100644 index 6fdc4a8d..00000000 --- a/esp32-led-blink-sdk/main/linker.lf +++ /dev/null @@ -1,20 +0,0 @@ -[sections:flash_text_swift] -entries: - .swift_modhash+ - -[sections:dram0_swift] -entries: - .got+ - .got.plt+ - -[scheme:swift_default] -entries: - flash_text_swift -> flash_text - dram0_swift -> dram0_data - -[mapping:swift_default] -archive: * -entries: - * (swift_default); - flash_text_swift -> flash_text SURROUND (swift_text), - dram0_swift -> dram0_data SURROUND (swift_dram0) diff --git a/esp32-led-strip-sdk/main/CMakeLists.txt b/esp32-led-strip-sdk/main/CMakeLists.txt index c5a8c8a7..62925a98 100644 --- a/esp32-led-strip-sdk/main/CMakeLists.txt +++ b/esp32-led-strip-sdk/main/CMakeLists.txt @@ -2,7 +2,6 @@ idf_component_register( SRCS /dev/null # We don't have any C++ sources PRIV_INCLUDE_DIRS "." - LDFRAGMENTS "linker.lf" ) idf_build_get_property(target IDF_TARGET) @@ -42,7 +41,7 @@ endforeach() target_compile_options(${COMPONENT_LIB} PUBLIC "$<$:SHELL: -target riscv32-none-none-eabi -Xfrontend -function-sections -enable-experimental-feature Embedded -wmo -parse-as-library -Osize - -Xcc -march=${march_flag} -Xcc -mabi=${mabi_flag} + -Xcc -march=${march_flag} -Xcc -mabi=${mabi_flag} -Xcc -fno-pic -Xcc -fno-pie -pch-output-dir /tmp -Xfrontend -enable-single-module-llvm-emission @@ -65,3 +64,10 @@ target_sources(${COMPONENT_LIB} Main.swift LedStrip.swift ) + +add_custom_command( + TARGET ${COMPONENT_LIB} + POST_BUILD + COMMAND ${CMAKE_OBJCOPY} --remove-section .swift_modhash + $ $ +) diff --git a/esp32-led-strip-sdk/main/linker.lf b/esp32-led-strip-sdk/main/linker.lf deleted file mode 100644 index 6fdc4a8d..00000000 --- a/esp32-led-strip-sdk/main/linker.lf +++ /dev/null @@ -1,20 +0,0 @@ -[sections:flash_text_swift] -entries: - .swift_modhash+ - -[sections:dram0_swift] -entries: - .got+ - .got.plt+ - -[scheme:swift_default] -entries: - flash_text_swift -> flash_text - dram0_swift -> dram0_data - -[mapping:swift_default] -archive: * -entries: - * (swift_default); - flash_text_swift -> flash_text SURROUND (swift_text), - dram0_swift -> dram0_data SURROUND (swift_dram0)