Quellcode durchsuchen

llvm: support for getting the llvm rtl (rt) architecture name

This is the name used as part of the llvm rt libraries, like
asan (address sanitizer)
Jonas Maebe vor 3 Jahren
Ursprung
Commit
75c16b6126
3 geänderte Dateien mit 21 neuen und 2 gelöschten Zeilen
  1. 9 0
      compiler/arm/tripletcpu.pas
  2. 4 1
      compiler/globtype.pas
  3. 8 1
      compiler/i386/tripletcpu.pas

+ 9 - 0
compiler/arm/tripletcpu.pas

@@ -37,6 +37,15 @@ uses
 
 function tripletcpustr(tripletstyle: ttripletstyle): ansistring;
   begin
+    if tripletstyle=triplet_llvmrt then
+      begin
+        if (target_info.abi=abi_eabihf) and
+           not(target_info.system in systems_windows) then
+          result='armhf'
+        else
+          result:='arm';
+        exit:
+      end;
     result:=lower(cputypestr[current_settings.cputype]);
     { llvm replaces the cpu name with thumb for when generating thumb code}
     if (tripletstyle=triplet_llvm) and

+ 4 - 1
compiler/globtype.pas

@@ -379,7 +379,10 @@ interface
 
        { platform triplet style }
        ttripletstyle = (
-         triplet_llvm
+         { llvm toolchain parameters }
+         triplet_llvm,
+         { llvm run time library file names }
+         triplet_llvmrt
          { , triple_gnu }
        );
 

+ 8 - 1
compiler/i386/tripletcpu.pas

@@ -37,7 +37,14 @@ uses
 
 function tripletcpustr(tripletstyle: ttripletstyle): ansistring;
   begin
-    if (target_info.system in systems_darwin) or
+    if tripletstyle in [triplet_llvm,triplet_llvmrt] then
+      begin
+        if target_info.system in systems_android then
+          result:='i686'
+        else
+          result:='i386'
+      end
+    else if (target_info.system in systems_darwin) or
        (current_settings.cputype<cpu_Pentium2) then
       result:='i386'
     else