host_detect_local_cpu (int argc, const char **argv)
{
const char *cpu = NULL;
+ /* Don't assigne any static string to ret. If you need to do so,
+ use concat. */
char *ret = NULL;
char buf[128];
FILE *f;
fallback_cpu:
#if defined (__mips_nan2008)
- ret = reconcat (ret, " -mnan=2008 ", NULL);
+ /* Put the ret to the end of list, since it may be NULL. */
+ ret = reconcat (ret, " -mnan=2008 ", ret, NULL);
#endif
#ifdef HAVE_GETAUXVAL
#endif
if (cpu)
- ret = reconcat (ret, ret, "-m", argv[0], "=", cpu, NULL);
+ ret = reconcat (ret, " -m", argv[0], "=", cpu, ret, NULL);
return ret;
}