Browse Source

Move no-pie to conf
0863674d44d570c182d324e821946e3f4d898d94

spreis 7 months ago
parent
commit
d832a7c17b
2 changed files with 8 additions and 8 deletions
  1. 8 0
      build/conf/linkers/ld.conf
  2. 0 8
      build/scripts/link_exe.py

+ 8 - 0
build/conf/linkers/ld.conf

@@ -68,6 +68,13 @@ LD_ICF_FLAG+=$_LD_ICF_FLAG
 LD_ICF_FLAG+=$_LD_ICF_FLAG_PRINT_SECTIONS
 ICF_FLAG=
 
+_LD_NO_PIE_FLAG=
+when ($_LINKER_ID == "lld" && $PIE != "yes" && ($PIC != "yes" || $PIC_NO_PIE == "yes")) {
+    when ($OS_LINUX == "yes")  {
+        _LD_NO_PIE_FLAG=-Wl,-no-pie
+    }
+}
+
 STRIP_FLAG=
 
 C_LIBRARY_PATH=
@@ -159,6 +166,7 @@ _EXE_FLAGS=\
     $STRIP_FLAG \
     $DCE_FLAG \
     $ICF_FLAG \
+    $_LD_NO_PIE_FLAG \
     $_LINKER_TIME_TRACE_FLAG
 
 _SONAME_FLAG=-Wl,$_SONAME_OPTION,$_SONAME

+ 0 - 8
build/scripts/link_exe.py

@@ -332,14 +332,6 @@ if __name__ == '__main__':
 
     cmd = fix_sanitize_flag(cmd, opts)
 
-    if 'ld.lld' in str(cmd):
-        if '-fPIE' in str(cmd) or '-fPIC' in str(cmd):
-            # support explicit PIE
-            pass
-        else:
-            cmd.append('-Wl,-no-pie')
-
-
     if opts.dynamic_cuda:
         cmd = fix_cmd_for_dynamic_cuda(cmd)
     else: