Skip to content

AMD64_NT bootstrap to ex_stack. - #1346

Draft
jaykrell wants to merge 1 commit into
modula3:masterfrom
jaykrell:boot-to-ex_stack
Draft

jaykrell wants to merge 1 commit into
modula3:masterfrom
jaykrell:boot-to-ex_stack

Conversation

@jaykrell

@jaykrell jaykrell commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

The goal of this PR, still to be verified and finished:

  1. Starts with an old C bootstrap, builds it.
  2. Then builds current with it. (output of step 1, of course)
  3. Then builds current with self. (output of step 2, of course)
    The first step is of course old ex_frame. The compiler was already mostly built, years ago, producing "semi-portable" C (64bit little endian Windows).
    The second step of course is still ex_frame. It is running that old compiler.
    The third step should be ex_stack, once the cpp_source function is defined.
    What is missing then, is building a "distribution", of some sort.
    Old make-dist.py stopped working at some point.
    What would be reasonable though is to proceed to boot1 or boot1autotools various.
    Those are enough of a distribution, arguably.
    It depends on if users will run boot2.py.

There are three related overlapping PRs.

  1. One only adds the m3build/cpp_source implementation and dynamic use. AMD64_NT C++ bootstrap support. #1336
  2. Another adds the pipeline of above steps, but does NOT change to ex_stack. Add boot1/boot2-based AMD64_NT bootstrap. NOT to ex_stack. #1325
  3. One is everything including ex_stack switch over. But still missing artifacts at the end. This one. AMD64_NT bootstrap to ex_stack. #1346

Without such artifacts at the end, if we switch to ex_stack, "this" PR (3) would descend the few users into unusability.
The others can be commited asis.
There is the flakiness hanging over us as well.

Finishing that last step shouldn't be dificult.
We can even just proceed to concierge, which might work anyway to do all of this.

The first two PRs should be commitable roughly as is.
This last one will then rebase to about one line, but must wait for 1-2 things as stated:

  • stability
  • ease of migration for users

@VictorMiasnikov

Copy link
Copy Markdown
Contributor
call "%ProgramFiles%\Microsoft Visual Studio\18\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64 || goto :eof

This is depend MS VS version, etc . . .

(
Good on test stage
)

P.S.

Is it MS VS 2022 ?

@jaykrell

Copy link
Copy Markdown
Contributor Author
call "%ProgramFiles%\Microsoft Visual Studio\18\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64 || goto :eof

This is depend MS VS version, etc . . .

( Good on test stage )

P.S.

Is it MS VS 2022 ?

The GitHub runners have VS2026 so this is using that. VS2022 will surely work. VS2019 will surely work.
Everything is very portable and very little has changed in 30 years, except to increase portability, C++ backend...

@jaykrell

Copy link
Copy Markdown
Contributor Author

After we switch to ex_stack, let's work on switching to clang-cl and clang.

@hosking

hosking commented Nov 23, 2026

Copy link
Copy Markdown
Member

Jay, keying the switch on defined ("cpp_source") is a neat way to fold the two-phase upgrade into one run. Two things about where it sits:

  1. It reaches more than AMD64_NT. NT.common is included by AMD64_NT, ARM64_NT and ARM32_NT, and by I386_NT through NT386.common. CI builds I386_NT with the C backend, so once cpp_source exists, I386_NT (c) moves to ex_stack too. That may be what you want, since 32-bit C++ EH works, but it should be deliberate and in the title. Otherwise the condition could also test TARGET.

  2. No target can opt out. At the end of NT.common it overrides anything a target config sets before its include. A guard leaves the default to NT.common and lets a target decide:

    if not defined ("M3_USE_STACK_WALKER")
      M3_USE_STACK_WALKER = defined ("cpp_source") and equal (M3_BACKEND_MODE, "C")
    end

    The same applies to the unconditional M3_USE_STACK_WALKER = FALSE in Add boot1-based AMD64_NT bootstrap+matching m3core/libm3 #1352, as in the AMD64_NT C++ bootstrap support. #1336 review.

🤖 Generated with Claude Code

This branch has not been deployed

No deployments
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.

3 participants