-
Notifications
You must be signed in to change notification settings - Fork 15.2k
[Clang-REPL] Fix crash during __run_exit_handlers with dynamic libraries.
#117475
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,20 @@ | ||||||
| // 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 | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How does |
||||||
|
|
||||||
| //--- vec.cpp | ||||||
| #include <vector> | ||||||
|
|
||||||
| //--- Test.cpp | ||||||
| %lib vec.dylib | ||||||
|
||||||
| %lib vec.dylib | |
| %lib vec.so |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This invokes the system linker. From the build system's point of view, it's almost never correct to invoke the system linker without the environment variables
$LDFLAGSand$LIBS. In this case, you expect to make the shared library to link against the default libs.I am thinking of changing this line to read
Not particularly satisfied with this approach though.
I also think that your
vec.oandvec.soare both empty after my previous fix. This suggests that the two steps here may not even be needed at all for the sake of testing this fix.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps we should use this yaml-to-so tool to build the library.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you point me to the tool? A naive search returned nothing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If there's no quick solution, I would propose to revert the testing portion of this patch. This has been blocking CI on our end for a couple of days. No other tests in llvm repo invokes system linker like this one.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The tools is called
yaml2obj. Alternatively we can upload the binary file which is my least favorite but still should get you going...