Skip to content

Commit 0fbdbdf

Browse files
committed
Some cleanup
1 parent 6fb3460 commit 0fbdbdf

File tree

4 files changed

+15
-12
lines changed

4 files changed

+15
-12
lines changed

Cargo.lock

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ default = ["master"]
2222
master = ["gccjit/master"]
2323

2424
[dependencies]
25-
# gccjit = { git = "https://github.com/antoyo/gccjit.rs" }
25+
gccjit = { git = "https://github.com/antoyo/gccjit.rs" }
2626

2727
# Local copy.
28-
gccjit = { path = "../gccjit.rs" }
28+
# gccjit = { path = "../gccjit.rs" }
2929

3030
object = { version = "0.30.1", default-features = false, features = [
3131
"std",

src/back/write.rs

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ pub(crate) unsafe fn codegen(cgcx: &CodegenContext<GccCodegenBackend>, diag_hand
2121
let module_name = module.name.clone();
2222

2323
// println!("Module name: {}", module_name);
24-
let should_combine_object_files = module_name == "test_rust.3ab6d383-cgu.0";
24+
// let should_combine_object_files = module_name == "test_rust.3ab6d383-cgu.0"; // With debug info.
25+
let should_combine_object_files = module_name == "test_rust.8bd2b20a-cgu.0";
2526

2627
let module_name = Some(&module_name[..]);
2728

@@ -57,8 +58,8 @@ pub(crate) unsafe fn codegen(cgcx: &CodegenContext<GccCodegenBackend>, diag_hand
5758
context.add_command_line_option("-flto");
5859
context.add_driver_option("-flto");
5960
// TODO: use flto-partition=one?
60-
// context.add_command_line_option("-flto-partition=one");
61-
// context.add_driver_option("-flto-partition=one");
61+
context.add_command_line_option("-flto-partition=one");
62+
context.add_driver_option("-flto-partition=one");
6263
if should_combine_object_files {
6364
unimplemented!(); // TODO: remove this line.
6465
context.add_driver_option("-Wl,-r");
@@ -113,8 +114,8 @@ pub(crate) unsafe fn codegen(cgcx: &CodegenContext<GccCodegenBackend>, diag_hand
113114
context.add_command_line_option("-flto");
114115
context.add_driver_option("-flto");
115116
// TODO: use flto-partition=one?
116-
// context.add_command_line_option("-flto-partition=one");
117-
// context.add_driver_option("-flto-partition=one");
117+
context.add_command_line_option("-flto-partition=one");
118+
context.add_driver_option("-flto-partition=one");
118119
context.add_command_line_option("-ffat-lto-objects");
119120
context.add_driver_option("-ffat-lto-objects");
120121
// TODO: 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).
@@ -161,11 +162,11 @@ pub(crate) unsafe fn codegen(cgcx: &CodegenContext<GccCodegenBackend>, diag_hand
161162
context.add_command_line_option("-flto");
162163
context.add_driver_option("-flto");
163164
// TODO: use flto-partition=one?
164-
// context.add_command_line_option("-flto-partition=one");
165-
// context.add_driver_option("-flto-partition=one");
165+
context.add_command_line_option("-flto-partition=one");
166+
context.add_driver_option("-flto-partition=one");
166167

167168
// let inner = context.new_child_context();
168-
context.add_driver_option("-v");
169+
// context.add_driver_option("-v");
169170
context.add_driver_option("-Wl,-r");
170171
context.add_driver_option("-nostdlib");
171172
context.add_driver_option("-fuse-linker-plugin");

src/mono_item.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ impl<'gcc, 'tcx> PreDefineMethods<'tcx> for CodegenCx<'gcc, 'tcx> {
3636
let fn_abi = self.fn_abi_of_instance(instance, ty::List::empty());
3737
self.linkage.set(base::linkage_to_gcc(linkage));
3838
let decl = self.declare_fn(symbol_name, &fn_abi);
39-
if linkage == Linkage::AvailableExternally {
39+
/*if linkage == Linkage::AvailableExternally {
4040
decl.add_attribute(FnAttribute::ExternallyVisible);
41-
}
41+
}*/
4242
//let attrs = self.tcx.codegen_fn_attrs(instance.def_id());
4343

4444
attributes::from_fn_attrs(self, decl, instance);

0 commit comments

Comments
 (0)