From 5893ca0f99224f514276fd75b83efca975ea3f71 Mon Sep 17 00:00:00 2001 From: Keith Smiley Date: Wed, 23 Apr 2025 11:22:57 -0700 Subject: [PATCH] [bazel] Use non_arc_srcs instead of passing -fno-objc-arc This is the recommended way in bazel to differentiate between files that require arc and those that require it be disabled. This matters depending on the toolchain since the order of these flags may not have been correct and we were relying on overwriting the default. --- utils/bazel/llvm-project-overlay/lldb/BUILD.bazel | 8 +++----- .../llvm-project-overlay/lldb/source/Plugins/BUILD.bazel | 2 +- .../lldb/source/Plugins/plugin_config.bzl | 1 - 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/utils/bazel/llvm-project-overlay/lldb/BUILD.bazel b/utils/bazel/llvm-project-overlay/lldb/BUILD.bazel index d1bacf9d03360..809dbefcef5e9 100644 --- a/utils/bazel/llvm-project-overlay/lldb/BUILD.bazel +++ b/utils/bazel/llvm-project-overlay/lldb/BUILD.bazel @@ -484,10 +484,8 @@ cc_library( objc_library( name = "HostMacOSXObjCXX", - srcs = glob([ - "source/Host/macosx/objcxx/*.mm", - ]), copts = OBJCPP_COPTS, + non_arc_srcs = glob(["source/Host/macosx/objcxx/*.mm"]), tags = ["nobuildkite"], target_compatible_with = select({ "@platforms//os:macos": [], @@ -832,9 +830,9 @@ cc_binary( deps = [ ":APIHeaders", ":Host", + ":UtilityHeaders", ":liblldb.wrapper", ":lldb_options_inc_gen", - ":UtilityHeaders", "//llvm:Option", "//llvm:Support", ], @@ -855,8 +853,8 @@ cc_library( objc_library( name = "DebugServerMacOSX", - srcs = glob(["tools/debugserver/source/MacOSX/*.mm"]), copts = OBJCPP_COPTS, + non_arc_srcs = glob(["tools/debugserver/source/MacOSX/*.mm"]), tags = ["nobuildkite"], target_compatible_with = select({ "@platforms//os:macos": [], diff --git a/utils/bazel/llvm-project-overlay/lldb/source/Plugins/BUILD.bazel b/utils/bazel/llvm-project-overlay/lldb/source/Plugins/BUILD.bazel index b204d8fa04584..f01023bfff6e4 100644 --- a/utils/bazel/llvm-project-overlay/lldb/source/Plugins/BUILD.bazel +++ b/utils/bazel/llvm-project-overlay/lldb/source/Plugins/BUILD.bazel @@ -238,8 +238,8 @@ cc_library( objc_library( name = "PluginPlatformMacOSXObjCXX", - srcs = glob(["Platform/MacOSX/objcxx/*.mm"]), copts = OBJCPP_COPTS, + non_arc_srcs = glob(["Platform/MacOSX/objcxx/*.mm"]), tags = ["nobuildkite"], target_compatible_with = select({ "@platforms//os:macos": [], diff --git a/utils/bazel/llvm-project-overlay/lldb/source/Plugins/plugin_config.bzl b/utils/bazel/llvm-project-overlay/lldb/source/Plugins/plugin_config.bzl index 5949d2d7a504c..2a8bba52c2a6a 100644 --- a/utils/bazel/llvm-project-overlay/lldb/source/Plugins/plugin_config.bzl +++ b/utils/bazel/llvm-project-overlay/lldb/source/Plugins/plugin_config.bzl @@ -99,6 +99,5 @@ DEFAULT_SCRIPT_PLUGINS = [ OBJCPP_COPTS = [ "-std=c++{}".format(CMAKE_CXX_STANDARD), "-fno-objc-exceptions", - "-fno-objc-arc", "-Wno-shorten-64-to-32", ]