Skip to content

Commit 6ac1812

Browse files
authored
remove linker fragment (#6)
1 parent 1b37b4f commit 6ac1812

File tree

2 files changed

+8
-23
lines changed

2 files changed

+8
-23
lines changed

main/CMakeLists.txt

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ idf_component_register(
33
SRCS
44
/dev/null
55
PRIV_INCLUDE_DIRS "."
6-
LDFRAGMENTS "linker.lf"
76
)
87

98
idf_build_get_property(target IDF_TARGET)
@@ -43,7 +42,7 @@ endforeach()
4342
target_compile_options(${COMPONENT_LIB} PUBLIC "$<$<COMPILE_LANGUAGE:Swift>:SHELL:
4443
-target riscv32-none-none-eabi
4544
-Xfrontend -function-sections -enable-experimental-feature Embedded -wmo -parse-as-library -Osize
46-
-Xcc -march=${march_flag} -Xcc -mabi=${mabi_flag}
45+
-Xcc -march=${march_flag} -Xcc -mabi=${mabi_flag} -Xcc -fno-pic -Xcc -fno-pie
4746
-pch-output-dir /tmp
4847
-Xfrontend -enable-single-module-llvm-emission
4948
${SWIFT_INCLUDES}
@@ -63,3 +62,10 @@ target_sources(${COMPONENT_LIB}
6362
Main.swift
6463
FileSystem.swift
6564
)
65+
66+
add_custom_command(
67+
TARGET ${COMPONENT_LIB}
68+
POST_BUILD
69+
COMMAND ${CMAKE_OBJCOPY} --remove-section .swift_modhash
70+
$<TARGET_FILE:${COMPONENT_LIB}> $<TARGET_FILE:${COMPONENT_LIB}>
71+
)

main/linker.lf

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

0 commit comments

Comments
 (0)