aboutsummaryrefslogtreecommitdiffstats
path: root/src/ortho/llvm-nodebug
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2016-12-05 21:00:35 +0100
committerTristan Gingold <tgingold@free.fr>2016-12-06 20:05:50 +0100
commit0710ab894a5234cc68a6f43dfb9aac95c9c96010 (patch)
tree9c39cde922ed981d3c54983d3893b09ab365ac92 /src/ortho/llvm-nodebug
parentbe36587ed1a04b3a9712f837c5b0e82422bd5adf (diff)
downloadghdl-0710ab894a5234cc68a6f43dfb9aac95c9c96010.tar.gz
ghdl-0710ab894a5234cc68a6f43dfb9aac95c9c96010.tar.bz2
ghdl-0710ab894a5234cc68a6f43dfb9aac95c9c96010.zip
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
Diffstat (limited to 'src/ortho/llvm-nodebug')
-rw-r--r--src/ortho/llvm-nodebug/ortho_code_main35.adb6
-rw-r--r--src/ortho/llvm-nodebug/ortho_code_main39.adb6
2 files changed, 10 insertions, 2 deletions
diff --git a/src/ortho/llvm-nodebug/ortho_code_main35.adb b/src/ortho/llvm-nodebug/ortho_code_main35.adb
index 61b836369..bb5458b49 100644
--- a/src/ortho/llvm-nodebug/ortho_code_main35.adb
+++ b/src/ortho/llvm-nodebug/ortho_code_main35.adb
@@ -62,7 +62,7 @@ procedure Ortho_Code_Main35 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;
@@ -117,6 +117,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
diff --git a/src/ortho/llvm-nodebug/ortho_code_main39.adb b/src/ortho/llvm-nodebug/ortho_code_main39.adb
index d1e84b6e3..11e52220e 100644
--- a/src/ortho/llvm-nodebug/ortho_code_main39.adb
+++ b/src/ortho/llvm-nodebug/ortho_code_main39.adb
@@ -62,7 +62,7 @@ procedure Ortho_Code_Main39 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;
@@ -117,6 +117,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