[llvm] c78b6fd - [gn] build lldb-test with dead code stripping

Nico Weber via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 28 03:59:33 PDT 2024


Author: Nico Weber
Date: 2024-06-28T12:59:26+02:00
New Revision: c78b6fdf4602e9d43270581a9a5eeb1fd15c4f8d

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

LOG: [gn] build lldb-test with dead code stripping

Needed as a workaround for
https://github.com/llvm/llvm-project/pull/96985#pullrequestreview-2147599208

Hopefully this will be resolved soon and we can remove this again.

Added: 
    

Modified: 
    llvm/utils/gn/secondary/lldb/tools/lldb-test/BUILD.gn

Removed: 
    


################################################################################
diff  --git a/llvm/utils/gn/secondary/lldb/tools/lldb-test/BUILD.gn b/llvm/utils/gn/secondary/lldb/tools/lldb-test/BUILD.gn
index 96beba140581a..69861f3f94bd6 100644
--- a/llvm/utils/gn/secondary/lldb/tools/lldb-test/BUILD.gn
+++ b/llvm/utils/gn/secondary/lldb/tools/lldb-test/BUILD.gn
@@ -26,4 +26,12 @@ executable("lldb-test") {
     "SystemInitializerTest.cpp",
     "lldb-test.cpp",
   ]
+
+  if (current_os == "mac") {
+    ldflags = [ "-Wl,-dead_strip" ]
+  } else if (current_os == "win") {
+    ldflags = [ "/OPT:REF" ]
+  } else {
+    ldflags = [ "-Wl,--gc-sections" ]
+  }
 }


        


More information about the llvm-commits mailing list