MinGW x64 build crashes with Clang due to `__builtin_setjmp`

Open
#1,063 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
48/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Quiet
Domain
build-system

Research direction

Start by reading the MinGW x64 build configuration and the selection between builtin setjmp and the existing a6nt-jump.asm implementation. The issue names llvm-ml64 and HAND_CODED_SETJMP_SIZE=32 as the working setup; verify the PB bootstrap can compile cmacros.so with Clang on MinGW x64. Done when that build completes without crashing.

Written by the indexing model from the issue text.

Description

Chez treats __builtin_setjmp/__builtin_longjmp as reliable on MinGW x64, but Clang's Windows x64 lowering saves an incorrect frame-pointer value due to the llvm.frameaddress(0) behavior described in llvm/llvm-project#51055 and llvm/llvm-project#72908. Consequently, the PB bootstrap crashes while compiling cmacros.so.

Using the existing a6nt-jump.asm with llvm-ml64 and defining HAND_CODED_SETJMP_SIZE=32 fixes the build. Chez could select this implementation for Clang/MinGW x64 instead of the builtin path.

Dominant language
Scheme
Stars
7.4k
Forks
1k
Avg merge
1d 20h
Merged PRs (30d)
19

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from cisco/ChezScheme

All issues in cisco/ChezScheme

Similar issues

More Build System issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.