From: Jonas Devlieghere Date: Wed, 21 Apr 2021 20:18:36 +0000 (-0700) Subject: [lldb] Use the compiler from the SDK in simulator tests X-Git-Tag: llvmorg-14-init~8884 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5d1c43f333c2327be61604dc90ea675f0d1e6913;p=platform%2Fupstream%2Fllvm.git [lldb] Use the compiler from the SDK in simulator tests Use the clang compiler from the SDK to build the simulator test programs to ensure we pick up the correct libc++. --- diff --git a/lldb/packages/Python/lldbsuite/test/lldbutil.py b/lldb/packages/Python/lldbsuite/test/lldbutil.py index 06a84c2..5fff372 100644 --- a/lldb/packages/Python/lldbsuite/test/lldbutil.py +++ b/lldb/packages/Python/lldbsuite/test/lldbutil.py @@ -95,6 +95,11 @@ def get_xcode_sdk_root(sdk): ]).rstrip().decode('utf-8') +def get_xcode_clang(sdk): + return subprocess.check_output(['xcrun', '-sdk', sdk, '-f', 'clang' + ]).rstrip().decode("utf-8") + + # =================================================== # Disassembly for an SBFunction or an SBSymbol object # =================================================== diff --git a/lldb/test/API/macosx/simulator/TestSimulatorPlatform.py b/lldb/test/API/macosx/simulator/TestSimulatorPlatform.py index 8a68f8e..3deb377 100644 --- a/lldb/test/API/macosx/simulator/TestSimulatorPlatform.py +++ b/lldb/test/API/macosx/simulator/TestSimulatorPlatform.py @@ -57,10 +57,12 @@ class TestSimulatorPlatformLaunching(TestBase): version_min = '-m{}-version-min={}'.format(os, vers) sdk_root = lldbutil.get_xcode_sdk_root(sdk) + clang = lldbutil.get_xcode_clang(sdk) self.build( dictionary={ 'ARCH': arch, + 'CC': clang, 'ARCH_CFLAGS': '-target {} {}'.format(triple, version_min), 'SDKROOT': sdk_root }) diff --git a/lldb/test/API/tools/lldb-server/TestAppleSimulatorOSType.py b/lldb/test/API/tools/lldb-server/TestAppleSimulatorOSType.py index dc5785f..0194234 100644 --- a/lldb/test/API/tools/lldb-server/TestAppleSimulatorOSType.py +++ b/lldb/test/API/tools/lldb-server/TestAppleSimulatorOSType.py @@ -51,6 +51,7 @@ class TestAppleSimulatorOSType(gdbremote_testcase.GdbRemoteTestCaseBase): exe_name = 'test_simulator_platform_{}'.format(platform_name) sdkroot = lldbutil.get_xcode_sdk_root(sdk) vers = lldbutil.get_xcode_sdk_version(sdk) + clang = lldbutil.get_xcode_clang(sdk) # Older versions of watchOS (<7.0) only support i386 if platform_name == 'watchos': @@ -63,6 +64,7 @@ class TestAppleSimulatorOSType(gdbremote_testcase.GdbRemoteTestCaseBase): self.build( dictionary={ 'EXE': exe_name, + 'CC': clang, 'SDKROOT': sdkroot.strip(), 'ARCH': arch, 'ARCH_CFLAGS': '-target {} {}'.format(triple, version_min),