Skip to content

Commit 7b74d0b

Browse files
committed
[LLVM] adjust lit.cfg.py for Cygwin (llvm#151416)
Cygwin is like Windows in that it uses COFF, and doesn't emit .debug_frame on 64-bit architectures. However, if -elf is appended to the target triple on Cygwin MCJIT remote tests fail due to `__register_frame` not being defined. Only one test fails without -elf that succeeds with it, so mark just that test as XFAIL on Cygwin.
1 parent 73f0735 commit 7b74d0b

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

llvm/test/ExecutionEngine/MCJIT/stubs-sm-pic.ll

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
; RUN: %lli -jit-kind=mcjit -disable-lazy-compilation=false -relocation-model=pic -code-model=small %s
2-
; XFAIL: target={{(mips|mipsel)-.*}}, target={{(i686|i386).*}}, target={{(aarch64|arm).*}}
2+
; XFAIL: target={{(mips|mipsel)-.*}}, target={{(i686|i386).*}}, target={{(aarch64|arm).*}}, target={{.*-(cygwin|windows-cygnus)}}
3+
; This test segfaults on cygwin, but succeeds with cygwin-elf. Unfortunately,
4+
; cygwin-elf breaks the remote tests due to lack of __register_frame.
35

46
define i32 @main() nounwind {
57
entry:

llvm/test/lit.cfg.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,12 @@ def get_asan_rtlib():
100100
# we don't support COFF in MCJIT well enough for the tests, force ELF format on
101101
# Windows. FIXME: the process target triple should be used here, but this is
102102
# difficult to obtain on Windows.
103-
if re.search(r"cygwin|windows-gnu|windows-msvc", config.host_triple):
103+
# Cygwin is excluded from this workaround, even though it is COFF, because this
104+
# breaks remote tests due to not having a __register_frame function. The only
105+
# test that succeeds with cygwin-elf but fails with cygwin is
106+
# test/ExecutionEngine/MCJIT/stubs-sm-pic.ll so this test is marked as XFAIL
107+
# for cygwin targets.
108+
if re.search(r"windows-gnu|windows-msvc", config.host_triple):
104109
lli_args = ["-mtriple=" + config.host_triple + "-elf"]
105110

106111
llc_args = []
@@ -377,10 +382,11 @@ def version_int(ver):
377382
else:
378383
config.available_features.add("target-byteorder-little-endian")
379384

380-
if sys.platform in ["win32"]:
385+
if sys.platform in ["win32", "cygwin"]:
381386
# ExecutionEngine, no weak symbols in COFF.
382387
config.available_features.add("uses_COFF")
383-
else:
388+
389+
if sys.platform not in ["win32"]:
384390
# Others/can-execute.txt
385391
config.available_features.add("can-execute")
386392

@@ -651,7 +657,7 @@ def host_unwind_supports_jit():
651657

652658
# .debug_frame is not emitted for targeting Windows x64, aarch64/arm64, AIX, or Apple Silicon Mac.
653659
if not re.match(
654-
r"^(x86_64|aarch64|arm64|powerpc|powerpc64).*-(windows-gnu|windows-msvc|aix)",
660+
r"^(x86_64|aarch64|arm64|powerpc|powerpc64).*-(windows-cygnus|windows-gnu|windows-msvc|aix)",
655661
config.target_triple,
656662
) and not re.match(r"^arm64(e)?-apple-(macos|darwin)", config.target_triple):
657663
config.available_features.add("debug_frame")

0 commit comments

Comments
 (0)