Jelajahi Sumber

* link with -nopie on OpenBSD only if PIC code generation is disabled

git-svn-id: trunk@41652 -
nickysn 6 tahun lalu
induk
melakukan
3a58a6261a
1 mengubah file dengan 3 tambahan dan 2 penghapusan
  1. 3 2
      compiler/systems/t_bsd.pas

+ 3 - 2
compiler/systems/t_bsd.pas

@@ -800,8 +800,9 @@ begin
      DynLinKStr:=DynLinkStr+' -dynamic'; // one dash!
    end;
 
-{ Use -nopie on OpenBSD }
-  if (target_info.system in systems_openbsd) then
+{ Use -nopie on OpenBSD if PIC support is turned off }
+  if (target_info.system in systems_openbsd) and
+     not(cs_create_pic in current_settings.moduleswitches) then
     Info.ExtraOptions:=Info.ExtraOptions+' -nopie';
 
 { -N seems to be needed on NetBSD/earm }