Regression (segfault) with std::print and __int128 using libstdc++6 17.0.0+20260802-0.1

Jakob Bohm jb-cygwin@wisemo.com
Thu Aug 27 16:10:10 GMT 2026


On 24/08/2026 14:10, kikairoya via Cygwin wrote:
> Hi Martin,
>
> 2026年8月23日 10:51:18 (+09:00) で、martin_n_fuller via Cygwin さんが書きました:
>
>> ...
> This is caused by a recent ABI change in GCC, rather than by a change in
> std::println itself.
>
> GCC 17 changed the x86_64 Windows ABI used for returning __int128 and
> __uint128 values. Previously, GCC and Clang both returned such values
> via %xmm0. GCC now returns them indirectly instead.
>
> https://github.com/gcc-mirror/gcc/commit/e63a873f1df7493b8b657acafb451bf40166044e
>
> As a result, Clang and pre-17 GCC are ABI-incompatible with libstdc++ built by
> GCC 17 when a __int128 value is returned across the library boundary.
>
> A change to make Clang compatible with GCC is under review:
>
> https://github.com/llvm/llvm-project/pull/210358
>
>  From a Clang perspective, I hope that Cygwin will adopt the new
> upstream ABI, since it's difficult to maintain an ABI divergence for Cygwin
> alone, given that all of the calling conventions are shared across all targets.
> Please note that Clang is always a cross-compiler; /usr/bin/clang can emit
> non-Cygwin binaries (mingw or msvc), and /usr/bin/x86_64-w64-mingw32-clang
> can also emit Cygwin binaries.
Note that MSWin32/Win64 has its own ABI calling conventions that 
compilers need to
follow to work with system calls and other 3rd party libraries. This, 
will include conventions
for how to return __uint128, __uint256 and the various floating point 
types that might be
returned in different CPU registers or as generic memory objects 
depending what the ABI
designers at Microsoft decide.

Similarly, the MS ABI will include rules determining if small structures 
are returned in large
integer registers or as memory objects.

As Microsoft offers the option of using MS built clang binaries instead 
of the MS compiler
for Win32 programs, there is a high likelihood that MS has already 
upstreamed the ABI
rules to the clang project.

Enjoy

Jakob
-- 
Jakob Bohm, CIO, Partner, WiseMo A/S.  https://www.wisemo.com
Transformervej 29, 2860 Søborg, Denmark.  Direct +45 31 13 16 10
This public discussion message is non-binding and may contain errors.
WiseMo - Remote Service Management for PCs, Phones and Embedded



More information about the Cygwin mailing list