From b6799ccd2eef96c58d0c61b7d9d36dc4c13ffc44 Mon Sep 17 00:00:00 2001 From: Michael Matz Date: Mon, 27 Jun 2016 20:09:40 +0200 Subject: [PATCH] Accept -Wp,args These are preprocessor cmdline arguments, but even in GCC they aren't specified but rather left as being subject to changes. Nobody should use them, but let's to a half-assed attempt at accepting them. --- libtcc.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libtcc.c b/libtcc.c index 806124a5..dac4bb90 100644 --- a/libtcc.c +++ b/libtcc.c @@ -1511,6 +1511,7 @@ enum { TCC_OPTION_s, TCC_OPTION_traditional, TCC_OPTION_Wl, + TCC_OPTION_Wp, TCC_OPTION_W, TCC_OPTION_O, TCC_OPTION_mms_bitfields, @@ -1578,6 +1579,7 @@ static const TCCOption tcc_options[] = { { "s", TCC_OPTION_s, 0 }, { "traditional", TCC_OPTION_traditional, 0 }, { "Wl,", TCC_OPTION_Wl, TCC_OPTION_HAS_ARG | TCC_OPTION_NOSEP }, + { "Wp,", TCC_OPTION_Wp, TCC_OPTION_HAS_ARG | TCC_OPTION_NOSEP }, { "W", TCC_OPTION_W, TCC_OPTION_HAS_ARG | TCC_OPTION_NOSEP }, { "O", TCC_OPTION_O, TCC_OPTION_HAS_ARG | TCC_OPTION_NOSEP }, { "mms-bitfields", TCC_OPTION_mms_bitfields, 0}, /* must go before option 'm' */ @@ -1651,6 +1653,7 @@ PUB_FUNC int tcc_parse_args(TCCState *s, int argc, char **argv) r = argv[optind++]; +reparse: if (r[0] == '@' && r[1] != '\0') { args_parser_listfile(s, r + 1); continue; @@ -1840,6 +1843,9 @@ PUB_FUNC int tcc_parse_args(TCCState *s, int argc, char **argv) if (tcc_set_linker(s, linker_arg.data)) cstr_free(&linker_arg); break; + case TCC_OPTION_Wp: + r = optarg; + goto reparse; case TCC_OPTION_E: x = TCC_OUTPUT_PREPROCESS; goto set_output_type;