[clang] 61ab36a - Revert "[Clang-REPL] Fix crash during `__run_exit_handlers` with dynamic libraries. (#117475)"
Davide Italiano via cfe-commits
cfe-commits at lists.llvm.org
Sat Dec 14 10:30:07 PST 2024
Author: Davide Italiano
Date: 2024-12-14T18:26:32Z
New Revision: 61ab36a3e226df32855286dd31a2c3859800475d
URL: https://github.com/llvm/llvm-project/commit/61ab36a3e226df32855286dd31a2c3859800475d
DIFF: https://github.com/llvm/llvm-project/commit/61ab36a3e226df32855286dd31a2c3859800475d.diff
LOG: Revert "[Clang-REPL] Fix crash during `__run_exit_handlers` with dynamic libraries. (#117475)"
This reverts commit 30ad53b92cec0cff9679d559edcc5b933312ba0c as it breaks
systems that don't have a systemwide libc++ or libstdc++ installed. It should
be rewritten to not invoke the system linker. In the meanwhile, reverting
to unblock the bots.
Added:
Modified:
clang/lib/Interpreter/Interpreter.cpp
Removed:
clang/test/Interpreter/crash.cpp
################################################################################
diff --git a/clang/lib/Interpreter/Interpreter.cpp b/clang/lib/Interpreter/Interpreter.cpp
index 6cd60a9bcf4f38..fa4c1439c92612 100644
--- a/clang/lib/Interpreter/Interpreter.cpp
+++ b/clang/lib/Interpreter/Interpreter.cpp
@@ -719,9 +719,7 @@ llvm::Error Interpreter::LoadDynamicLibrary(const char *name) {
if (auto DLSG = llvm::orc::DynamicLibrarySearchGenerator::Load(
name, DL.getGlobalPrefix()))
- // FIXME: Eventually we should put each library in its own JITDylib and
- // turn off process symbols by default.
- EE->getProcessSymbolsJITDylib()->addGenerator(std::move(*DLSG));
+ EE->getMainJITDylib().addGenerator(std::move(*DLSG));
else
return DLSG.takeError();
diff --git a/clang/test/Interpreter/crash.cpp b/clang/test/Interpreter/crash.cpp
deleted file mode 100644
index 1ab24b0febfa15..00000000000000
--- a/clang/test/Interpreter/crash.cpp
+++ /dev/null
@@ -1,20 +0,0 @@
-// REQUIRES: host-supports-jit, x86_64-linux
-
-// RUN: rm -rf %t
-// RUN: mkdir -p %t
-//
-// RUN: split-file %s %t
-//
-// RUN: %clang++ -std=c++20 -fPIC -c %t/vec.cpp -o %t/vec.o
-// RUN: %clang++ -shared %t/vec.o -o %t/vec.so
-//
-// RUN: cat %t/Test.cpp | LD_LIBRARY_PATH=%t:$LD_LIBRARY_PATH clang-repl
-
-//--- vec.cpp
-#include <vector>
-
-//--- Test.cpp
-%lib vec.so
-#include <vector>
-std::vector<int> v;
-%quit
More information about the cfe-commits
mailing list