aboutsummaryrefslogtreecommitdiff
path: root/libtcc.c
diff options
context:
space:
mode:
Diffstat (limited to 'libtcc.c')
-rw-r--r--libtcc.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/libtcc.c b/libtcc.c
index 76ee11c..58dddb9 100644
--- a/libtcc.c
+++ b/libtcc.c
@@ -1303,6 +1303,16 @@ static int tcc_set_flag(TCCState *s, const char *flag_name, int value)
flag_name, value);
}
+static const FlagDef m_defs[] = {
+#ifdef TCC_TARGET_X86_64
+ { offsetof(TCCState, nosse), FD_INVERT, "sse" },
+#endif
+ { 0, 0, " no flag" },
+};
+static int tcc_set_m_flag(TCCState *s, const char *flag_name, int value)
+{
+ return set_flag(s, m_defs, countof(m_defs), flag_name, value);
+}
static int strstart(const char *val, const char **str)
{
@@ -1778,9 +1788,10 @@ reparse:
s->soname = tcc_strdup(optarg);
break;
case TCC_OPTION_m:
- if (strcmp(optarg, "32") && strcmp(optarg, "64"))
+ if (!strcmp(optarg, "32") || !strcmp(optarg, "64"))
+ s->option_m = tcc_strdup(optarg);
+ else if (tcc_set_m_flag(s, optarg, 1) < 0)
goto unsupported_option;
- s->option_m = tcc_strdup(optarg);
break;
case TCC_OPTION_o:
if (s->outfile) {