-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
tools only pull in some symbols from library archive #1152
Comments
To me, the right solution to this is probably to get rid of the last circular library dependency, then switch However, that gets tricky too, as we go back to "linking multiple versions of the same library". What symbols are missing? Maybe we just need to add them to things like "Transforms/LinkAllPasses.h"? In general, .a files without cyclic dependencies are the best way to distribute libraries... (IMHO) -Chris |
Here's what I see for potential solutions:
In all these choices, we should do at least three things in conjunction with
Reid. |
#1 is basically "use relinked .o's for everything". As you say, badness... #2 is impossible in general, because there are more llvm tools in the world than just those in mainline #3, as you mention, will lead to REALLY slow load times, on the order of our current link times. I don't However, note that this problem is just for tools that have -load options. Things like gccas/gccld don't As such, I propose #4:
-Chris |
*** Bug llvm/llvm-bugzilla-archive#800 has been marked as a duplicate of this bug. *** |
Mine. |
This bug is resolved with all the patches between: http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20060605/035435.html and http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20060605/035448.html |
Nick, Althought I'm fairly confident this fix will work (because I checked linker maps Thanks, Reid. |
Unfortunately, resolving the libLLVMCore references didn't solve the whole The solution is to enhance lib/Support, lib/System, their corresponding header Maybe we should revisit the shared library idea? |
shared libraries are a cop-out. The major issue here is that we don't have a well-defined interface for |
SlowOperationInformer for one. |
add more files to LinkAllVMCore |
I'm really not sure what to do about this situation. We can now selectively link Any ideas? |
Nick, your patch has been committed, more or less. I had to work around a This still isn't finished. The rest of lib/System needs to be included, as well |
All of lib/System is now available to loaded modules. The programs that #include This was the easy part. What's a little more difficult is whether all of These patches were applied: |
Some ideas from IRC on linking whole archives, which would eliminate the darwin ld supports -all_load to load all members of .a file. |
Using the options to include the whole archive has several problems:
Not sure this approach is workable. |
Another way to resolve this is to go back to generating both .o and .a files for |
I currently have a question in to the libtool email list about the correct usage http://lists.gnu.org/archive/html/libtool/2006-08/msg00007.html Apparently, building a libtool "convenience archive" might give us what we want, Reid. |
Very cool. Thanks for following up on this Reid! -Chris |
Okay, some help from the libtool email list has given us a solution that I've LOADABLE_MODULE :=1 This will cause the "USEDLIBS" to actually be linked into the module (shared To make this easier to digest, we're going to make the only requirement the Now, there's only two problems left:
|
Duplicate registration of command line options and passes occurs when the |
This has been fixed by Devang's change of the passmgr from using RTTI to using an explicit ID symbol for each pass. |
This patch does 3 things: 1. Add support for optimizing the address mode of HVX load/store instructions 2. Reduce the value of Add instruction immediates by replacing with the difference from other Addi instructions that share common base: For Example, If we have the below sequence of instructions: r1 = add(r2,llvm#1024) ... r3 = add(r2,llvm#1152) ... r4 = add(r2,llvm#1280) Where the register r2 has the same reaching definition, They get modified to the below sequence: r1 = add(r2,llvm#1024) ... r3 = add(r1,llvm#128) ... r4 = add(r1,llvm#256) 3. Fixes a bug pass where the addi instructions were modified based on a predicated register definition, leading to incorrect output. Eg: INST-1: if (p0) r2 = add(r13,llvm#128) INST-2: r1 = add(r2,llvm#1024) INST-3: r3 = add(r2,llvm#1152) INST-4: r5 = add(r2,llvm#1280) In the above case, since r2's definition is predicated, we do not want to modify the uses of r2 in INST-3/INST-4 with add(r1,llvm#128/256) 4.Fixes a corner case It looks like we never check whether the offset register is actually live (not clobbered) at optimization site. Add the check whether it is live at MBB entrance. The rest should have already been verified. 5. Fixes a bad codegen For whatever reason we do transformation without checking if the value in register actually reaches the user. This is second identical fix for this pass. Co-authored-by: Anirudh Sundar <quic_sanirudh@quicinc.com> Co-authored-by: Sergei Larin <slarin@quicinc.com>
Extended Description
At the moment, the tools link against libLLVM*.a and pull in only the symbols
they need. The problem comes when loading .so files that also depend on symbols
from libLLVM*.a. If the .so is not linked with the .a then it will be missing
symbols.
The alternative, linking to the .a doesn't quite work either. You will get the
RegisterAnalysis or RegisterOpt in duplicate, triggering various errors:
$ analyze -load=./hypothesis.so -hypothesis hypo1.l
analyze: CommandLine Error: Argument 'track-memory' defined more than once!
analyze: CommandLine Error: Argument 'info-output-file' defined more than once!
analyze: CommandLine Error: Argument 'stats' defined more than once!
analyze: CommandLine Error: Argument 'debug' defined more than once!
analyze: CommandLine Error: Argument 'debug-only' defined more than once!
analyze: CommandLine Error: Argument 'help' defined more than once!
analyze: CommandLine Error: Argument 'help-hidden' defined more than once!
analyze: CommandLine Error: Argument 'version' defined more than once!
analyze: Pass.cpp:340: void llvm::RegisterPassBase::registerPass(): Assertion
`PassInfoMap->find(PIObj.getTypeInfo()) == PassInfoMap->end() && "Pass already
registered!"' failed.
The solution is probably to move from .a's to .so's. The other solutions include
making the .a's more fine-grained and changing the modules to explicitly allow
multiple entries.
The text was updated successfully, but these errors were encountered: