diff --git a/utils/bazel/llvm-project-overlay/clang/BUILD.bazel b/utils/bazel/llvm-project-overlay/clang/BUILD.bazel --- a/utils/bazel/llvm-project-overlay/clang/BUILD.bazel +++ b/utils/bazel/llvm-project-overlay/clang/BUILD.bazel @@ -343,12 +343,13 @@ genrule( name = "basic_version_gen", outs = ["include/clang/Basic/Version.inc"], - cmd = ("printf " + - "\"#define CLANG_VERSION 12.0\n\"" + - "\"#define CLANG_VERSION_MAJOR 12\n\"" + - "\"#define CLANG_VERSION_MINOR 0\n\"" + - "\"#define CLANG_VERSION_PATCHLEVEL 0\n\"" + - "\"#define CLANG_VERSION_STRING \\\"git\\\"\n\" > $@"), + cmd = ( + "echo '#define CLANG_VERSION 12.0' >> $@\n" + + "echo '#define CLANG_VERSION_MAJOR 12' >> $@\n" + + "echo '#define CLANG_VERSION_MINOR 0' >> $@\n" + + "echo '#define CLANG_VERSION_PATCHLEVEL 0' >> $@\n" + + "echo '#define CLANG_VERSION_STRING \"git\"' >> $@\n" + ), ) cc_library( @@ -372,7 +373,7 @@ # are passed through bazel, it's easier to drop generated files next to # the other includes. outs = ["include/VCSVersion.inc"], - cmd = "echo \"#define CLANG_REVISION \\\"git\\\"\" > $@", + cmd = "echo '#define CLANG_REVISION \"git\"' > $@", ) # A hacky library to expose some internal headers of the `basic` library to its diff --git a/utils/bazel/llvm-project-overlay/llvm/BUILD.bazel b/utils/bazel/llvm-project-overlay/llvm/BUILD.bazel --- a/utils/bazel/llvm-project-overlay/llvm/BUILD.bazel +++ b/utils/bazel/llvm-project-overlay/llvm/BUILD.bazel @@ -98,7 +98,7 @@ genrule( name = "version_info_gen", outs = ["include/llvm/Config/VersionInfo.h"], - cmd = "echo \"#define LLVM_VERSION_INFO \\\"git\\\"\" > $@", + cmd = "echo '#define LLVM_VERSION_INFO \"git\"' > $@", ) template_rule( diff --git a/utils/bazel/llvm-project-overlay/llvm/config.bzl b/utils/bazel/llvm-project-overlay/llvm/config.bzl --- a/utils/bazel/llvm-project-overlay/llvm/config.bzl +++ b/utils/bazel/llvm-project-overlay/llvm/config.bzl @@ -6,7 +6,7 @@ def native_arch_defines(arch, triple): return [ - "LLVM_NATIVE_ARCH=\\\"{}\\\"".format(arch), + r'LLVM_NATIVE_ARCH=\"{}\"'.format(arch), "LLVM_NATIVE_ASMPARSER=LLVMInitialize{}AsmParser".format(arch), "LLVM_NATIVE_ASMPRINTER=LLVMInitialize{}AsmPrinter".format(arch), "LLVM_NATIVE_DISASSEMBLER=LLVMInitialize{}Disassembler".format(arch), @@ -14,16 +14,16 @@ "LLVM_NATIVE_TARGETINFO=LLVMInitialize{}TargetInfo".format(arch), "LLVM_NATIVE_TARGETMC=LLVMInitialize{}TargetMC".format(arch), "LLVM_NATIVE_TARGETMCA=LLVMInitialize{}TargetMCA".format(arch), - "LLVM_HOST_TRIPLE=\\\"{}\\\"".format(triple), - "LLVM_DEFAULT_TARGET_TRIPLE=\\\"{}\\\"".format(triple), + r'LLVM_HOST_TRIPLE=\"{}\"'.format(triple), + r'LLVM_DEFAULT_TARGET_TRIPLE=\"{}\"'.format(triple), ] posix_defines = [ "LLVM_ON_UNIX=1", "HAVE_BACKTRACE=1", "BACKTRACE_HEADER=", - "LTDL_SHLIB_EXT=\\\".so\\\"", - "LLVM_PLUGIN_EXT=\\\".so\\\"", + r'LTDL_SHLIB_EXT=\".so\"', + r'LLVM_PLUGIN_EXT=\".so\"', "LLVM_ENABLE_THREADS=1", "HAVE_SYSEXITS_H=1", "HAVE_UNISTD_H=1", @@ -60,8 +60,8 @@ "strdup=_strdup", # LLVM features - "LTDL_SHLIB_EXT=\\\".dll\\\"", - "LLVM_PLUGIN_EXT=\\\".dll\\\"", + r'LTDL_SHLIB_EXT=\".dll\"', + r'LLVM_PLUGIN_EXT=\".dll\"', ] # TODO: We should switch to platforms-based config settings to make this easier