c++: Fix langspecs with -fsyntax-only [PR98591]
-fsyntax-only is handled specially in the driver and causes it to add '-o /dev/null' (or a suitable OS-specific variant thereof). PCH is handled in the language driver. I'd not sufficiently protected the -fmodule-only action of adding a dummy assembler from the actions of -fsyntax-only, so we ended up with two -o options. PR c++/98591 gcc/cp/ * lang-specs.h: Fix handling of -fmodule-only with -fsyntax-only.
This commit is contained in:
parent
5a783f42d7
commit
492b90f33d
@ -52,9 +52,11 @@ along with GCC; see the file COPYING3. If not see
|
|||||||
" %{!save-temps*:%{!no-integrated-cpp:%(cpp_unique_options)}}"
|
" %{!save-temps*:%{!no-integrated-cpp:%(cpp_unique_options)}}"
|
||||||
" %{fmodules-ts:-fmodule-header %{fpreprocessed:-fdirectives-only}}"
|
" %{fmodules-ts:-fmodule-header %{fpreprocessed:-fdirectives-only}}"
|
||||||
" %(cc1_options) %2"
|
" %(cc1_options) %2"
|
||||||
" %{!S:-o %g.s%V}"
|
" %{!fsyntax-only:"
|
||||||
" %{!fsyntax-only:%{!fmodule-*:%{!fmodules-*:%{!fdump-ada-spec*:"
|
" %{!S:-o %g.s%V}"
|
||||||
" %{!o*:--output-pch=%i.gch}%W{o*:--output-pch=%*}}}}}}}}",
|
" %{!fmodule-*:%{!fmodules-*:%{!fdump-ada-spec*:"
|
||||||
|
" %{!o*:--output-pch=%i.gch}%W{o*:--output-pch=%*}}}}}"
|
||||||
|
"}}}",
|
||||||
CPLUSPLUS_CPP_SPEC, 0, 0},
|
CPLUSPLUS_CPP_SPEC, 0, 0},
|
||||||
{"@c++-system-header",
|
{"@c++-system-header",
|
||||||
"%{E|M|MM:cc1plus -E"
|
"%{E|M|MM:cc1plus -E"
|
||||||
@ -68,11 +70,14 @@ along with GCC; see the file COPYING3. If not see
|
|||||||
" %{fmodules-ts:-fdirectives-only}"
|
" %{fmodules-ts:-fdirectives-only}"
|
||||||
" %{save-temps*:%b.ii} %{!save-temps*:%g.ii}}"
|
" %{save-temps*:%b.ii} %{!save-temps*:%g.ii}}"
|
||||||
" %{!save-temps*:%{!no-integrated-cpp:%(cpp_unique_options)}}"
|
" %{!save-temps*:%{!no-integrated-cpp:%(cpp_unique_options)}}"
|
||||||
" %{fmodules-ts:-fmodule-header=system %{fpreprocessed:-fdirectives-only}}"
|
" %{fmodules-ts:-fmodule-header=system"
|
||||||
|
" %{fpreprocessed:-fdirectives-only}}"
|
||||||
" %(cc1_options) %2"
|
" %(cc1_options) %2"
|
||||||
" %{!S:-o %g.s%V}"
|
" %{!fsyntax-only:"
|
||||||
" %{!fsyntax-only:%{!fmodule-*:%{!fmodules-*:%{!fdump-ada-spec*:"
|
" %{!S:-o %g.s%V}"
|
||||||
" %{!o*:--output-pch=%i.gch}%W{o*:--output-pch=%*}}}}}}}}",
|
" %{!fmodule-*:%{!fmodules-*:%{!fdump-ada-spec*:"
|
||||||
|
" %{!o*:--output-pch=%i.gch}%W{o*:--output-pch=%*}}}}}"
|
||||||
|
"}}}",
|
||||||
CPLUSPLUS_CPP_SPEC, 0, 0},
|
CPLUSPLUS_CPP_SPEC, 0, 0},
|
||||||
{"@c++-user-header",
|
{"@c++-user-header",
|
||||||
"%{E|M|MM:cc1plus -E"
|
"%{E|M|MM:cc1plus -E"
|
||||||
@ -88,9 +93,11 @@ along with GCC; see the file COPYING3. If not see
|
|||||||
" %{!save-temps*:%{!no-integrated-cpp:%(cpp_unique_options)}}"
|
" %{!save-temps*:%{!no-integrated-cpp:%(cpp_unique_options)}}"
|
||||||
" %{fmodules-ts:-fmodule-header=user %{fpreprocessed:-fdirectives-only}}"
|
" %{fmodules-ts:-fmodule-header=user %{fpreprocessed:-fdirectives-only}}"
|
||||||
" %(cc1_options) %2"
|
" %(cc1_options) %2"
|
||||||
" %{!S:-o %g.s%V}"
|
" %{!fsyntax-only:"
|
||||||
" %{!fsyntax-only:%{!fmodule-*:%{!fmodules-*:%{!fdump-ada-spec*:"
|
" %{!S:-o %g.s%V}"
|
||||||
" %{!o*:--output-pch=%i.gch}%W{o*:--output-pch=%*}}}}}}}}",
|
" %{!fmodule-*:%{!fmodules-*:%{!fdump-ada-spec*:"
|
||||||
|
" %{!o*:--output-pch=%i.gch}%W{o*:--output-pch=%*}}}}}"
|
||||||
|
"}}}",
|
||||||
CPLUSPLUS_CPP_SPEC, 0, 0},
|
CPLUSPLUS_CPP_SPEC, 0, 0},
|
||||||
{"@c++",
|
{"@c++",
|
||||||
"%{E|M|MM:cc1plus -E %(cpp_options) %2 %(cpp_debug_options)}"
|
"%{E|M|MM:cc1plus -E %(cpp_options) %2 %(cpp_debug_options)}"
|
||||||
@ -101,13 +108,16 @@ along with GCC; see the file COPYING3. If not see
|
|||||||
" %{save-temps*:%b.ii} %{!save-temps*:%g.ii}}"
|
" %{save-temps*:%b.ii} %{!save-temps*:%g.ii}}"
|
||||||
" %{!save-temps*:%{!no-integrated-cpp:%(cpp_unique_options)}}"
|
" %{!save-temps*:%{!no-integrated-cpp:%(cpp_unique_options)}}"
|
||||||
" %(cc1_options) %2"
|
" %(cc1_options) %2"
|
||||||
" %{fmodule-only:%{!S:-o %g.s%V}}"
|
" %{!fsyntax-only:"
|
||||||
" %{!fsyntax-only:%{!fmodule-only:%(invoke_as)}}}}}",
|
" %{fmodule-only:%{!S:-o %g.s%V}}"
|
||||||
|
" %{!fmodule-only:%(invoke_as)}}"
|
||||||
|
"}}}",
|
||||||
CPLUSPLUS_CPP_SPEC, 0, 0},
|
CPLUSPLUS_CPP_SPEC, 0, 0},
|
||||||
{".ii", "@c++-cpp-output", 0, 0, 0},
|
{".ii", "@c++-cpp-output", 0, 0, 0},
|
||||||
{"@c++-cpp-output",
|
{"@c++-cpp-output",
|
||||||
"%{!E:%{!M:%{!MM:"
|
"%{!E:%{!M:%{!MM:"
|
||||||
" cc1plus -fpreprocessed %i %(cc1_options) %2"
|
" cc1plus -fpreprocessed %i %(cc1_options) %2"
|
||||||
" %{fmodule-only:%{!S:-o %g.s%V}}"
|
" %{!fsyntax-only:"
|
||||||
" %{!fsyntax-only:%{!fmodule-only:%{!fmodule-header*:"
|
" %{fmodule-only:%{!S:-o %g.s%V}}"
|
||||||
" %(invoke_as)}}}}}}", 0, 0, 0},
|
" %{!fmodule-only:%{!fmodule-header*:%(invoke_as)}}}"
|
||||||
|
"}}}", 0, 0, 0},
|
||||||
|
3
gcc/testsuite/g++.dg/modules/pr98591.H
Normal file
3
gcc/testsuite/g++.dg/modules/pr98591.H
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
// { dg-additional-options {-fmodules-ts -fmodule-header -fsyntax-only} }
|
||||||
|
// PR 98591 -fsyntax-only -> output filename specified twice
|
||||||
|
// specs are hard
|
Loading…
Reference in New Issue
Block a user