Exemplo n.º 1
0
int action_dumpmachine(const char *argv0)
{
    (void)argv0;
    /* we should print the "target machine" but cparser can address multiple
     * targets, so we just print the host machine */
    machine_triple_t *host = get_host_machine_triple();
    printf("%s-%s-%s\n", host->cpu_type, host->manufacturer,
           host->operating_system);
    return EXIT_SUCCESS;
}
Exemplo n.º 2
0
static void determine_target_machine(void)
{
	if (target.machine == NULL)
		target.machine = get_host_machine_triple();
	/* adjust for -m32/-m64 flag */
	const char *cpu = target.machine->cpu_type;
	if (is_ia32_cpu(cpu) && target_size_override == 64) {
		free(target.machine->cpu_type);
		target.machine->cpu_type = xstrdup("x86_64");
	} else if (is_amd64_cpu(cpu) && target_size_override == 32) {
		free(target.machine->cpu_type);
		target.machine->cpu_type = xstrdup("i686");
	}
}