-
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
Target Triples and Shared Libraries #635
Comments
Interestingly enough, the GCC people are starting to realize that they need http://gcc.gnu.org/ml/gcc/2004-06/msg00116.html -Chris |
The "depend on library" feature is great and should be added. However, I have As for the target triples, I'm thinking this is a bad idea for byte code. One |
In MSIL, each external function specifies which library it comes from. In C
It gets used by the JIT (to dlopen native .so's), and by the mythical magically
One of the nice things about llvm bytecode is that if the source language is int X[sizeof(void*)]; Cannot be compiled to something that is target independent.
There are a couple of things, but the most important is the ability to pick -Chris |
Mine |
Fixed. |
Erm, not quite fixed. The Bytecode, AsmWriter, and AsmParser parts of this bug are done and tested. What remains is the portion that actually uses the information in the Linker and |
The C/C++ front-end is now producing shared library and target triple info. |
All the linking code has been consolidated into lib/Linker and all three linkers This bug is 1/2 complete. The target-triple support still needs to be added. |
Scheduled for 1.5 |
The linker now handles TT support: What is left to close this bug? -Chris |
Methinks to close this bug, targets need to be selected based on |
Not only that, but code generation needs to into account sub-targets. Re-read There's something that still bother's me about all this. While we need to |
No, that is a separate issue. This bug is just about getting the information
This information is really only used for one thing: making cross compilers The heuristic for target selection is:
-Chris |
Fixed. The last piece of this was making targets autoselect themselves based on http://mail.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20041206/022136.html -Chris |
mentioned in issue llvm/llvm-bugzilla-archive#402 |
Extended Description
The LLVM Bytecode format, AsmParser, and Module class need to be extended to
support robust target identification and a list of needed shared libraries.
Currently we use endianness and pointer-size to auto-select a code generator to
use with a bytecode file. This is obviously really limited (ie, we can't
distinguish between i386 and i686, or PPC and SparcV8, for example), and not
complete enough. Instead, we should allow the front-end to encode a standard
GNU style "target-triple" in the .s file, and propagate it through to the
compilation and optimizations steps. From this target triple, we can robustly
identify a code generator or TargetMachine to use
Even when target-triple support is added though, we should still keep the
endianness/pointer size bits around, as they are useful for extracting
information about unknown targets. Also, if a front-end generates portable
code, it should obviously leave the target triple blank, indicating it works
with any target.
While this is being added, it would also make sense to add support for
remembering the shared libraries that a module depends on. Currently when
'gccld' links a program, it statically links in any libraries in LLVM form, then
forgets the rest. This requires the "user" to remember which libraries must be
used when compiling to a exe file or running with the JIT.
To fix this, a module should be able to depend on external "libraries" of code,
either in LLVM form or in native form. This would allow us to "dynamically
link" libstdc++, for example, to C++ programs. When the JIT start doing
off-line caching and neat stuff like that, it could just load the native code
for a library that is already compiled, instead of JIT compiling the whole
library every time an app uses it.
Though it would be nice to have this before 1.2, it looks unlikely that this
will happen. I'm just adding this bug so it doesn't get forgotten.
-Chris
The text was updated successfully, but these errors were encountered: