Fix MinGW option -mcrtdll=

Add missing msvcr40* and msvcrtd* cases to CPP_SPEC and
document missing _UCRT macro and msvcr71* case.

Fixes commit 453cb585f0.

gcc/
	* config/i386/mingw-w64.h (CPP_SPEC): Add missing -mcrtdll=
	cases: msvcr40*, msvcrtd*.
	* config/i386/mingw32.h (CPP_SPEC): Add missing -mcrtdll=
	cases: msvcr40*, msvcrtd*.
	* doc/invoke.texi: Add missing -mcrtdll= cases: msvcr40*,
	msvcrtd*, msvcr71*. Express wildcards with *. Document _UCRT.

(cherry picked from commit 0de0476e47c774db21c94a75d60485a55ec7b5b4)
Signed-off-by: Jonathan Yong <10walls@gmail.com>
This commit is contained in:
Pali Rohár 2024-06-23 18:40:59 +02:00 committed by Jonathan Yong
parent a927d33557
commit a8617b5ec3
3 changed files with 11 additions and 6 deletions

View file

@ -30,6 +30,8 @@ along with GCC; see the file COPYING3. If not see
"%{mcrtdll=msvcrt10*:-D__MSVCRT_VERSION__=0x100} " \ "%{mcrtdll=msvcrt10*:-D__MSVCRT_VERSION__=0x100} " \
"%{mcrtdll=msvcrt20*:-D__MSVCRT_VERSION__=0x200} " \ "%{mcrtdll=msvcrt20*:-D__MSVCRT_VERSION__=0x200} " \
"%{mcrtdll=msvcrt40*:-D__MSVCRT_VERSION__=0x400} " \ "%{mcrtdll=msvcrt40*:-D__MSVCRT_VERSION__=0x400} " \
"%{mcrtdll=msvcr40*:-D__MSVCRT_VERSION__=0x400} " \
"%{mcrtdll=msvcrtd*:-D__MSVCRT_VERSION__=0x600} " \
"%{mcrtdll=msvcrt-os*:-D__MSVCRT_VERSION__=0x700} " \ "%{mcrtdll=msvcrt-os*:-D__MSVCRT_VERSION__=0x700} " \
"%{mcrtdll=msvcr70*:-D__MSVCRT_VERSION__=0x700} " \ "%{mcrtdll=msvcr70*:-D__MSVCRT_VERSION__=0x700} " \
"%{mcrtdll=msvcr71*:-D__MSVCRT_VERSION__=0x701} " \ "%{mcrtdll=msvcr71*:-D__MSVCRT_VERSION__=0x701} " \

View file

@ -94,6 +94,8 @@ along with GCC; see the file COPYING3. If not see
"%{mcrtdll=msvcrt10*:-D__MSVCRT_VERSION__=0x100} " \ "%{mcrtdll=msvcrt10*:-D__MSVCRT_VERSION__=0x100} " \
"%{mcrtdll=msvcrt20*:-D__MSVCRT_VERSION__=0x200} " \ "%{mcrtdll=msvcrt20*:-D__MSVCRT_VERSION__=0x200} " \
"%{mcrtdll=msvcrt40*:-D__MSVCRT_VERSION__=0x400} " \ "%{mcrtdll=msvcrt40*:-D__MSVCRT_VERSION__=0x400} " \
"%{mcrtdll=msvcr40*:-D__MSVCRT_VERSION__=0x400} " \
"%{mcrtdll=msvcrtd*:-D__MSVCRT_VERSION__=0x600} " \
"%{mcrtdll=msvcrt-os*:-D__MSVCRT_VERSION__=0x700} " \ "%{mcrtdll=msvcrt-os*:-D__MSVCRT_VERSION__=0x700} " \
"%{mcrtdll=msvcr70*:-D__MSVCRT_VERSION__=0x700} " \ "%{mcrtdll=msvcr70*:-D__MSVCRT_VERSION__=0x700} " \
"%{mcrtdll=msvcr71*:-D__MSVCRT_VERSION__=0x701} " \ "%{mcrtdll=msvcr71*:-D__MSVCRT_VERSION__=0x701} " \

View file

@ -36325,13 +36325,14 @@ enabled by default on those targets.
@opindex mcrtdll @opindex mcrtdll
@item -mcrtdll=@var{library} @item -mcrtdll=@var{library}
Preprocess, compile or link with specified C RunTime DLL @var{library}. Preprocess, compile or link with specified C RunTime DLL @var{library}.
This option adjust predefined macros @code{__CRTDLL__}, @code{__MSVCRT__} This option adjust predefined macros @code{__CRTDLL__}, @code{__MSVCRT__},
and @code{__MSVCRT_VERSION__} for specified CRT @var{library}, choose @code{_UCRT} and @code{__MSVCRT_VERSION__} for specified CRT @var{library},
start file for CRT @var{library} and link with CRT @var{library}. choose start file for CRT @var{library} and link with CRT @var{library}.
Recognized CRT library names for proprocessor are: Recognized CRT library names for proprocessor are:
@code{crtdll}, @code{msvcrt10}, @code{msvcrt20}, @code{msvcrt40}, @code{crtdll*}, @code{msvcrt10*}, @code{msvcrt20*}, @code{msvcrt40*},
@code{msvcrt-os}, @code{msvcr70}, @code{msvcr80}, @code{msvcr90}, @code{msvcr40*}, @code{msvcrtd*}, @code{msvcrt-os*},
@code{msvcr100}, @code{msvcr110}, @code{msvcr120} and @code{ucrt}. @code{msvcr70*}, @code{msvcr71*}, @code{msvcr80*}, @code{msvcr90*},
@code{msvcr100*}, @code{msvcr110*}, @code{msvcr120*} and @code{ucrt*}.
If this options is not specified then the default MinGW import library If this options is not specified then the default MinGW import library
@code{msvcrt} is used for linking and no other adjustment for @code{msvcrt} is used for linking and no other adjustment for
preprocessor is done. MinGW import library @code{msvcrt} is just a preprocessor is done. MinGW import library @code{msvcrt} is just a