in your build system. In this case it's CMake, so adding the following lines to your CMakeLists.txt should do (and in ESP IDF, ${COMPONENT_LIB} is the CMake target with the Swift source code):
get_filename_component(compiler_bin_dir ${CMAKE_Swift_COMPILER} DIRECTORY)
target_link_directories(${COMPONENT_LIB} PUBLIC "${compiler_bin_dir}/../lib/swift/embedded/riscv32-none-none-eabi")
target_link_libraries(${COMPONENT_LIB} PUBLIC
-Wl,--whole-archive
swiftUnicodeDataTables
-Wl,--no-whole-archive
)
(For some reason that I don't fully understand, I had to use the --whole-archive/--no-whole-archive flags to get this to link. If someone has better insights into the semantics of ELF linking, I'd love to learn why )