Skip to content

Conversation

@jeremyd2019
Copy link
Contributor

@jeremyd2019 jeremyd2019 commented Jul 30, 2025

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.

Cygwin is like Windows in that it uses COFF, and doesn't emit
.debug_frame on 64-bit architectures.

However, more tests fail if -elf is appended to the target triple on
Cygwin than if it is not, so remove cygwin from that case rather than
adding windows-cygnus to it.
@jeremyd2019 jeremyd2019 requested a review from mstorsjo July 30, 2025 23:05
# Windows. FIXME: the process target triple should be used here, but this is
# difficult to obtain on Windows.
if re.search(r"cygwin|windows-gnu|windows-msvc", config.host_triple):
if re.search(r"windows-gnu|windows-msvc", config.host_triple):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not so sure about this one in particular - for the (rather odd) JIT cases where we construct an ELF file in memory and map that, I would think that it should work the same on cygwin as on regular Windows?

Copy link
Member

@mstorsjo mstorsjo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking mostly good, but I do find the -elf case curious, why it should fail more on cygwin than on native windows.

@jeremyd2019
Copy link
Contributor Author

I am extremely curious about these tests on Windows (or at least MinGW) because it seems at least some of them don't run, but I can't find an obvious place that they are excluded.

@jeremyd2019
Copy link
Contributor Author

With that -elf case switched on for cygwin and windows-cygnus, I get one test that doesn't fail anymore: LLVM :: ExecutionEngine/MCJIT/stubs-sm-pic.ll and these that now fail where they didn't before:

  LLVM :: ExecutionEngine/MCJIT/remote/cross-module-a.ll
  LLVM :: ExecutionEngine/MCJIT/remote/multi-module-a.ll
  LLVM :: ExecutionEngine/MCJIT/remote/simpletest-remote.ll
  LLVM :: ExecutionEngine/MCJIT/remote/stubs-remote.ll
  LLVM :: ExecutionEngine/MCJIT/remote/test-common-symbols-remote.ll
  LLVM :: ExecutionEngine/MCJIT/remote/test-data-align-remote.ll
  LLVM :: ExecutionEngine/MCJIT/remote/test-fp-no-external-funcs-remote.ll
  LLVM :: ExecutionEngine/MCJIT/remote/test-global-init-nonzero-remote.ll
  LLVM :: ExecutionEngine/MCJIT/remote/test-global-init-nonzero-sm-pic.ll
  LLVM :: ExecutionEngine/MCJIT/remote/test-ptr-reloc-remote.ll
  LLVM :: ExecutionEngine/MCJIT/remote/test-ptr-reloc-sm-pic.ll

These remote tests seem to all fail with:

Finalization error: could not register eh-frame: __register_frame function not found

@mstorsjo
Copy link
Member

With that -elf case switched on for cygwin and windows-cygnus, I get one test that doesn't fail anymore: LLVM :: ExecutionEngine/MCJIT/stubs-sm-pic.ll and these that now fail where they didn't before:

  LLVM :: ExecutionEngine/MCJIT/remote/cross-module-a.ll
  LLVM :: ExecutionEngine/MCJIT/remote/multi-module-a.ll
  LLVM :: ExecutionEngine/MCJIT/remote/simpletest-remote.ll
  LLVM :: ExecutionEngine/MCJIT/remote/stubs-remote.ll
  LLVM :: ExecutionEngine/MCJIT/remote/test-common-symbols-remote.ll
  LLVM :: ExecutionEngine/MCJIT/remote/test-data-align-remote.ll
  LLVM :: ExecutionEngine/MCJIT/remote/test-fp-no-external-funcs-remote.ll
  LLVM :: ExecutionEngine/MCJIT/remote/test-global-init-nonzero-remote.ll
  LLVM :: ExecutionEngine/MCJIT/remote/test-global-init-nonzero-sm-pic.ll
  LLVM :: ExecutionEngine/MCJIT/remote/test-ptr-reloc-remote.ll
  LLVM :: ExecutionEngine/MCJIT/remote/test-ptr-reloc-sm-pic.ll

These remote tests seem to all fail with:

Finalization error: could not register eh-frame: __register_frame function not found

All of those tests in the remote category are marked as XFAIL for Windows, see e.g. https://github.com/llvm/llvm-project/blob/llvmorg-22-init/llvm/test/ExecutionEngine/MCJIT/remote/cross-module-a.ll#L2 - this since 5bbf576 and 4b6e021 very very long ago.

And when actually running them, we hit this:

# .---command stderr------------
# | lli.exe: warning: host does not support external remote targets.
# | note: defaulting to local execution
# `-----------------------------
# error: command failed with exit status: 0xffffffff

So if I understand it correctly - enabling -elf fixes ExecutionEngine/MCJIT/stubs-sm-pic.ll (which also is failing on mingw, if the -elf addition is skipped), but it ends up breaking all the remote tests (which surprisingly were passing before, without -elf, and which never have worked on native windows).

@jeremyd2019
Copy link
Contributor Author

So if I understand it correctly - enabling -elf fixes ExecutionEngine/MCJIT/stubs-sm-pic.ll (which also is failing on mingw, if the -elf addition is skipped), but it ends up breaking all the remote tests (which surprisingly were passing before, without -elf, and which never have worked on native windows).

Yes. The remote mechanism uses unix pipes, and fork/exec

@mstorsjo
Copy link
Member

So if I understand it correctly - enabling -elf fixes ExecutionEngine/MCJIT/stubs-sm-pic.ll (which also is failing on mingw, if the -elf addition is skipped), but it ends up breaking all the remote tests (which surprisingly were passing before, without -elf, and which never have worked on native windows).

Yes. The remote mechanism uses unix pipes, and fork/exec

Ok, I see.

So as we now know how the -elf case is connected to the one test that fails without it, I guess we can choose to XFAIL that test for cygwin and stop setting -elf for cygwin - with mutual comments on both sites referencing each other.

Copy link
Member

@mstorsjo mstorsjo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@jeremyd2019 jeremyd2019 merged commit dfbf13c into llvm:main Aug 2, 2025
9 checks passed
@jeremyd2019 jeremyd2019 deleted the llvm-lit-cfg-py-cygwin branch August 2, 2025 17:31
jeremyd2019 added a commit to jeremyd2019/llvm-project that referenced this pull request Aug 6, 2025
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.
jeremyd2019 added a commit to jeremyd2019/llvm-project that referenced this pull request Aug 9, 2025
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.
jeremyd2019 added a commit to jeremyd2019/llvm-project that referenced this pull request Aug 12, 2025
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.
jeremyd2019 added a commit to jeremyd2019/llvm-project that referenced this pull request Aug 26, 2025
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.
jeremyd2019 added a commit to jeremyd2019/llvm-project that referenced this pull request Sep 12, 2025
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.
jeremyd2019 added a commit to jeremyd2019/llvm-project that referenced this pull request Sep 23, 2025
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants