diff options
| author | Michael Matz <matz@suse.de> | 2016-10-03 05:20:21 +0200 |
|---|---|---|
| committer | Michael Matz <matz@suse.de> | 2016-12-15 17:47:12 +0100 |
| commit | ad723a419fd956d984a0956713566453ba8f6a12 (patch) | |
| tree | 545e85608c951f3416c79146a6c378435dfb0af1 /libtcc.c | |
| parent | b5669a952babf486f0f8beb1e0a52d9031b3ae84 (diff) | |
| download | tinycc-ad723a419fd956d984a0956713566453ba8f6a12.tar.gz tinycc-ad723a419fd956d984a0956713566453ba8f6a12.tar.bz2 | |
x86_64: Add -mno-sse option
This disables generation of any SSE instructions (in particular
in stdarg function prologues). Necessary for kernel compiles.
Diffstat (limited to 'libtcc.c')
| -rw-r--r-- | libtcc.c | 15 |
1 files changed, 13 insertions, 2 deletions
@@ -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) { |
