Skip to content

Commit c617e5b

Browse files
authored
remove espressif linker fragment file (#71)
1 parent 60a648b commit c617e5b

File tree

4 files changed

+16
-44
lines changed

4 files changed

+16
-44
lines changed

esp32-led-blink-sdk/main/CMakeLists.txt

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
idf_component_register(
33
SRCS /dev/null # We don't have any C++ sources
44
PRIV_INCLUDE_DIRS "."
5-
LDFRAGMENTS "linker.lf"
65
)
76

87
idf_build_get_property(target IDF_TARGET)
@@ -42,7 +41,7 @@ endforeach()
4241
target_compile_options(${COMPONENT_LIB} PUBLIC "$<$<COMPILE_LANGUAGE:Swift>:SHELL:
4342
-target riscv32-none-none-eabi
4443
-Xfrontend -function-sections -enable-experimental-feature Embedded -wmo -parse-as-library -Osize
45-
-Xcc -march=${march_flag} -Xcc -mabi=${mabi_flag}
44+
-Xcc -march=${march_flag} -Xcc -mabi=${mabi_flag} -Xcc -fno-pic -Xcc -fno-pie
4645
4746
-pch-output-dir /tmp
4847
-Xfrontend -enable-single-module-llvm-emission
@@ -65,3 +64,10 @@ target_sources(${COMPONENT_LIB}
6564
Main.swift
6665
Led.swift
6766
)
67+
68+
add_custom_command(
69+
TARGET ${COMPONENT_LIB}
70+
POST_BUILD
71+
COMMAND ${CMAKE_OBJCOPY} --remove-section .swift_modhash
72+
$<TARGET_FILE:${COMPONENT_LIB}> $<TARGET_FILE:${COMPONENT_LIB}>
73+
)

esp32-led-blink-sdk/main/linker.lf

Lines changed: 0 additions & 20 deletions
This file was deleted.

esp32-led-strip-sdk/main/CMakeLists.txt

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
idf_component_register(
33
SRCS /dev/null # We don't have any C++ sources
44
PRIV_INCLUDE_DIRS "."
5-
LDFRAGMENTS "linker.lf"
65
)
76

87
idf_build_get_property(target IDF_TARGET)
@@ -42,7 +41,7 @@ endforeach()
4241
target_compile_options(${COMPONENT_LIB} PUBLIC "$<$<COMPILE_LANGUAGE:Swift>:SHELL:
4342
-target riscv32-none-none-eabi
4443
-Xfrontend -function-sections -enable-experimental-feature Embedded -wmo -parse-as-library -Osize
45-
-Xcc -march=${march_flag} -Xcc -mabi=${mabi_flag}
44+
-Xcc -march=${march_flag} -Xcc -mabi=${mabi_flag} -Xcc -fno-pic -Xcc -fno-pie
4645
4746
-pch-output-dir /tmp
4847
-Xfrontend -enable-single-module-llvm-emission
@@ -65,3 +64,10 @@ target_sources(${COMPONENT_LIB}
6564
Main.swift
6665
LedStrip.swift
6766
)
67+
68+
add_custom_command(
69+
TARGET ${COMPONENT_LIB}
70+
POST_BUILD
71+
COMMAND ${CMAKE_OBJCOPY} --remove-section .swift_modhash
72+
$<TARGET_FILE:${COMPONENT_LIB}> $<TARGET_FILE:${COMPONENT_LIB}>
73+
)

esp32-led-strip-sdk/main/linker.lf

Lines changed: 0 additions & 20 deletions
This file was deleted.

0 commit comments

Comments
 (0)