Skip to content

Commit

Permalink
Disable PIC only for eabi/eabihf
Browse files Browse the repository at this point in the history
  • Loading branch information
RX14 committed Nov 14, 2024
1 parent edba635 commit 56de2e0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/compiler/crystal/codegen/target.cr
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,8 @@ class Crystal::Codegen::Target
@architecture == "avr"
end

def eabi?
environment_parts.any? { |part| part.includes? "eabi" }
def embedded?
environment_parts.any? { |part| part == "eabi" || part == "eabihf" }
end

def to_target_machine(cpu = "", features = "", optimization_mode = Compiler::OptimizationMode::O0,
Expand Down Expand Up @@ -232,7 +232,7 @@ class Crystal::Codegen::Target
in .o0? then LLVM::CodeGenOptLevel::None
end

if eabi?
if embedded?
reloc = LLVM::RelocMode::Static
else
reloc = LLVM::RelocMode::PIC
Expand Down

0 comments on commit 56de2e0

Please sign in to comment.