[llvm] d76b37e - Revert "[gn build] Port 2700da5fe28d (lld/unittests etc)"
Nico Weber via llvm-commits
llvm-commits at lists.llvm.org
Wed Jun 14 15:08:21 PDT 2023
Author: Nico Weber
Date: 2023-06-14T15:08:03-07:00
New Revision: d76b37e6954ad0cf66f1f3c6a9c70328c45859f3
URL: https://github.com/llvm/llvm-project/commit/d76b37e6954ad0cf66f1f3c6a9c70328c45859f3
DIFF: https://github.com/llvm/llvm-project/commit/d76b37e6954ad0cf66f1f3c6a9c70328c45859f3.diff
LOG: Revert "[gn build] Port 2700da5fe28d (lld/unittests etc)"
2700da5fe28d got reverted in aa495214b39d.
This reverts commit 9239cde390e2c8e7cc4ffd13bff7030a5172c805.
Also revert follow-up "[gn] Fix case of directory I added in 9239cde390e"
This reverts commit 4de67143babd20f44c1f806404df356bff6825a2.
Added:
Modified:
llvm/utils/gn/secondary/lld/Common/BUILD.gn
llvm/utils/gn/secondary/lld/test/BUILD.gn
llvm/utils/gn/secondary/llvm/utils/llvm-lit/BUILD.gn
Removed:
llvm/utils/gn/secondary/lld/unittests/AsLibAll/BUILD.gn
llvm/utils/gn/secondary/lld/unittests/AsLibELF/BUILD.gn
llvm/utils/gn/secondary/lld/unittests/BUILD.gn
################################################################################
diff --git a/llvm/utils/gn/secondary/lld/Common/BUILD.gn b/llvm/utils/gn/secondary/lld/Common/BUILD.gn
index b5286545f867d..0d5713b6fd3f9 100644
--- a/llvm/utils/gn/secondary/lld/Common/BUILD.gn
+++ b/llvm/utils/gn/secondary/lld/Common/BUILD.gn
@@ -35,7 +35,6 @@ static_library("Common") {
"Args.cpp",
"CommonLinkerContext.cpp",
"DWARF.cpp",
- "DriverDispatcher.cpp",
"ErrorHandler.cpp",
"Filesystem.cpp",
"Memory.cpp",
diff --git a/llvm/utils/gn/secondary/lld/test/BUILD.gn b/llvm/utils/gn/secondary/lld/test/BUILD.gn
index 06256e1ba161b..01ee607e582eb 100644
--- a/llvm/utils/gn/secondary/lld/test/BUILD.gn
+++ b/llvm/utils/gn/secondary/lld/test/BUILD.gn
@@ -3,42 +3,28 @@ import("//llvm/triples.gni")
import("//llvm/utils/gn/build/libs/xml/enable.gni")
import("//llvm/utils/gn/build/libs/zlib/enable.gni")
import("//llvm/utils/gn/build/write_cmake_config.gni")
-import("//llvm/utils/llvm-lit/lit_path_function.gni")
import("lld_lit_site_cfg_files.gni")
-# The bits common to writing lit.site.cfg.py.in and Unit/lit.site.cfg.py.in.
-template("write_lit_cfg") {
- write_cmake_config(target_name) {
- input = invoker.input
- output = invoker.output
- values = [
- "LIT_SITE_CFG_IN_HEADER=" +
- "## Autogenerated from $input, do not edit\n\n" + lit_path_function,
- "LLD_BINARY_DIR=" +
- rebase_path(get_label_info("//lld", "target_out_dir")),
- "CURRENT_LIBS_DIR=", # FIXME: for shared builds only (?)
- "CURRENT_TOOLS_DIR=" + rebase_path("$root_out_dir/bin"),
- "LLD_SOURCE_DIR=" + rebase_path("//lld"),
- "LLVM_BINARY_DIR=" +
- rebase_path(get_label_info("//llvm", "target_out_dir")),
- "LLVM_SOURCE_DIR=" + rebase_path("//llvm"),
- "LLVM_TOOLS_DIR=" + rebase_path("$root_out_dir/bin"),
- ]
- values += invoker.extra_values
- }
-}
-
-write_lit_cfg("lit_site_cfg") {
+write_cmake_config("lit_site_cfg") {
# Fully-qualified instead of relative for LIT_SITE_CFG_IN_HEADER.
input = "//lld/test/lit.site.cfg.py.in"
output = lld_lit_site_cfg_file
dir = get_path_info(output, "dir")
- extra_values = [
+ values = [
+ "LIT_SITE_CFG_IN_HEADER=## Autogenerated from $input, do not edit",
+ "LLD_BINARY_DIR=" + rebase_path(get_label_info("//lld", "target_out_dir")),
+ "CURRENT_LIBS_DIR=", # FIXME: for shared builds only (?)
+ "CURRENT_TOOLS_DIR=" + rebase_path("$root_out_dir/bin"),
"ENABLE_BACKTRACES=1",
+ "LLD_SOURCE_DIR=" + rebase_path("//lld"),
+ "LLVM_BINARY_DIR=" +
+ rebase_path(get_label_info("//llvm", "target_out_dir")),
"LLVM_HOST_TRIPLE=$llvm_current_triple",
"LLVM_LIBS_DIR=", # needed only for shared builds
"LLVM_LIT_TOOLS_DIR=", # Intentionally empty, matches cmake build.
+ "LLVM_SOURCE_DIR=" + rebase_path("//llvm"),
+ "LLVM_TOOLS_DIR=" + rebase_path("$root_out_dir/bin"),
"Python3_EXECUTABLE=$python_path",
"LLVM_TARGET_TRIPLE=$llvm_target_triple",
@@ -49,7 +35,7 @@ write_lit_cfg("lit_site_cfg") {
]
if (host_os == "win") {
- extra_values += [
+ values += [
"LLVM_LIT_ERRC_MESSAGES=no such file or directory;is a directory;" +
"invalid argument;permission denied",
"LLVM_ENABLE_PLUGINS=0",
@@ -58,7 +44,7 @@ write_lit_cfg("lit_site_cfg") {
"SHLIBDIR=" + rebase_path("$root_out_dir/bin", dir),
]
} else {
- extra_values += [
+ values += [
"LLVM_LIT_ERRC_MESSAGES=",
"LLVM_ENABLE_PLUGINS=1",
"SHLIBDIR=" + rebase_path("$root_out_dir/lib", dir),
@@ -66,53 +52,36 @@ write_lit_cfg("lit_site_cfg") {
}
if (host_os == "mac") {
- extra_values += [ "SHLIBEXT=.dylib" ]
+ values += [ "SHLIBEXT=.dylib" ]
} else if (host_os == "win") {
- extra_values += [ "SHLIBEXT=.dll" ]
+ values += [ "SHLIBEXT=.dll" ]
} else {
- extra_values += [ "SHLIBEXT=.so" ]
+ values += [ "SHLIBEXT=.so" ]
}
if (llvm_enable_dia_sdk) {
- extra_values += [ "LLVM_ENABLE_DIA_SDK=1" ]
+ values += [ "LLVM_ENABLE_DIA_SDK=1" ]
} else {
- extra_values += [ "LLVM_ENABLE_DIA_SDK=0" ] # Must be 0.
+ values += [ "LLVM_ENABLE_DIA_SDK=0" ] # Must be 0.
}
if (llvm_enable_libxml2) {
- extra_values += [ "LLVM_ENABLE_LIBXML2=1" ]
+ values += [ "LLVM_ENABLE_LIBXML2=1" ]
} else {
- extra_values += [ "LLVM_ENABLE_LIBXML2=0" ] # Must be 0.
+ values += [ "LLVM_ENABLE_LIBXML2=0" ] # Must be 0.
}
if (llvm_enable_zlib) {
- extra_values += [ "LLVM_ENABLE_ZLIB=1" ]
+ values += [ "LLVM_ENABLE_ZLIB=1" ]
} else {
- extra_values += [ "LLVM_ENABLE_ZLIB=0" ] # Must be 0.
+ values += [ "LLVM_ENABLE_ZLIB=0" ] # Must be 0.
}
if (current_cpu == "x64" || current_cpu == "arm64" ||
current_cpu == "ppc64") {
- extra_values += [ "CMAKE_SIZEOF_VOID_P=8" ]
- } else {
- extra_values += [ "CMAKE_SIZEOF_VOID_P=4" ]
- }
-}
-
-write_lit_cfg("lit_unit_site_cfg") {
- # Fully-qualified instead of relative for LIT_SITE_CFG_IN_HEADER.
- input = "//lld/test/Unit/lit.site.cfg.py.in"
- output = lld_lit_unit_site_cfg_file
- extra_values = [
- "ENABLE_SHARED=0",
- "LLVM_BUILD_MODE=.",
- ]
- dir = get_path_info(output, "dir")
- if (host_os == "win") {
- # See comment for Windows solink in llvm/utils/gn/build/toolchain/BUILD.gn
- extra_values += [ "SHLIBDIR=" + rebase_path("$root_out_dir/bin", dir) ]
+ values += [ "CMAKE_SIZEOF_VOID_P=8" ]
} else {
- extra_values += [ "SHLIBDIR=" + rebase_path("$root_out_dir/lib", dir) ]
+ values += [ "CMAKE_SIZEOF_VOID_P=4" ]
}
}
@@ -122,9 +91,7 @@ write_lit_cfg("lit_unit_site_cfg") {
group("test") {
deps = [
":lit_site_cfg",
- ":lit_unit_site_cfg",
"//lld/tools/lld:symlinks",
- "//lld/unittests",
"//llvm/tools/dsymutil",
"//llvm/tools/llc",
"//llvm/tools/llvm-ar:symlinks",
diff --git a/llvm/utils/gn/secondary/lld/unittests/AsLibAll/BUILD.gn b/llvm/utils/gn/secondary/lld/unittests/AsLibAll/BUILD.gn
deleted file mode 100644
index d6af6a1c73792..0000000000000
--- a/llvm/utils/gn/secondary/lld/unittests/AsLibAll/BUILD.gn
+++ /dev/null
@@ -1,14 +0,0 @@
-import("//third-party/unittest/unittest.gni")
-
-unittest("LLDAsLibAllTests") {
- configs += [ "//llvm/utils/gn/build:lld_code" ]
- deps = [
- "//lld/Common",
- "//lld/COFF",
- "//lld/ELF",
- "//lld/MachO",
- "//lld/MinGW",
- "//lld/wasm",
- ]
- sources = [ "AllDrivers.cpp" ]
-}
diff --git a/llvm/utils/gn/secondary/lld/unittests/AsLibELF/BUILD.gn b/llvm/utils/gn/secondary/lld/unittests/AsLibELF/BUILD.gn
deleted file mode 100644
index e22a0eec1ff02..0000000000000
--- a/llvm/utils/gn/secondary/lld/unittests/AsLibELF/BUILD.gn
+++ /dev/null
@@ -1,13 +0,0 @@
-import("//third-party/unittest/unittest.gni")
-
-unittest("LLDAsLibELFTests") {
- configs += [ "//llvm/utils/gn/build:lld_code" ]
- deps = [
- "//lld/Common",
- "//lld/ELF",
- ]
- sources = [
- "ROCm.cpp",
- "SomeDrivers.cpp",
- ]
-}
diff --git a/llvm/utils/gn/secondary/lld/unittests/BUILD.gn b/llvm/utils/gn/secondary/lld/unittests/BUILD.gn
deleted file mode 100644
index c909670f4b1ba..0000000000000
--- a/llvm/utils/gn/secondary/lld/unittests/BUILD.gn
+++ /dev/null
@@ -1,8 +0,0 @@
-group("unittests") {
- deps = [
- "AsLibAll:LLDAsLibAllTests",
- "AsLibELF:LLDAsLibELFTests",
- ]
- testonly = true
-}
-
diff --git a/llvm/utils/gn/secondary/llvm/utils/llvm-lit/BUILD.gn b/llvm/utils/gn/secondary/llvm/utils/llvm-lit/BUILD.gn
index 5d3497e7e0044..f9b71bf33cd04 100644
--- a/llvm/utils/gn/secondary/llvm/utils/llvm-lit/BUILD.gn
+++ b/llvm/utils/gn/secondary/llvm/utils/llvm-lit/BUILD.gn
@@ -31,7 +31,6 @@ write_cmake_config("llvm-lit") {
"//clang/test:lit_site_cfg",
"//clang/test:lit_unit_site_cfg",
"//lld/test:lit_site_cfg",
- "//lld/test:lit_unit_site_cfg",
"//lldb/test:lit_api_site_cfg",
"//lldb/test:lit_shell_site_cfg",
"//lldb/test:lit_site_cfg",
More information about the llvm-commits
mailing list