29 "--print-rejected-preprocessed-source",
36 "--show-symbol-table",
37 "--show-function-table",
43 "--string-abstraction",
106 "-compatibility_version",
138 "-no-integrated-cpp",
160 "-print-libgcc-file-name",
161 "-print-multi-directory",
163 "-print-search-dirs",
165 "-print-sysroot-headers-suffix",
188 "-mno-unaligned-access",
225 args.reserve(argc-1);
227 for(
int i=1; i<argc; i++)
228 args.push_back(argv[i]);
241 for(argst::const_iterator it=
args.begin();
245 const std::string &argv_i=*it;
250 std::ifstream opts_file(argv_i.substr(1));
253 while(std::getline(opts_file, line))
256 line.erase(0, line.find_first_not_of(
"\t "));
275 argst::const_iterator next=it;
289 *o!=
nullptr && !found;
304 else if(
has_prefix(argv_i, std::string(*o)+
"="))
307 set(*o, argv_i.substr(strlen(*o)+1));
330 std::string value=argv_i.substr(4);
340 std::size_t equal_pos=argv_i.find(
'=');
342 if(equal_pos==std::string::npos)
345 set(argv_i.substr(0, equal_pos), argv_i.substr(equal_pos+1));
354 argst::const_iterator next=it;
361 *o!=
nullptr && !found;
378 else if(
has_prefix(argv_i, std::string(*o)+
"="))
381 set(*o, argv_i.substr(strlen(*o)+1));
387 *o!=
nullptr && !found;
406 set(*o, argv_i.substr(strlen(*o)));
412 *o!=
nullptr && !found;
418 set(*o, argv_i.substr(strlen(*o)));
425 std::cerr <<
"Warning: uninterpreted gcc option '" << argv_i
438 assert(!line.empty());
439 assert(line[0]!=
' ' && line[0]!=
'\t');
444 arg_end!=std::string::npos;
445 arg_start=line.find_first_not_of(
"\t ", arg_end))
447 arg_end=line.find_first_of(
"\t ", arg_start);
448 args.push_back(line.substr(arg_start, arg_end-arg_start));
457 const std::string &specs_file_name=
get_value(
"specs");
458 if(specs_file_name.empty())
461 std::ifstream specs_file(specs_file_name);
465 while(std::getline(specs_file, line))
468 line.erase(0, line.find_first_not_of(
"\t "));
474 (line==
"*link_libgcc:" ||