Skip to content

Commit

Permalink
chore: add more LLVM module flags (#58)
Browse files Browse the repository at this point in the history
  • Loading branch information
DaniPopes authored Jul 21, 2024
1 parent e1ce570 commit 4b1a3ea
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion crates/revmc-llvm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use inkwell::{
attributes::{Attribute, AttributeLoc},
basic_block::BasicBlock,
execution_engine::ExecutionEngine,
module::Module,
module::{FlagBehavior, Module},
passes::PassBuilderOptions,
support::error_handling::install_fatal_error_handler,
targets::{
Expand Down Expand Up @@ -1141,6 +1141,16 @@ fn create_module<'ctx>(cx: &'ctx Context, machine: &TargetMachine) -> Result<Mod
module.set_source_file_name(module_name);
module.set_data_layout(&machine.get_target_data().get_data_layout());
module.set_triple(&machine.get_triple());
module.add_basic_value_flag(
"PIC Level",
FlagBehavior::Error, // TODO: Min
cx.i32_type().const_int(2, false),
);
module.add_basic_value_flag(
"RtLibUseGOT",
FlagBehavior::Warning,
cx.i32_type().const_int(1, false),
);
Ok(module)
}

Expand Down

0 comments on commit 4b1a3ea

Please sign in to comment.