rustc: Add obj_is_bitcode to TargetOptions
This tells trans:🔙:write not to LLVM codegen to create .o
files but to put LLMV bitcode in .o files.
Emscripten's emcc supports .o in this format, and this is,
I think, slightly easier than making rlibs work without .o
files.
This commit is contained in:
parent
d6c0d859f6
commit
81ba4a78b5
3 changed files with 44 additions and 10 deletions
|
|
@ -22,6 +22,7 @@ pub fn target() -> Target {
|
|||
linker_is_gnu: true,
|
||||
allow_asm: false,
|
||||
archive_format: "gnu".to_string(),
|
||||
obj_is_bitcode: true,
|
||||
.. Default::default()
|
||||
};
|
||||
Target {
|
||||
|
|
|
|||
|
|
@ -204,6 +204,10 @@ pub struct TargetOptions {
|
|||
/// Flag indicating whether ELF TLS (e.g. #[thread_local]) is available for
|
||||
/// this target.
|
||||
pub has_elf_tls: bool,
|
||||
// This is mainly for easy compatibility with emscripten.
|
||||
// If we give emcc .o files that are actually .bc files it
|
||||
// will 'just work'.
|
||||
pub obj_is_bitcode: bool,
|
||||
}
|
||||
|
||||
impl Default for TargetOptions {
|
||||
|
|
@ -251,6 +255,7 @@ impl Default for TargetOptions {
|
|||
exe_allocation_crate: "alloc_system".to_string(),
|
||||
allow_asm: true,
|
||||
has_elf_tls: false,
|
||||
obj_is_bitcode: false,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue