Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions lldb/tools/repl/swift/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,18 @@ target_link_libraries(repl_swift PRIVATE ${CMAKE_DL_LIBS})
if(CMAKE_SYSTEM_NAME STREQUAL Windows)
set_target_properties(repl_swift PROPERTIES
WIN32_EXECUTABLE TRUE)
elseif(CMAKE_SYSTEM_NAME STREQUAL Linux)
elseif(CMAKE_SYSTEM_NAME MATCHES "Linux|Android|OpenBSD|FreeBSD")
string(TOLOWER "${CMAKE_SYSTEM_NAME}" platform)
if(CMAKE_SYSTEM_PROCESSOR MATCHES ppc64le)
set_target_properties(repl_swift PROPERTIES
BUILD_RPATH ${SWIFT_LIBRARY_DIR}/swift/linux/powerpc64le)
BUILD_RPATH "${SWIFT_LIBRARY_DIR}/swift/${platform}/powerpc64le")
else()
set_target_properties(repl_swift PROPERTIES
BUILD_RPATH ${SWIFT_LIBRARY_DIR}/swift/linux)
BUILD_RPATH "${SWIFT_LIBRARY_DIR}/swift/${platform}")
endif()
set_target_properties(repl_swift PROPERTIES
BUILD_WITH_INSTALL_RPATH NO
INSTALL_RPATH "$ORIGIN/../lib/swift/linux")
INSTALL_RPATH "$ORIGIN/../lib/swift/${platform}")
endif()

# The dummy repl executable is a C program, but we always look for a mangled
Expand Down
4 changes: 2 additions & 2 deletions lldb/tools/repl/swift/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#include <dlfcn.h>
#endif

#if defined(__linux__)
#if defined(__linux__) || defined(__FreeBSD__)
#include <dlfcn.h>
#endif

Expand Down Expand Up @@ -60,7 +60,7 @@ int main() {
// We load the system's libswiftCore, but this is overriden on tests to
// use the just built one by setting DYLD_LIBRARY_PATH.
dlopen("/usr/lib/swift/libswiftCore.dylib", RTLD_LAZY);
#elif defined(__linux__)
#elif defined(__linux__) || defined(__FreeBSD__)
dlopen("libswiftCore.so", RTLD_LAZY);
#elif defined(_WIN32)
HMODULE hModule = LoadLibraryW(L"swiftCore.dll");
Expand Down