[Lldb-commits] [lldb] 44fc987 - [lldb][test] Toolchain detection rewrite in Python (#102185)
via lldb-commits
lldb-commits at lists.llvm.org
Wed Sep 11 06:04:04 PDT 2024
Author: Vladislav Dzhidzhoev
Date: 2024-09-11T16:04:01+03:00
New Revision: 44fc987ed174e32544a577387ab0df6886495e82
URL: https://github.com/llvm/llvm-project/commit/44fc987ed174e32544a577387ab0df6886495e82
DIFF: https://github.com/llvm/llvm-project/commit/44fc987ed174e32544a577387ab0df6886495e82.diff
LOG: [lldb][test] Toolchain detection rewrite in Python (#102185)
This fix is based on a problem with cxx_compiler and cxx_linker macros
on Windows.
There was an issue with compiler detection in paths containing "icc". In
such case, Makefile.rules thought it was provided with icc compiler.
To solve that, utilities detection has been rewritten in Python.
The last element of compiler's path is separated, taking into account
the platform path delimiter, and compiler type is extracted, with regard
of possible cross-toolchain prefix.
---------
Co-authored-by: Pavel Labath <pavel at labath.sk>
Added:
Modified:
lldb/packages/Python/lldbsuite/test/builders/builder.py
lldb/packages/Python/lldbsuite/test/make/Makefile.rules
lldb/test/API/functionalities/breakpoint/breakpoint_ids/Makefile
lldb/test/API/functionalities/breakpoint/breakpoint_locations/Makefile
lldb/test/API/functionalities/breakpoint/consecutive_breakpoints/Makefile
lldb/test/API/functionalities/breakpoint/cpp/Makefile
lldb/test/API/functionalities/breakpoint/dummy_target_breakpoints/Makefile
lldb/test/API/functionalities/breakpoint/hardware_breakpoints/require_hw_breakpoints/Makefile
lldb/test/API/functionalities/breakpoint/step_over_breakpoint/Makefile
lldb/test/API/functionalities/breakpoint/thread_plan_user_breakpoint/Makefile
lldb/test/API/functionalities/data-formatter/data-formatter-objc/ObjCDataFormatterTestCase.py
lldb/test/API/functionalities/data-formatter/nsdictionarysynth/TestNSDictionarySynthetic.py
lldb/test/API/functionalities/data-formatter/nssetsynth/TestNSSetSynthetic.py
lldb/test/API/functionalities/data-formatter/poarray/TestPrintObjectArray.py
lldb/test/API/functionalities/inline-stepping/Makefile
lldb/test/API/functionalities/postmortem/minidump-new/makefile.txt
lldb/test/API/lang/objc/orderedset/TestOrderedSet.py
lldb/test/API/lang/objc/single-entry-dictionary/TestObjCSingleEntryDictionary.py
lldb/test/API/macosx/macCatalyst/Makefile
lldb/test/API/macosx/macCatalystAppMacOSFramework/Makefile
lldb/test/API/macosx/simulator/TestSimulatorPlatform.py
lldb/test/API/python_api/frame/inlines/Makefile
lldb/test/API/tools/lldb-server/TestAppleSimulatorOSType.py
Removed:
################################################################################
diff --git a/lldb/packages/Python/lldbsuite/test/builders/builder.py b/lldb/packages/Python/lldbsuite/test/builders/builder.py
index 4ea9a86c1d5fc9..564918c58b6dd2 100644
--- a/lldb/packages/Python/lldbsuite/test/builders/builder.py
+++ b/lldb/packages/Python/lldbsuite/test/builders/builder.py
@@ -1,10 +1,12 @@
import os
+import pathlib
import platform
import subprocess
import sys
import itertools
import lldbsuite.test.lldbtest as lldbtest
+import lldbsuite.test.lldbplatformutil as lldbplatformutil
import lldbsuite.test.lldbutil as lldbutil
from lldbsuite.test import configuration
from lldbsuite.test_event import build_exception
@@ -96,17 +98,101 @@ def getArchSpec(self, architecture):
"""
return ["ARCH=" + architecture] if architecture else []
- def getCCSpec(self, compiler):
+ def getToolchainSpec(self, compiler):
"""
- Helper function to return the key-value string to specify the compiler
+ Helper function to return the key-value strings to specify the toolchain
used for the make system.
"""
cc = compiler if compiler else None
if not cc and configuration.compiler:
cc = configuration.compiler
- if cc:
- return ['CC="%s"' % cc]
- return []
+
+ if not cc:
+ return []
+
+ cc = cc.strip()
+ cc_path = pathlib.Path(cc)
+
+ # We can get CC compiler string in the following formats:
+ # [<tool>] <compiler> - such as 'xrun clang', 'xrun /usr/bin/clang' & etc
+ #
+ # Where <compiler> could contain the following parts:
+ # <simple-name>[.<exe-ext>] - sucn as 'clang', 'clang.exe' ('clang-cl.exe'?)
+ # <target-triple>-<simple-name>[.<exe-ext>] - such as 'armv7-linux-gnueabi-gcc'
+ # <path>/<simple-name>[.<exe-ext>] - such as '/usr/bin/clang', 'c:\path\to\compiler\clang,exe'
+ # <path>/<target-triple>-<simple-name>[.<exe-ext>] - such as '/usr/bin/clang', 'c:\path\to\compiler\clang,exe'
+
+ cc_ext = cc_path.suffix
+ # Compiler name without extension
+ cc_name = cc_path.stem.split(" ")[-1]
+
+ # A kind of compiler (canonical name): clang, gcc, cc & etc.
+ cc_type = cc_name
+ # A triple prefix of compiler name: <armv7-none-linux-gnu->gcc
+ cc_prefix = ""
+ if not "clang-cl" in cc_name and not "llvm-gcc" in cc_name:
+ cc_name_parts = cc_name.split("-")
+ cc_type = cc_name_parts[-1]
+ if len(cc_name_parts) > 1:
+ cc_prefix = "-".join(cc_name_parts[:-1]) + "-"
+
+ # A kind of C++ compiler.
+ cxx_types = {
+ "icc": "icpc",
+ "llvm-gcc": "llvm-g++",
+ "gcc": "g++",
+ "cc": "c++",
+ "clang": "clang++",
+ }
+ cxx_type = cxx_types.get(cc_type, cc_type)
+
+ cc_dir = cc_path.parent
+
+ def getToolchainUtil(util_name):
+ return cc_dir / (cc_prefix + util_name + cc_ext)
+
+ cxx = getToolchainUtil(cxx_type)
+
+ util_names = {
+ "OBJCOPY": "objcopy",
+ "STRIP": "strip",
+ "ARCHIVER": "ar",
+ "DWP": "dwp",
+ }
+ utils = []
+
+ if not lldbplatformutil.platformIsDarwin():
+ if cc_type in ["clang", "cc", "gcc"]:
+ util_paths = {}
+ # Assembly a toolchain side tool cmd based on passed CC.
+ for var, name in util_names.items():
+ # Do not override explicity specified tool from the cmd line.
+ if not os.getenv(var):
+ util_paths[var] = getToolchainUtil(name)
+ else:
+ util_paths[var] = os.getenv(var)
+ utils.extend(["AR=%s" % util_paths["ARCHIVER"]])
+
+ # Look for llvm-dwp or gnu dwp
+ if not lldbutil.which(util_paths["DWP"]):
+ util_paths["DWP"] = getToolchainUtil("llvm-dwp")
+ if not lldbutil.which(util_paths["DWP"]):
+ util_paths["DWP"] = lldbutil.which("llvm-dwp")
+ if not util_paths["DWP"]:
+ util_paths["DWP"] = lldbutil.which("dwp")
+ if not util_paths["DWP"]:
+ del util_paths["DWP"]
+
+ for var, path in util_paths.items():
+ utils.append("%s=%s" % (var, path))
+ else:
+ utils.extend(["AR=%slibtool" % os.getenv("CROSS_COMPILE", "")])
+
+ return [
+ "CC=%s" % cc,
+ "CC_TYPE=%s" % cc_type,
+ "CXX=%s" % cxx,
+ ] + utils
def getSDKRootSpec(self):
"""
@@ -178,7 +264,7 @@ def getBuildCommand(
make_targets,
self.getArchCFlags(architecture),
self.getArchSpec(architecture),
- self.getCCSpec(compiler),
+ self.getToolchainSpec(compiler),
self.getExtraMakeArgs(),
self.getSDKRootSpec(),
self.getModuleCacheSpec(),
diff --git a/lldb/packages/Python/lldbsuite/test/make/Makefile.rules b/lldb/packages/Python/lldbsuite/test/make/Makefile.rules
index 1ba3f843e87cf3..f81db9bc06d8a8 100644
--- a/lldb/packages/Python/lldbsuite/test/make/Makefile.rules
+++ b/lldb/packages/Python/lldbsuite/test/make/Makefile.rules
@@ -102,15 +102,22 @@ endif
# If you change the defaults of CC, be sure to also change it in the file
# test/builders/builder_base.py, which provides a Python way to return the
# value of the make variable CC -- getCompiler().
-#
-# See also these functions:
-# o cxx_compiler
-# o cxx_linker
#----------------------------------------------------------------------
ifeq "$(CC)" ""
$(error "C compiler is not specified. Please run tests through lldb-dotest or lit")
endif
+# Always override the linker. Assign already normalized CC.
+override LD := $(CC)
+# A kind of linker. It always gets retrieved from CC.
+override LDC := $(CC_TYPE)
+
+ifeq "$(HOST_OS)" "Windows_NT"
+ # This function enframes the full path with the platform specific quotes. This is necessary to run the c++ executable
+ # properly under 'sh' on Windows host (prevent the path breakage because of Windows style path separators).
+ override CXX := $(QUOTE)$(CXX)$(QUOTE)
+endif
+
#----------------------------------------------------------------------
# Handle SDKROOT for the cross platform builds.
#----------------------------------------------------------------------
@@ -147,10 +154,8 @@ ifeq "$(OS)" "Darwin"
DS := $(DSYMUTIL)
DSFLAGS := $(DSFLAGS_EXTRAS)
DSYM = $(EXE).dSYM
- AR := $(CROSS_COMPILE)libtool
ARFLAGS := -static -o
else
- AR := $(CROSS_COMPILE)ar
# On non-Apple platforms, -arch becomes -m
ARCHFLAG := -m
@@ -213,7 +218,7 @@ endif
LIMIT_DEBUG_INFO_FLAGS =
NO_LIMIT_DEBUG_INFO_FLAGS =
MODULE_DEBUG_INFO_FLAGS =
-ifneq (,$(findstring clang,$(CC)))
+ifeq ($(CC_TYPE), clang)
LIMIT_DEBUG_INFO_FLAGS += -flimit-debug-info
NO_LIMIT_DEBUG_INFO_FLAGS += -fno-limit-debug-info
MODULE_DEBUG_INFO_FLAGS += -gmodules
@@ -279,7 +284,6 @@ endif
CFLAGS += $(CFLAGS_EXTRAS)
CXXFLAGS += -std=c++11 $(CFLAGS) $(ARCH_CXXFLAGS)
-LD = $(CC)
# Copy common options to the linker flags (dwarf, arch. & etc).
# Note: we get some 'garbage' options for linker here (such as -I, --isystem & etc).
LDFLAGS += $(CFLAGS)
@@ -312,61 +316,6 @@ ifneq "$(DYLIB_NAME)" ""
endif
endif
-# Function that returns the counterpart C++ compiler, given $(CC) as arg.
-cxx_compiler_notdir = $(if $(findstring icc,$(1)), \
- $(subst icc,icpc,$(1)), \
- $(if $(findstring llvm-gcc,$(1)), \
- $(subst llvm-gcc,llvm-g++,$(1)), \
- $(if $(findstring gcc,$(1)), \
- $(subst gcc,g++,$(1)), \
- $(subst cc,c++,$(1)))))
-cxx_compiler = $(if $(findstring /,$(1)),$(join $(dir $(1)), $(call cxx_compiler_notdir,$(notdir $(1)))),$(call cxx_compiler_notdir,$(1)))
-
-# Function that returns the C++ linker, given $(CC) as arg.
-cxx_linker_notdir = $(if $(findstring icc,$(1)), \
- $(subst icc,icpc,$(1)), \
- $(if $(findstring llvm-gcc,$(1)), \
- $(subst llvm-gcc,llvm-g++,$(1)), \
- $(if $(findstring gcc,$(1)), \
- $(subst gcc,g++,$(1)), \
- $(subst cc,c++,$(1)))))
-cxx_linker = $(if $(findstring /,$(1)),$(join $(dir $(1)), $(call cxx_linker_notdir,$(notdir $(1)))),$(call cxx_linker_notdir,$(1)))
-
-ifneq "$(OS)" "Darwin"
- CLANG_OR_GCC := $(strip $(if $(findstring clang,$(CC)), \
- $(findstring clang,$(CC)), \
- $(if $(findstring gcc,$(CC)), \
- $(findstring gcc,$(CC)), \
- cc)))
-
- CC_LASTWORD := $(strip $(lastword $(subst -, ,$(CC))))
-
- replace_with = $(strip $(if $(findstring $(3),$(CC_LASTWORD)), \
- $(subst $(3),$(1),$(2)), \
- $(subst $(3),$(1),$(subst -$(CC_LASTWORD),,$(2)))))
-
- ifeq "$(notdir $(CC))" "$(CC)"
- replace_cc_with = $(call replace_with,$(1),$(CC),$(CLANG_OR_GCC))
- else
- replace_cc_with = $(join $(dir $(CC)),$(call replace_with,$(1),$(notdir $(CC)),$(CLANG_OR_GCC)))
- endif
-
- OBJCOPY ?= $(call replace_cc_with,objcopy)
- ARCHIVER ?= $(call replace_cc_with,ar)
- # Look for llvm-dwp or gnu dwp
- DWP ?= $(call replace_cc_with,llvm-dwp)
- ifeq ($(wildcard $(DWP)),)
- DWP = $(call replace_cc_with,dwp)
- ifeq ($(wildcard $(DWP)),)
- DWP = $(shell command -v llvm-dwp 2> /dev/null)
- ifeq ($(wildcard $(DWP)),)
- DWP = $(shell command -v dwp 2> /dev/null)
- endif
- endif
- endif
- override AR = $(ARCHIVER)
-endif
-
ifdef PIE
LDFLAGS += -pie
endif
@@ -375,7 +324,7 @@ endif
# Windows specific options
#----------------------------------------------------------------------
ifeq "$(OS)" "Windows_NT"
- ifneq (,$(findstring clang,$(CC)))
+ ifeq ($(CC_TYPE), clang)
# Clang for Windows doesn't support C++ Exceptions
CXXFLAGS += -fno-exceptions
CXXFLAGS += -D_HAS_EXCEPTIONS=0
@@ -420,7 +369,7 @@ endif
ifeq (1,$(USE_LIBSTDCPP))
# Clang requires an extra flag: -stdlib=libstdc++
- ifneq (,$(findstring clang,$(CC)))
+ ifeq ($(CC_TYPE), clang)
# Force clang looking for the gcc's headers at specific rootfs folder.
CXXFLAGS += -stdlib=libstdc++ $(GCC_TOOLCHAIN_FLAGS)
LDFLAGS += -stdlib=libstdc++ $(GCC_TOOLCHAIN_FLAGS)
@@ -458,7 +407,7 @@ ifeq (1, $(USE_SYSTEM_STDLIB))
CXXFLAGS += -nostdlib++ -nostdinc++ -cxx-isystem $(SDKROOT)/usr/include/c++/v1
LDFLAGS += -L$(SDKROOT)/usr/lib -Wl,-rpath,$(SDKROOT)/usr/lib -lc++
else
- ifneq (,$(findstring clang,$(CC)))
+ ifeq ($(CC_TYPE),clang)
# Force clang looking for the gcc's headers at specific rootfs folder.
CXXFLAGS += $(GCC_TOOLCHAIN_FLAGS)
LDFLAGS += $(GCC_TOOLCHAIN_FLAGS)
@@ -485,8 +434,6 @@ DYLIB_OBJECTS +=$(strip $(DYLIB_C_SOURCES:.c=.o))
DYLIB_OBJECTS +=$(strip $(DYLIB_OBJC_SOURCES:.m=.o))
ifneq "$(strip $(DYLIB_CXX_SOURCES))" ""
DYLIB_OBJECTS +=$(strip $(patsubst %.mm, %.o, $(DYLIB_CXX_SOURCES:.cpp=.o)))
- CXX = $(call cxx_compiler,$(CC))
- LD = $(call cxx_linker,$(CC))
endif
#----------------------------------------------------------------------
@@ -509,8 +456,6 @@ endif
#----------------------------------------------------------------------
ifneq "$(strip $(CXX_SOURCES))" ""
OBJECTS +=$(strip $(CXX_SOURCES:.cpp=.o))
- CXX = $(call cxx_compiler,$(CC))
- LD = $(call cxx_linker,$(CC))
endif
#----------------------------------------------------------------------
@@ -526,19 +471,18 @@ endif
#----------------------------------------------------------------------
ifneq "$(strip $(OBJCXX_SOURCES))" ""
OBJECTS +=$(strip $(OBJCXX_SOURCES:.mm=.o))
- CXX = $(call cxx_compiler,$(CC))
- LD = $(call cxx_linker,$(CC))
ifeq "$(findstring lobjc,$(LDFLAGS))" ""
LDFLAGS +=-lobjc
endif
endif
-ifeq ($(findstring clang, $(CXX)), clang)
+ifeq ($(CC_TYPE), clang)
CXXFLAGS += --driver-mode=g++
endif
ifneq "$(CXX)" ""
- ifeq ($(findstring clang, $(LD)), clang)
+ # Specify the driver mode parameter if we use clang as the linker.
+ ifeq ($(LDC), clang)
LDFLAGS += --driver-mode=g++
endif
endif
diff --git a/lldb/test/API/functionalities/breakpoint/breakpoint_ids/Makefile b/lldb/test/API/functionalities/breakpoint/breakpoint_ids/Makefile
index 2c00681fa22804..778d3e58ab56fa 100644
--- a/lldb/test/API/functionalities/breakpoint/breakpoint_ids/Makefile
+++ b/lldb/test/API/functionalities/breakpoint/breakpoint_ids/Makefile
@@ -1,6 +1,6 @@
CXX_SOURCES := main.cpp
-ifneq (,$(findstring icc,$(CC)))
+ifeq ($(CC_TYPE), icc)
CXXFLAGS_EXTRAS := -debug inline-debug-info
endif
diff --git a/lldb/test/API/functionalities/breakpoint/breakpoint_locations/Makefile b/lldb/test/API/functionalities/breakpoint/breakpoint_locations/Makefile
index 9645fd9cc8dfbc..304633c2dca1f2 100644
--- a/lldb/test/API/functionalities/breakpoint/breakpoint_locations/Makefile
+++ b/lldb/test/API/functionalities/breakpoint/breakpoint_locations/Makefile
@@ -1,6 +1,6 @@
C_SOURCES := main.c
-ifneq (,$(findstring icc,$(CC)))
+ifeq ($(CC_TYPE), icc)
CFLAGS_EXTRAS := -debug inline-debug-info
endif
diff --git a/lldb/test/API/functionalities/breakpoint/consecutive_breakpoints/Makefile b/lldb/test/API/functionalities/breakpoint/consecutive_breakpoints/Makefile
index 2c00681fa22804..778d3e58ab56fa 100644
--- a/lldb/test/API/functionalities/breakpoint/consecutive_breakpoints/Makefile
+++ b/lldb/test/API/functionalities/breakpoint/consecutive_breakpoints/Makefile
@@ -1,6 +1,6 @@
CXX_SOURCES := main.cpp
-ifneq (,$(findstring icc,$(CC)))
+ifeq ($(CC_TYPE), icc)
CXXFLAGS_EXTRAS := -debug inline-debug-info
endif
diff --git a/lldb/test/API/functionalities/breakpoint/cpp/Makefile b/lldb/test/API/functionalities/breakpoint/cpp/Makefile
index 66108b79e7fe0b..3b4be01d551f46 100644
--- a/lldb/test/API/functionalities/breakpoint/cpp/Makefile
+++ b/lldb/test/API/functionalities/breakpoint/cpp/Makefile
@@ -1,7 +1,7 @@
CXX_SOURCES := main.cpp
CXXFLAGS_EXTRAS := -std=c++14
-ifneq (,$(findstring icc,$(CC)))
+ifeq ($(CC_TYPE), icc)
CXXFLAGS_EXTRAS := -debug inline-debug-info
endif
diff --git a/lldb/test/API/functionalities/breakpoint/dummy_target_breakpoints/Makefile b/lldb/test/API/functionalities/breakpoint/dummy_target_breakpoints/Makefile
index 9645fd9cc8dfbc..304633c2dca1f2 100644
--- a/lldb/test/API/functionalities/breakpoint/dummy_target_breakpoints/Makefile
+++ b/lldb/test/API/functionalities/breakpoint/dummy_target_breakpoints/Makefile
@@ -1,6 +1,6 @@
C_SOURCES := main.c
-ifneq (,$(findstring icc,$(CC)))
+ifeq ($(CC_TYPE), icc)
CFLAGS_EXTRAS := -debug inline-debug-info
endif
diff --git a/lldb/test/API/functionalities/breakpoint/hardware_breakpoints/require_hw_breakpoints/Makefile b/lldb/test/API/functionalities/breakpoint/hardware_breakpoints/require_hw_breakpoints/Makefile
index 9645fd9cc8dfbc..304633c2dca1f2 100644
--- a/lldb/test/API/functionalities/breakpoint/hardware_breakpoints/require_hw_breakpoints/Makefile
+++ b/lldb/test/API/functionalities/breakpoint/hardware_breakpoints/require_hw_breakpoints/Makefile
@@ -1,6 +1,6 @@
C_SOURCES := main.c
-ifneq (,$(findstring icc,$(CC)))
+ifeq ($(CC_TYPE), icc)
CFLAGS_EXTRAS := -debug inline-debug-info
endif
diff --git a/lldb/test/API/functionalities/breakpoint/step_over_breakpoint/Makefile b/lldb/test/API/functionalities/breakpoint/step_over_breakpoint/Makefile
index 2c00681fa22804..778d3e58ab56fa 100644
--- a/lldb/test/API/functionalities/breakpoint/step_over_breakpoint/Makefile
+++ b/lldb/test/API/functionalities/breakpoint/step_over_breakpoint/Makefile
@@ -1,6 +1,6 @@
CXX_SOURCES := main.cpp
-ifneq (,$(findstring icc,$(CC)))
+ifeq ($(CC_TYPE), icc)
CXXFLAGS_EXTRAS := -debug inline-debug-info
endif
diff --git a/lldb/test/API/functionalities/breakpoint/thread_plan_user_breakpoint/Makefile b/lldb/test/API/functionalities/breakpoint/thread_plan_user_breakpoint/Makefile
index 2c00681fa22804..778d3e58ab56fa 100644
--- a/lldb/test/API/functionalities/breakpoint/thread_plan_user_breakpoint/Makefile
+++ b/lldb/test/API/functionalities/breakpoint/thread_plan_user_breakpoint/Makefile
@@ -1,6 +1,6 @@
CXX_SOURCES := main.cpp
-ifneq (,$(findstring icc,$(CC)))
+ifeq ($(CC_TYPE), icc)
CXXFLAGS_EXTRAS := -debug inline-debug-info
endif
diff --git a/lldb/test/API/functionalities/data-formatter/data-formatter-objc/ObjCDataFormatterTestCase.py b/lldb/test/API/functionalities/data-formatter/data-formatter-objc/ObjCDataFormatterTestCase.py
index a0d6802b3a506a..c1cd9556c5ef3f 100644
--- a/lldb/test/API/functionalities/data-formatter/data-formatter-objc/ObjCDataFormatterTestCase.py
+++ b/lldb/test/API/functionalities/data-formatter/data-formatter-objc/ObjCDataFormatterTestCase.py
@@ -16,12 +16,12 @@ def appkit_tester_impl(self, commands, use_constant_classes):
self.build()
else:
disable_constant_classes = {
- "CC": "xcrun clang", # FIXME: Remove when flags are available upstream.
"CFLAGS_EXTRAS": "-fno-constant-nsnumber-literals "
+ "-fno-constant-nsarray-literals "
+ "-fno-constant-nsdictionary-literals",
}
- self.build(dictionary=disable_constant_classes)
+ # FIXME: Remove compiler when flags are available upstream.
+ self.build(dictionary=disable_constant_classes, compiler="xcrun clang")
self.appkit_common_data_formatters_command()
commands()
diff --git a/lldb/test/API/functionalities/data-formatter/nsdictionarysynth/TestNSDictionarySynthetic.py b/lldb/test/API/functionalities/data-formatter/nsdictionarysynth/TestNSDictionarySynthetic.py
index 9ac41d67eb9ab3..e1d7e42bdd1a99 100644
--- a/lldb/test/API/functionalities/data-formatter/nsdictionarysynth/TestNSDictionarySynthetic.py
+++ b/lldb/test/API/functionalities/data-formatter/nsdictionarysynth/TestNSDictionarySynthetic.py
@@ -26,12 +26,12 @@ def test_rdar11988289_with_run_command(self):
def test_rdar11988289_with_run_command_no_const(self):
"""Test that NSDictionary reports its synthetic children properly."""
disable_constant_classes = {
- "CC": "xcrun clang", # FIXME: Remove when flags are available upstream.
"CFLAGS_EXTRAS": "-fno-constant-nsnumber-literals "
+ "-fno-constant-nsarray-literals "
+ "-fno-constant-nsdictionary-literals",
}
- self.build(dictionary=disable_constant_classes)
+ # FIXME: Remove when flags are available upstream.
+ self.build(dictionary=disable_constant_classes, compiler="xcrun clang")
self.run_tests()
def run_tests(self):
diff --git a/lldb/test/API/functionalities/data-formatter/nssetsynth/TestNSSetSynthetic.py b/lldb/test/API/functionalities/data-formatter/nssetsynth/TestNSSetSynthetic.py
index 053ec0ee9757e0..1037e75c17eb34 100644
--- a/lldb/test/API/functionalities/data-formatter/nssetsynth/TestNSSetSynthetic.py
+++ b/lldb/test/API/functionalities/data-formatter/nssetsynth/TestNSSetSynthetic.py
@@ -26,12 +26,12 @@ def test_rdar12529957_with_run_command(self):
def test_rdar12529957_with_run_command_no_const(self):
"""Test that NSSet reports its synthetic children properly."""
disable_constant_classes = {
- "CC": "xcrun clang", # FIXME: Remove when flags are available upstream.
"CFLAGS_EXTRAS": "-fno-constant-nsnumber-literals "
+ "-fno-constant-nsarray-literals "
+ "-fno-constant-nsdictionary-literals",
}
- self.build(dictionary=disable_constant_classes)
+ # FIXME: Remove compiler when flags are available upstream.
+ self.build(dictionary=disable_constant_classes, compiler="xcrun clang")
self.run_tests()
def run_tests(self):
diff --git a/lldb/test/API/functionalities/data-formatter/poarray/TestPrintObjectArray.py b/lldb/test/API/functionalities/data-formatter/poarray/TestPrintObjectArray.py
index fff37829cd20dc..db86f48f8ec1fe 100644
--- a/lldb/test/API/functionalities/data-formatter/poarray/TestPrintObjectArray.py
+++ b/lldb/test/API/functionalities/data-formatter/poarray/TestPrintObjectArray.py
@@ -20,13 +20,13 @@ def test_print_array(self):
def test_print_array_no_const(self):
"""Test that expr -O -Z works"""
disable_constant_classes = {
- "CC": "xcrun clang", # FIXME: Remove when flags are available upstream.
"USE_SYSTEM_STDLIB": "1", # See above.
"CFLAGS_EXTRAS": "-fno-constant-nsnumber-literals "
+ "-fno-constant-nsarray-literals "
+ "-fno-constant-nsdictionary-literals",
}
- self.build(dictionary=disable_constant_classes)
+ # FIXME: Remove compiler when flags are available upstream.
+ self.build(dictionary=disable_constant_classes, compiler="xcrun clang")
self.printarray_data_formatter_commands()
def setUp(self):
diff --git a/lldb/test/API/functionalities/inline-stepping/Makefile b/lldb/test/API/functionalities/inline-stepping/Makefile
index 362b89d7f995b3..bf646c7b7db33f 100644
--- a/lldb/test/API/functionalities/inline-stepping/Makefile
+++ b/lldb/test/API/functionalities/inline-stepping/Makefile
@@ -1,6 +1,6 @@
CXX_SOURCES := calling.cpp
-ifneq (,$(findstring icc,$(CC)))
+ifeq ($(CC_TYPE), icc)
CXXFLAGS_EXTRAS := -debug inline-debug-info
endif
diff --git a/lldb/test/API/functionalities/postmortem/minidump-new/makefile.txt b/lldb/test/API/functionalities/postmortem/minidump-new/makefile.txt
index 7096efabdcfe1e..d594b585b2d5ff 100644
--- a/lldb/test/API/functionalities/postmortem/minidump-new/makefile.txt
+++ b/lldb/test/API/functionalities/postmortem/minidump-new/makefile.txt
@@ -19,6 +19,7 @@
# to generate a Minidump when the binary crashes/requests such.
#
CC=g++
+CC_TYPE=gcc
FLAGS=-g --std=c++11
INCLUDE=-I$HOME/breakpad/src/src/
LINK=-L. -lbreakpad -lpthread -nostdlib -lc -lstdc++ -lgcc_s -fno-exceptions
diff --git a/lldb/test/API/lang/objc/orderedset/TestOrderedSet.py b/lldb/test/API/lang/objc/orderedset/TestOrderedSet.py
index 14bfc322979b37..a7d6d9d155efca 100644
--- a/lldb/test/API/lang/objc/orderedset/TestOrderedSet.py
+++ b/lldb/test/API/lang/objc/orderedset/TestOrderedSet.py
@@ -12,12 +12,12 @@ def test_ordered_set(self):
@skipUnlessDarwin
def test_ordered_set_no_const(self):
disable_constant_classes = {
- "CC": "xcrun clang", # FIXME: Remove when flags are available upstream.
"CFLAGS_EXTRAS": "-fno-constant-nsnumber-literals "
+ "-fno-constant-nsarray-literals "
+ "-fno-constant-nsdictionary-literals",
}
- self.build(dictionary=disable_constant_classes)
+ # FIXME: Remove when flags are available upstream.
+ self.build(dictionary=disable_constant_classes, compiler="xcrun clang")
self.run_tests()
def run_tests(self):
diff --git a/lldb/test/API/lang/objc/single-entry-dictionary/TestObjCSingleEntryDictionary.py b/lldb/test/API/lang/objc/single-entry-dictionary/TestObjCSingleEntryDictionary.py
index 68c0af76b8e3b8..8debe731dfe1af 100644
--- a/lldb/test/API/lang/objc/single-entry-dictionary/TestObjCSingleEntryDictionary.py
+++ b/lldb/test/API/lang/objc/single-entry-dictionary/TestObjCSingleEntryDictionary.py
@@ -28,12 +28,12 @@ def test_single_entry_dict(self):
) # bug in NSDictionary formatting on watchos
def test_single_entry_dict_no_const(self):
disable_constant_classes = {
- "CC": "xcrun clang", # FIXME: Remove when flags are available upstream.
"CFLAGS_EXTRAS": "-fno-constant-nsnumber-literals "
+ "-fno-constant-nsarray-literals "
+ "-fno-constant-nsdictionary-literals",
}
- self.build(dictionary=disable_constant_classes)
+ # FIXME: Remove compiler when flags are available upstream.
+ self.build(dictionary=disable_constant_classes, compiler="xcrun clang")
self.run_tests()
def run_tests(self):
diff --git a/lldb/test/API/macosx/macCatalyst/Makefile b/lldb/test/API/macosx/macCatalyst/Makefile
index 3f084968a2d57b..ef17d89d2372c5 100644
--- a/lldb/test/API/macosx/macCatalyst/Makefile
+++ b/lldb/test/API/macosx/macCatalyst/Makefile
@@ -7,6 +7,7 @@ USE_SYSTEM_STDLIB := 1
# FIXME: rdar://problem/54986190
# There is a Clang driver change missing on llvm.org.
+override CC_TYPE=clang
override CC=xcrun clang
include Makefile.rules
diff --git a/lldb/test/API/macosx/macCatalystAppMacOSFramework/Makefile b/lldb/test/API/macosx/macCatalystAppMacOSFramework/Makefile
index b24fe3f574ccfc..c77a186724fda1 100644
--- a/lldb/test/API/macosx/macCatalystAppMacOSFramework/Makefile
+++ b/lldb/test/API/macosx/macCatalystAppMacOSFramework/Makefile
@@ -5,6 +5,7 @@ override TRIPLE := $(ARCH)-apple-ios13.0-macabi
CFLAGS_EXTRAS := -target $(TRIPLE)
# FIXME: rdar://problem/54986190
+override CC_TYPE=clang
override CC=xcrun clang
all: libfoo.dylib a.out
diff --git a/lldb/test/API/macosx/simulator/TestSimulatorPlatform.py b/lldb/test/API/macosx/simulator/TestSimulatorPlatform.py
index b712afdd7560a7..3f5645a486bcb4 100644
--- a/lldb/test/API/macosx/simulator/TestSimulatorPlatform.py
+++ b/lldb/test/API/macosx/simulator/TestSimulatorPlatform.py
@@ -59,10 +59,10 @@ def run_with(self, arch, os, vers, env, expected_load_command):
self.build(
dictionary={
"ARCH": arch,
- "CC": clang,
"ARCH_CFLAGS": "-target {} {}".format(triple, version_min),
"SDKROOT": sdk_root,
- }
+ },
+ compiler=clang,
)
self.check_load_commands(expected_load_command)
diff --git a/lldb/test/API/python_api/frame/inlines/Makefile b/lldb/test/API/python_api/frame/inlines/Makefile
index e6d9d8310a0fa8..cf17569a5e351a 100644
--- a/lldb/test/API/python_api/frame/inlines/Makefile
+++ b/lldb/test/API/python_api/frame/inlines/Makefile
@@ -1,6 +1,6 @@
C_SOURCES := inlines.c
-ifneq (,$(findstring icc,$(CC)))
+ifeq ($(CC_TYPE), icc)
CFLAGS_EXTRAS := -debug inline-debug-info
endif
diff --git a/lldb/test/API/tools/lldb-server/TestAppleSimulatorOSType.py b/lldb/test/API/tools/lldb-server/TestAppleSimulatorOSType.py
index 16297efe14372a..ed47f94e9492be 100644
--- a/lldb/test/API/tools/lldb-server/TestAppleSimulatorOSType.py
+++ b/lldb/test/API/tools/lldb-server/TestAppleSimulatorOSType.py
@@ -71,12 +71,12 @@ def check_simulator_ostype(self, sdk, platform_name, arch=platform.machine()):
self.build(
dictionary={
"EXE": exe_name,
- "CC": clang,
"SDKROOT": sdkroot.strip(),
"ARCH": arch,
"ARCH_CFLAGS": "-target {} {}".format(triple, version_min),
"USE_SYSTEM_STDLIB": 1,
- }
+ },
+ compiler=clang,
)
exe_path = os.path.realpath(self.getBuildArtifact(exe_name))
cmd = [
More information about the lldb-commits
mailing list