You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Readme.md
-10Lines changed: 0 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -141,16 +141,6 @@ $ CHANNEL="release" $CG_GCCJIT_DIR/y.sh cargo run
141
141
142
142
If you compiled cg_gccjit in debug mode (aka you didn't pass `--release` to `./y.sh test`) you should use `CHANNEL="debug"` instead or omit `CHANNEL="release"` completely.
143
143
144
-
### LTO
145
-
146
-
To use LTO, you need to set the variable `EMBED_LTO_BITCODE=1` in addition to setting `lto = "fat"` in the `Cargo.toml`.
147
-
148
-
Failing to set `EMBED_LTO_BITCODE` will give you the following error:
149
-
150
-
```
151
-
error: failed to copy bitcode to object file: No such file or directory (os error 2)
152
-
```
153
-
154
144
### Rustc
155
145
156
146
If you want to run `rustc` directly, you can do so with:
// TODO(antoyo): Send -plugin/usr/lib/gcc/x86_64-pc-linux-gnu/11.1.0/liblto_plugin.so to linker (this should be done when specifying the appropriate rustc cli argument).
87
-
context.compile_to_file(
88
-
OutputKind::ObjectFile,
89
-
bc_out.to_str().expect("path to str"),
90
-
);
91
-
}
92
-
}else{
93
-
if config.emit_bc || config.emit_obj == EmitObj::Bitcode{
94
-
let _timer = cgcx.prof.generic_activity_with_arg(
95
-
"GCC_module_codegen_emit_bitcode",
96
-
&*module.name,
97
-
);
98
-
context.compile_to_file(
99
-
OutputKind::ObjectFile,
100
-
bc_out.to_str().expect("path to str"),
101
-
);
102
-
}
103
-
104
-
if config.emit_obj == EmitObj::ObjectCode(BitcodeSection::Full){
105
-
// TODO(antoyo): we might want to emit to emit an error here, saying to set the
106
-
// environment variable EMBED_LTO_BITCODE.
107
-
let _timer = cgcx.prof.generic_activity_with_arg(
108
-
"GCC_module_codegen_embed_bitcode",
109
-
&*module.name,
110
-
);
111
-
// TODO(antoyo): maybe we should call embed_bitcode to have the proper iOS fixes?
// TODO(antoyo): Send -plugin/usr/lib/gcc/x86_64-pc-linux-gnu/11.1.0/liblto_plugin.so to linker (this should be done when specifying the appropriate rustc cli argument).
115
-
context.compile_to_file(
116
-
OutputKind::ObjectFile,
117
-
bc_out.to_str().expect("path to str"),
118
-
);
119
80
}
81
+
// TODO(antoyo): Send -plugin/usr/lib/gcc/x86_64-pc-linux-gnu/11.1.0/liblto_plugin.so to linker (this should be done when specifying the appropriate rustc cli argument).
82
+
context
83
+
.compile_to_file(OutputKind::ObjectFile, bc_out.to_str().expect("path to str"));
120
84
}
121
85
}
122
86
@@ -165,7 +129,10 @@ pub(crate) fn codegen(
165
129
context.set_debug_info(true);
166
130
context.dump_to_file(path,true);
167
131
}
168
-
if should_combine_object_files {
132
+
if lto_mode != LtoMode::None{
133
+
let fat_lto = lto_mode == LtoMode::Fat;
134
+
// We need to check if we're doing LTO since this code is also used for the
135
+
// dummy ThinLTO implementation to combine the object files.
0 commit comments