From 4f929d9da16fca9bcde0d1077c15136e944c5c0d Mon Sep 17 00:00:00 2001 From: Thomas Schwinge Date: Thu, 8 Jan 2015 15:58:45 +0100 Subject: [PATCH] intelmic-mkoffload: Deal with linker defaulting to 32-bit x86 mode. ... which explicitly has to be switched into 64-bit x86_64 mode. gcc/ * config/i386/intelmic-mkoffload.c (compile_for_target): Always add "-m32" or "-m64" to argv_obstack. (generate_host_descr_file): Likewise, when invoking host_compiler. (main): Always add "-m elf_i386" or "-m elf_x86_64" when invoking ld. From-SVN: r219345 --- gcc/ChangeLog | 8 ++++++++ gcc/config/i386/intelmic-mkoffload.c | 12 ++++++++---- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index bee5f1e908e..01b6cc6baaf 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2015-01-08 Thomas Schwinge + + * config/i386/intelmic-mkoffload.c (compile_for_target): Always + add "-m32" or "-m64" to argv_obstack. + (generate_host_descr_file): Likewise, when invoking host_compiler. + (main): Always add "-m elf_i386" or "-m elf_x86_64" when invoking + ld. + 2015-01-08 Oleg Endo * config/sh/sh-mem.cc: Use constant as second operand when emitting diff --git a/gcc/config/i386/intelmic-mkoffload.c b/gcc/config/i386/intelmic-mkoffload.c index c3d2b230287..23bc955f4a0 100644 --- a/gcc/config/i386/intelmic-mkoffload.c +++ b/gcc/config/i386/intelmic-mkoffload.c @@ -191,6 +191,8 @@ compile_for_target (struct obstack *argv_obstack) { if (target_ilp32) obstack_ptr_grow (argv_obstack, "-m32"); + else + obstack_ptr_grow (argv_obstack, "-m64"); obstack_ptr_grow (argv_obstack, NULL); char **argv = XOBFINISH (argv_obstack, char **); @@ -355,6 +357,8 @@ generate_host_descr_file (const char *host_compiler) new_argv[new_argc++] = "-shared"; if (target_ilp32) new_argv[new_argc++] = "-m32"; + else + new_argv[new_argc++] = "-m64"; new_argv[new_argc++] = src_filename; new_argv[new_argc++] = "-o"; new_argv[new_argc++] = obj_filename; @@ -511,11 +515,11 @@ main (int argc, char **argv) unsigned new_argc = 0; const char *new_argv[9]; new_argv[new_argc++] = "ld"; + new_argv[new_argc++] = "-m"; if (target_ilp32) - { - new_argv[new_argc++] = "-m"; - new_argv[new_argc++] = "elf_i386"; - } + new_argv[new_argc++] = "elf_i386"; + else + new_argv[new_argc++] = "elf_x86_64"; new_argv[new_argc++] = "--relocatable"; new_argv[new_argc++] = host_descr_filename; new_argv[new_argc++] = target_so_filename; -- 2.30.2