aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Matz <matz@suse.de>2016-06-27 20:09:40 +0200
committerMichael Matz <matz@suse.de>2016-12-15 17:47:06 +0100
commitb6799ccd2eef96c58d0c61b7d9d36dc4c13ffc44 (patch)
tree6d413fe92a3daa19bf435f2b9f9283ed0e00c94d
parent2b3c7d2287ff9d5958f5e9d75d5881220a3c0f37 (diff)
downloadtinycc-b6799ccd2eef96c58d0c61b7d9d36dc4c13ffc44.tar.gz
tinycc-b6799ccd2eef96c58d0c61b7d9d36dc4c13ffc44.tar.bz2
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.
-rw-r--r--libtcc.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libtcc.c b/libtcc.c
index 806124a..dac4bb9 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;