File tree 2 files changed +21
-5
lines changed 2 files changed +21
-5
lines changed Original file line number Diff line number Diff line change @@ -18,9 +18,7 @@ Author: CM Wintersteiger, 2006
18
18
19
19
#include < util/prefix.h>
20
20
21
- // / parses the command line options into a cmdlinet
22
- // / \par parameters: argument count, argument strings
23
- // / \return none
21
+ // clang-format off
24
22
// non-gcc options
25
23
const char *goto_cc_options_with_separated_argument[]=
26
24
{
@@ -163,6 +161,8 @@ const char *gcc_options_without_argument[]=
163
161
" -print-multi-directory" ,
164
162
" -print-multi-lib" ,
165
163
" -print-search-dirs" ,
164
+ " -print-sysroot" ,
165
+ " -print-sysroot-headers-suffix" ,
166
166
" -Q" ,
167
167
" -Qn" ,
168
168
" -Qy" ,
@@ -211,7 +211,11 @@ const char *gcc_options_without_argument[]=
211
211
" -fast" , // Apple only
212
212
nullptr
213
213
};
214
+ // clang-format on
214
215
216
+ // / parses the command line options into a cmdlinet
217
+ // / \par parameters: argument count, argument strings
218
+ // / \return none
215
219
bool gcc_cmdlinet::parse (int argc, const char **argv)
216
220
{
217
221
assert (argc>0 );
Original file line number Diff line number Diff line change @@ -380,12 +380,24 @@ int gcc_modet::doit()
380
380
return EX_OK; // Exit!
381
381
}
382
382
383
- if (cmdline.isset (" dumpversion" ))
383
+ if (
384
+ cmdline.isset (" dumpmachine" ) || cmdline.isset (" dumpspecs" ) ||
385
+ cmdline.isset (" dumpversion" ) || cmdline.isset (" print-sysroot" ) ||
386
+ cmdline.isset (" print-sysroot-headers-suffix" ))
384
387
{
385
388
if (produce_hybrid_binary)
386
389
return run_gcc (compiler);
387
390
388
- std::cout << " 3.4.4\n " ;
391
+ // GCC will only print one of these, even when multiple arguments are
392
+ // passed, so we do the same
393
+ if (cmdline.isset (" dumpmachine" ))
394
+ std::cout << config.this_architecture () << ' \n ' ;
395
+ else if (cmdline.isset (" dumpversion" ))
396
+ std::cout << " 3.4.4\n " ;
397
+
398
+ // we don't have any meaningful output for the other options, and GCC
399
+ // doesn't necessarily produce non-empty output either
400
+
389
401
return EX_OK;
390
402
}
391
403
You can’t perform that action at this time.
0 commit comments