[llvm] d47133a - gn build: s/target_/current_/g in compiler-rt/lib/{builtins, profile}.

Peter Collingbourne via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 31 14:04:14 PDT 2019


Author: Peter Collingbourne
Date: 2019-10-31T14:03:39-07:00
New Revision: d47133adad78b4158c68ce15631f1f179799ebde

URL: https://github.com/llvm/llvm-project/commit/d47133adad78b4158c68ce15631f1f179799ebde
DIFF: https://github.com/llvm/llvm-project/commit/d47133adad78b4158c68ce15631f1f179799ebde.diff

LOG: gn build: s/target_/current_/g in compiler-rt/lib/{builtins,profile}.

Fixes stage2 cross compilation.

Differential Revision: https://reviews.llvm.org/D69680

Added: 
    

Modified: 
    llvm/utils/gn/secondary/compiler-rt/lib/builtins/BUILD.gn
    llvm/utils/gn/secondary/compiler-rt/lib/profile/BUILD.gn

Removed: 
    


################################################################################
diff  --git a/llvm/utils/gn/secondary/compiler-rt/lib/builtins/BUILD.gn b/llvm/utils/gn/secondary/compiler-rt/lib/builtins/BUILD.gn
index c13aa707f560..c052603dab94 100644
--- a/llvm/utils/gn/secondary/compiler-rt/lib/builtins/BUILD.gn
+++ b/llvm/utils/gn/secondary/compiler-rt/lib/builtins/BUILD.gn
@@ -24,7 +24,7 @@ static_library("builtins") {
     "-fPIC",
     "-fno-builtin",
   ]
-  if (target_os != "android") {
+  if (current_os != "android") {
     cflags += [ "-fvisibility=hidden" ]
   }
   if (!is_debug) {
@@ -164,7 +164,7 @@ static_library("builtins") {
     "gcc_personality_v0.c",
   ]
 
-  if (target_os != "fuchsia") {
+  if (current_os != "fuchsia") {
     sources += [
       "emutls.c",
       "enable_execute_stack.c",
@@ -172,7 +172,7 @@ static_library("builtins") {
     ]
   }
 
-  if (target_os != "fuchsia" && !compiler_rt_baremetal_build) {
+  if (current_os != "fuchsia" && !compiler_rt_baremetal_build) {
     sources += [
       # This comment prevents `gn format` from putting the file on the same line
       # as `sources +=`, for sync_source_lists_from_cmake.py.
@@ -180,7 +180,7 @@ static_library("builtins") {
     ]
   }
 
-  if (target_os == "mac") {
+  if (current_os == "mac") {
     sources += [
       "atomic_flag_clear.c",
       "atomic_flag_clear_explicit.c",
@@ -191,7 +191,7 @@ static_library("builtins") {
     ]
   }
 
-  if ((target_cpu == "x64" && target_os != "win") || target_cpu == "arm64") {
+  if ((current_cpu == "x64" && current_os != "win") || current_cpu == "arm64") {
     # GENERIC_TF_SOURCES
     sources += [
       "comparetf2.c",
@@ -215,7 +215,7 @@ static_library("builtins") {
     ]
   }
 
-  if (target_cpu == "x86" || target_cpu == "x64") {
+  if (current_cpu == "x86" || current_cpu == "x64") {
     sources += [
       "cpu_model.c",
       "divxc3.c",
@@ -232,7 +232,7 @@ static_library("builtins") {
       "powixf2.c",
     ]
   }
-  if (target_cpu == "x86") {
+  if (current_cpu == "x86") {
     sources -= [
       "ashldi3.c",
       "ashrdi3.c",
@@ -265,13 +265,13 @@ static_library("builtins") {
       "i386/udivdi3.S",
       "i386/umoddi3.S",
     ]
-    if (target_os == "win") {
+    if (current_os == "win") {
       sources += [
         "i386/chkstk.S",
         "i386/chkstk2.S",
       ]
     }
-  } else if (target_cpu == "x64") {
+  } else if (current_cpu == "x64") {
     sources -= [
       "floatdidf.c",
       "floatdisf.c",
@@ -288,7 +288,7 @@ static_library("builtins") {
       "x86_64/floatundisf.S",
       "x86_64/floatundixf.S",
     ]
-    if (target_os == "win") {
+    if (current_os == "win") {
       sources += [
         "x86_64/chkstk.S",
         "x86_64/chkstk2.S",
@@ -296,8 +296,8 @@ static_library("builtins") {
     }
   }
 
-  if (target_cpu == "arm") {
-    if (target_os != "mingw") {
+  if (current_cpu == "arm") {
+    if (current_os != "mingw") {
       sources -= [
         "bswapdi2.c",
         "bswapsi2.c",
@@ -357,13 +357,13 @@ static_library("builtins") {
     }
   }
 
-  if (target_cpu == "arm64") {
+  if (current_cpu == "arm64") {
     sources += [
       # This comment prevents `gn format` from putting the file on the same line
       # as `sources +=`, for sync_source_lists_from_cmake.py.
       "aarch64/fp_mode.c",
     ]
-    if (target_os == "mingw") {
+    if (current_os == "mingw") {
       sources += [
         # This comment prevents `gn format` from putting the file on the same
         # line as `sources +=`, for sync_source_lists_from_cmake.py.
@@ -372,7 +372,7 @@ static_library("builtins") {
     }
   }
 
-  if (target_cpu == "hexagon") {
+  if (current_cpu == "hexagon") {
     sources += [
       "hexagon/common_entry_exit_abi1.S",
       "hexagon/common_entry_exit_abi2.S",
@@ -407,7 +407,7 @@ static_library("builtins") {
     ]
   }
 
-  if (target_cpu == "ppc64") {
+  if (current_cpu == "ppc64") {
     sources += [
       "ppc/divtc3.c",
       "ppc/fixtfdi.c",
@@ -424,7 +424,7 @@ static_library("builtins") {
     ]
   }
 
-  if (target_cpu == "riscv") {
+  if (current_cpu == "riscv") {
     sources += [
       # This comment prevents `gn format` from putting the file on the same line
       # as `sources +=`, for sync_source_lists_from_cmake.py.

diff  --git a/llvm/utils/gn/secondary/compiler-rt/lib/profile/BUILD.gn b/llvm/utils/gn/secondary/compiler-rt/lib/profile/BUILD.gn
index ab6ffe6a86cc..14203dede211 100644
--- a/llvm/utils/gn/secondary/compiler-rt/lib/profile/BUILD.gn
+++ b/llvm/utils/gn/secondary/compiler-rt/lib/profile/BUILD.gn
@@ -12,7 +12,7 @@ static_library("profile") {
   configs -= [ "//llvm/utils/gn/build:thin_archive" ]
 
   cflags = []
-  if (target_os != "win") {
+  if (current_os != "win") {
     cflags = [
       "-fPIC",
       "-Wno-pedantic",
@@ -47,14 +47,14 @@ static_library("profile") {
     "InstrProfilingValue.c",
     "InstrProfilingWriter.c",
   ]
-  if (target_os == "win") {
+  if (current_os == "win") {
     sources += [
       "WindowsMMap.c",
       "WindowsMMap.h",
     ]
   }
 
-  if (target_os != "win") {
+  if (current_os != "win") {
     defines = [
       "COMPILER_RT_TARGET_HAS_ATOMICS",
       "COMPILER_RT_TARGET_HAS_FCNTL_LCK",


        


More information about the llvm-commits mailing list