[llvm] [gn build] Allow specifying macOS deployment target (PR #107492)
Daniel Bertalan via llvm-commits
llvm-commits at lists.llvm.org
Thu Sep 5 18:05:53 PDT 2024
https://github.com/BertalanD updated https://github.com/llvm/llvm-project/pull/107492
>From fe8c49453f077d4f4be5c137b260c399d5da805a Mon Sep 17 00:00:00 2001
From: Daniel Bertalan <dani at danielbertalan.dev>
Date: Fri, 6 Sep 2024 02:19:00 +0200
Subject: [PATCH] [gn build] Bump macOS deployment target to 12 and make it
configurable
Bumping the target from macOS 10.10 to 12 enables chained fixups and
DWARF 4 debug information for the LLVM binaries and libraries.
Like in Chromium, a GN arg (`mac_deployment_target`) is added to allow
overriding the default.
---
llvm/utils/gn/build/BUILD.gn | 6 +++---
llvm/utils/gn/build/mac_sdk.gni | 4 ++++
llvm/utils/gn/build/toolchain/target_flags.gni | 2 +-
3 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/llvm/utils/gn/build/BUILD.gn b/llvm/utils/gn/build/BUILD.gn
index 68c0cbfd384a65..1ccaefdc21c822 100644
--- a/llvm/utils/gn/build/BUILD.gn
+++ b/llvm/utils/gn/build/BUILD.gn
@@ -72,9 +72,9 @@ config("compiler_defaults") {
ldflags += [ "-miphoneos-version-min=8.0" ]
}
if (current_os == "mac") {
- asmflags += [ "-mmacos-version-min=10.10" ]
- cflags += [ "-mmacos-version-min=10.10" ]
- ldflags += [ "-mmacos-version-min=10.10" ]
+ asmflags += [ "-mmacos-version-min=$mac_deployment_target" ]
+ cflags += [ "-mmacos-version-min=$mac_deployment_target" ]
+ ldflags += [ "-mmacos-version-min=$mac_deployment_target" ]
}
assert(symbol_level == 0 || symbol_level == 1 || symbol_level == 2,
diff --git a/llvm/utils/gn/build/mac_sdk.gni b/llvm/utils/gn/build/mac_sdk.gni
index af7044ba5c961f..9a9d35e71cccd7 100644
--- a/llvm/utils/gn/build/mac_sdk.gni
+++ b/llvm/utils/gn/build/mac_sdk.gni
@@ -2,6 +2,10 @@ import("//llvm/utils/gn/build/sysroot.gni")
have_ios_sdks = true
+declare_args() {
+ mac_deployment_target = "12"
+}
+
if (sysroot == "") {
declare_args() {
# Set to true if you don't have Xcode installed, but do have the commandline
diff --git a/llvm/utils/gn/build/toolchain/target_flags.gni b/llvm/utils/gn/build/toolchain/target_flags.gni
index 7a2a842afc1fb5..af8adcd2738668 100644
--- a/llvm/utils/gn/build/toolchain/target_flags.gni
+++ b/llvm/utils/gn/build/toolchain/target_flags.gni
@@ -47,7 +47,7 @@ if (current_os == "android") {
rebase_path(mac_sdk_path, root_build_dir),
# TODO(lgrey): We should be getting this from `compiler_defaults`. Why
# aren't we?
- "-mmacos-version-min=10.10",
+ "-mmacos-version-min=$mac_deployment_target",
]
}
} else if (current_os == "baremetal") {
More information about the llvm-commits
mailing list