Skip to content

Commit fac0321

Browse files
jeremyd2019krishna2803
authored andcommitted
[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 da08ee2 commit fac0321

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
@@ -117,7 +117,12 @@ def get_asan_rtlib():
117117
# we don't support COFF in MCJIT well enough for the tests, force ELF format on
118118
# Windows. FIXME: the process target triple should be used here, but this is
119119
# difficult to obtain on Windows.
120-
if re.search(r"cygwin|windows-gnu|windows-msvc", config.host_triple):
120+
# Cygwin is excluded from this workaround, even though it is COFF, because this
121+
# breaks remote tests due to not having a __register_frame function. The only
122+
# test that succeeds with cygwin-elf but fails with cygwin is
123+
# test/ExecutionEngine/MCJIT/stubs-sm-pic.ll so this test is marked as XFAIL
124+
# for cygwin targets.
125+
if re.search(r"windows-gnu|windows-msvc", config.host_triple):
121126
lli_args = ["-mtriple=" + config.host_triple + "-elf"]
122127

123128
llc_args = []
@@ -396,10 +401,11 @@ def version_int(ver):
396401
else:
397402
config.available_features.add("target-byteorder-little-endian")
398403

399-
if sys.platform in ["win32"]:
404+
if sys.platform in ["win32", "cygwin"]:
400405
# ExecutionEngine, no weak symbols in COFF.
401406
config.available_features.add("uses_COFF")
402-
else:
407+
408+
if sys.platform not in ["win32"]:
403409
# Others/can-execute.txt
404410
config.available_features.add("can-execute")
405411

@@ -668,7 +674,7 @@ def host_unwind_supports_jit():
668674

669675
# .debug_frame is not emitted for targeting Windows x64, aarch64/arm64, AIX, or Apple Silicon Mac.
670676
if not re.match(
671-
r"^(x86_64|aarch64|arm64|powerpc|powerpc64).*-(windows-gnu|windows-msvc|aix)",
677+
r"^(x86_64|aarch64|arm64|powerpc|powerpc64).*-(windows-cygnus|windows-gnu|windows-msvc|aix)",
672678
config.target_triple,
673679
) and not re.match(r"^arm64(e)?-apple-(macos|darwin)", config.target_triple):
674680
config.available_features.add("debug_frame")

0 commit comments

Comments
 (0)