Skip to content

Commit ffb37b4

Browse files
authored
Apply patch to llvm so llvm and clang symbols kept alive
1 parent 4c9f0d2 commit ffb37b4

File tree

3 files changed

+646
-50
lines changed

3 files changed

+646
-50
lines changed

lib/Interpreter/CMakeLists.txt

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -114,24 +114,15 @@ endif()
114114
)
115115

116116

117-
if(EMSCRIPTEN)
118-
# FIXME: When dynamically linking the Emscripten shared library to the
119-
# unit tests main_module you get errors due to undefined symbols. The reading of the file
120-
# below into a SYMBOLS_LIST variable is a temporary workaround that exports the undefined
121-
# symbols from the shared library, until it can be determined why they are not being exported already.
122-
file(READ "${CMAKE_SOURCE_DIR}/lib/Interpreter/exports.ld" SYMBOLS_LIST)
123-
124-
# Replace newlines with spaces
125-
string(REPLACE "\n" " " SYMBOLS_LIST "${SYMBOLS_LIST}")
126-
117+
if (EMSCRIPTEN)
127118
#FIXME: Setting no_soname=1 is needed until https://github.com/emscripten-core/emscripten/blob/ac676d5e437525d15df5fd46bc2c208ec6d376a3/cmake/Modules/Platform/Emscripten.cmake#L36
128119
# is patched out of emsdk, as --soname is not recognised by emscripten. A PR to do this has been done here https://github.com/emscripten-core/emscripten/pull/23453
129120
#FIXME: A patch is needed to llvm to remove -Wl,-z,defs since it is now recognised on emscripten. What needs to be removed is here
130121
# https://github.com/llvm/llvm-project/blob/128e2e446e90c3b1827cfc7d4d19e3c0976beff3/llvm/cmake/modules/HandleLLVMOptions.cmake#L318 . The PR to do try to do this is here
131122
# https://github.com/llvm/llvm-project/pull/123396
132123
set_target_properties(clangCppInterOp PROPERTIES
133124
NO_SONAME 1
134-
LINK_FLAGS "-s WASM_BIGINT -s SIDE_MODULE=1 ${SYMBOLS_LIST}"
125+
LINK_FLAGS "-s WASM_BIGINT -s SIDE_MODULE=1"
135126
)
136127
if (CPPINTEROP_ENABLE_TESTING)
137128
# When compiling Emscripten tests the shared library it links to is expected to be in the same folder as the compiled Javascript

lib/Interpreter/exports.ld

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

0 commit comments

Comments
 (0)