From 0710ab894a5234cc68a6f43dfb9aac95c9c96010 Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Mon, 5 Dec 2016 21:00:35 +0100 Subject: Use -fpic if gcc is configured with --enable-default-pie Test in configure and set Default_Pie in default_pathes.ads Pass -fpic to ghdl1 if Default_Pie is set. Decode -fpic in ghdl1_llvm Fix #213 --- src/ortho/llvm/ortho_code_main.adb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/ortho/llvm') diff --git a/src/ortho/llvm/ortho_code_main.adb b/src/ortho/llvm/ortho_code_main.adb index 5558a8bbe..56c869ad1 100644 --- a/src/ortho/llvm/ortho_code_main.adb +++ b/src/ortho/llvm/ortho_code_main.adb @@ -70,7 +70,7 @@ procedure Ortho_Code_Main is CPU : constant Cstring := Empty_Cstring; Features : constant Cstring := Empty_Cstring; - Reloc : constant RelocMode := RelocDefault; + Reloc : RelocMode := RelocDefault; function To_String (C : Cstring) return String is function Strlen (C : Cstring) return Natural; @@ -125,6 +125,10 @@ begin Optimization := CodeGenLevelDefault; elsif Arg = "-O3" then Optimization := CodeGenLevelAggressive; + elsif Arg = "-fpic" or Arg = "-fPIC" then + Reloc := RelocPIC; + elsif Arg = "-fno-pic" then + Reloc := RelocStatic; elsif Arg = "--emit-llvm" then Output_Kind := Output_Llvm; elsif Arg = "--emit-bc" then -- cgit v1.2.3