-
Notifications
You must be signed in to change notification settings - Fork 436
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
Link issues when writing my own pass using SVF #53
Comments
I tried merging my pass into SVF. If I did not change the CMAKE file, it got the below errors: If I changed the CMAKE file (This workaround solved the above problem in my other project): It got another error: Did anyone ever successfully use SVF as as PASS (not through the WPA tool)? |
It seems to me that the error reflects that you didn't put the corresponding cpp files containing symbol "DominanceFrontierBase" in your cmake compilation. |
I figured out it. This symbol is from LLVM and I checked that is is included in the generated static library LLVMAnalysis, but it is a weak symbol. It seems other objects in that module do not use it, so it's not included in the text section of the generate .a file. I explicitly include it in the file list of add_library, so that it becomes defined in the library. Explicit class initialization for subclass of that class may also work. |
Thanks for the update! |
Is there any cmake issue in SVF for other users to avoid your problem? If so, please also make a pull request. |
No I did not change SVF for this problem. But when I try to integrate SVF into LLVM, I encountered some problems, I did not have time to figure out it yet. |
@zhaogang92 @yuleisui Here are my opinions about this issue.
|
Hi. I'm trying to use the SABER, but had issues similar to OP when using |
I wrote a pass that leverages SVF, but I got some problems when running this pass.
Initially have the following line in my CMAKE file:
target_link_libraries(${PROJECT_NAME} LLVMSvf LLVMCudd ${llvm_libs})
This is similar to what I saw in the WPA tool of SVF. But this has the following linking issues. The reason is that WPA is an executable, and LLVMSvf and LLVMCudd are static libraries.
/usr/bin/ld: error: /mnt/data/Research/Library/SVF/build/lib/CUDD/libLLVMCudd.a(cuddExact.c.o): requires dynamic R_X86_64_PC32 reloc against 'free' which may overflow at runtime; recompile with -fPIC
/usr/bin/ld: error: /mnt/data/Research/Library/SVF/build/lib/CUDD/libLLVMCudd.a(cuddAnneal.c.o): requires dynamic R_X86_64_PC32 reloc against 'cuddNextLow' which may overflow at runtime; recompile with -fPIC
/usr/bin/ld: error: /mnt/data/Research/Library/SVF/build/lib/CUDD/libLLVMCudd.a(cuddLinear.c.o): requires dynamic R_X86_64_32 reloc which may overflow at runtime; recompile with -fPIC
/usr/bin/ld: error: /mnt/data/Research/Library/SVF/build/lib/CUDD/libLLVMCudd.a(cuddWindow.c.o): requires dynamic R_X86_64_PC32 reloc against 'cuddSwapInPlace' which may overflow at runtime; recompile with -fPIC
/usr/bin/ld: error: /mnt/data/Research/Library/SVF/build/lib/CUDD/libLLVMCudd.a(cuddGenetic.c.o): requires dynamic R_X86_64_PC32 reloc against 'st_lookup_int' which may overflow at runtime; recompile with -fPIC
...
So I changed the CMAKE file to:
target_link_libraries(${PROJECT_LIB_NAME} Svf Cudd ${llvm_libs})
This can successfully generate the .so file for my pass. However, when I ran the pass using opt, I got another error:
opt: CommandLine Error: Option 'bitcode-mdindex-threshold' registered more than once!
LLVM ERROR: inconsistency in registered CommandLine options.
Is anybody encounter the same problem?
The text was updated successfully, but these errors were encountered: