x86_64: Add -mno-sse option
This disables generation of any SSE instructions (in particular in stdarg function prologues). Necessary for kernel compiles.
This commit is contained in:
15
libtcc.c
15
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) {
|
||||
|
||||
Reference in New Issue
Block a user