GCC Newspaper
NOVEMBER 30, 2026
Date
/
Architectures
Components
Topics
News & Policy
Other
jit

jit: set JIT_LDFLAGS for MinGW [PR125229]

Fixes JIT build on MinGW by setting JIT_LDFLAGS correctly.

This commit resolves a build failure in GCC’s JIT (Just-In-Time) compilation on MinGW platforms, as reported in PR125229. Previously, JIT_LDFLAGS was not set for MinGW, preventing the use of user-defined LDFLAGS. The fix ensures that JIT_LDFLAGS is appropriately set for MinGW, aligning its behavior with other platforms and allowing custom linker flags to be applied during JIT builds.

In Details

The build system for GCC's JIT component incorrectly omitted setting JIT_LDFLAGS for MinGW targets. On other platforms, JIT_LDFLAGS defaults to LDFLAGS to incorporate user-defined linker flags. For MinGW, this default was missing, leading to build failures when LDFLAGS contained necessary options. The change in Make-lang.in separates conditions for JIT_LDFLAGS and LIBGCCJIT_EXTRA_OPTS, correctly handling MinGW builds and specific Darwin host/MinGW target combinations.

For Context
JIT
Just-In-Time compilation. A method of executing code that involves compiling it during runtime rather than ahead of time.
MinGW
Minimalist GNU for Windows. A development environment for creating Windows applications using GNU compilers.
LDFLAGS
A standard Make variable that holds linker flags, used to pass options to the linker during the build process.
JIT_LDFLAGS
A linker flag variable specific to the GCC JIT (libgccjit) build process, intended to hold linker options for building the JIT runtime.
Filed Under: jitmingwbuildbugfix