Conversation
Disable identical code folding in BOLT and omit the extra linker ICF flag. Function addresses can be observed through dynamic lookup and used as identifiers, which even safe BOLT folding cannot account for across library boundaries. Assisted-by: Codex (GPT-6)
MSYS2 excludes CMAKE_INSTALL_PREFIX from argument conversion, but LLVM's staged prefix is absolute. Convert it explicitly on Windows hosts so native CMake installs into the staging tree; Unix hosts retain Unix paths, including when cross-compiling for Windows. Create the staged DLL directory before copying libLLVM so cp cannot create a file named bin. Assisted-by: Codex (GPT-6)
Keep jl_win_restore_page externally visible and marked used because its assembly reference is invisible to ThinLTO. Remove the .text switch from `CFI_NORETURN`: .seh_handler does not change sections, and switching away from a function section separates the remaining instructions from their prologue. This fixes the task-switch trap and the crash while emitting variable debug locations, allowing full debug information. Assisted-by: Codex (GPT-6)
The loader forwards runtime entry points, but its import library must omit them so libjulia-internal does not resolve its own calls through the loader. Generate it with dlltool from a filtered export definition because objcopy cannot rewrite lld's import-library format. Match undecorated names on both Windows architectures, preserve data and codegen exports, and stop if preprocessing the runtime list fails. Assisted-by: Codex (GPT-6)
Translate the runtime export map into a COFF export definition when using lld. Discover exports from selected archive members before filtering, preserving explicit exports, data exports and the exclusion of unused members. Keep Windows visibility under linker control so Clang cannot suppress symbols selected by the map, and annotate the runtime declarations used across the codegen DLL boundary with `JL_DLLEXPORT`. Assisted-by: Codex (GPT-6)
Use Clang and lld's MinGW driver for PGO and ThinLTO, applying the existing export map through a COFF definition. Separate added compiler-driver flags from the caller's linker flags and supply the profile runtime explicitly to Julia's direct Windows links. Keep full debug information; BOLT remains disabled on Windows because it cannot rewrite PE/COFF. Install the support and compression DLLs beside the stage-0 tools, skip the ELF constructor-section fixup, and append each stage's DLL directory to PATH. Convert LLVM_PROFILE_FILE to a native Windows path while leaving compiler arguments for MSYS2 to convert. Platform hooks preserve the existing non-Windows commands. Assisted-by: Codex (GPT-6)
Concurrent ThinLTO backends exhaust the 32-bit linker's address space when linking PGO-trained libLLVM on hosts with many cores. Each backend holds a module and the PGO profile, so make their concurrency configurable through LTO_JOBS. Default to eight on 32-bit targets and retain the linker default elsewhere; callers can override the cap or leave it empty. Apply the flag only to the ELF linker configuration. (cherry picked from commit 1b927c6c3c7987e46ddfcb9172acdc822f409c50) Assisted-by: Claude Code (Fable 5.1) Assisted-by: Codex (GPT-6)
`CFI_NORETURN` emits `.cfi_undefined`/`.cfi_return_column` directives that apply to whichever function the surrounding code is emitted in. The other users in task.c were already `NOINLINE`, but the PGO+ThinLTO macOS aarch64 build inlined `jl_start_fiber_set` into `ctx_switch` and `jl_start_fiber_swap`. That bound the whole FDE of those two functions to a CIE whose return address register is undefined, so unwinding a suspended task from its saved context stopped after one frame: the task profiler reported every blocked task as a single `jl_start_fiber_swap` frame and the Profile test failed on the optimized macOS aarch64 nightlies. Mark the function `NOINLINE` and document the requirement next to the macro. Assisted-by: Claude Code (Fable 5.1) (cherry picked from commit e0e1225a55c4458b2dde162c3e82ec52885950ce) Assisted-by: Codex (GPT-6)
maleadt
force-pushed
the
tb/opt-windows
branch
from
September 16, 2026 11:59
bf186c1 to
b0f1ed5
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Enable PGO and ThinLTO builds on Windows x86-64, preserving the existing export policy, caller linker flags, and full debug information.
Also fix issues in existing optimized builds: