From 1279b79c9bb10c15baab08a629ebc535b442af3b Mon Sep 17 00:00:00 2001 From: Nico Weber Date: Mon, 31 May 2021 13:17:10 -0400 Subject: [PATCH] [gn build] make libunwind build on macOS --- llvm/utils/gn/secondary/BUILD.gn | 4 +++- llvm/utils/gn/secondary/libunwind/src/BUILD.gn | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/llvm/utils/gn/secondary/BUILD.gn b/llvm/utils/gn/secondary/BUILD.gn index 50f1c4f26d6b..16b4c986d747 100644 --- a/llvm/utils/gn/secondary/BUILD.gn +++ b/llvm/utils/gn/secondary/BUILD.gn @@ -18,12 +18,14 @@ group("default") { deps += [ "//libcxx", "//libcxxabi", - "//libunwind", ] } if (current_os == "linux" || current_os == "android") { deps += [ "//compiler-rt/test/hwasan" ] } + if (current_os == "linux" || current_os == "mac") { + deps += [ "//libunwind" ] + } testonly = true } diff --git a/llvm/utils/gn/secondary/libunwind/src/BUILD.gn b/llvm/utils/gn/secondary/libunwind/src/BUILD.gn index c36341ca54b2..28869295c9de 100644 --- a/llvm/utils/gn/secondary/libunwind/src/BUILD.gn +++ b/llvm/utils/gn/secondary/libunwind/src/BUILD.gn @@ -84,8 +84,8 @@ if (libunwind_enable_shared) { } if (current_os == "mac") { ldflags += [ - "-compatibility_version 1", - "-install_name /usr/lib/libunwind.1.dylib", + "-Wl,-compatibility_version,1", + "-Wl,-install_name,/usr/lib/libunwind.1.dylib", ] } sources = unwind_sources