forked from OSchip/llvm-project
[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++.
This commit is contained in:
parent
0a7d2b5f50
commit
5d1c43f333
|
@ -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
|
||||
# ===================================================
|
||||
|
|
|
@ -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
|
||||
})
|
||||
|
|
|
@ -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),
|
||||
|
|
Loading…
Reference in New Issue