Skip to content

Commit 5f94afb

Browse files
mcbartonvgvassilev
andcommitted
Remove -Wl,-z,defs linker flag when building shared libraries using llvm with emscripten
Co-Authored-By: Vassil Vassilev <[email protected]>
1 parent b1bf95c commit 5f94afb

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

llvm/cmake/modules/HandleLLVMOptions.cmake

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -309,15 +309,13 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "AIX")
309309
message(WARNING "Build and install environment path info may be exposed; binaries will also be unrelocatable.")
310310
endif()
311311
endif()
312-
313312
# Pass -Wl,-z,defs. This makes sure all symbols are defined. Otherwise a DSO
314313
# build might work on ELF but fail on MachO/COFF.
315-
if(NOT (CMAKE_SYSTEM_NAME MATCHES "Darwin|FreeBSD|OpenBSD|DragonFly|AIX|OS390" OR
314+
if(NOT (CMAKE_SYSTEM_NAME MATCHES "Darwin|FreeBSD|OpenBSD|DragonFly|AIX|OS390|Emscripten" OR
316315
WIN32 OR CYGWIN) AND
317316
NOT LLVM_USE_SANITIZER)
318317
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-z,defs")
319318
endif()
320-
321319
# Pass -Wl,-z,nodelete. This makes sure our shared libraries are not unloaded
322320
# by dlclose(). We need that since the CLI API relies on cross-references
323321
# between global objects which became horribly broken when one of the libraries

0 commit comments

Comments
 (0)