summaryrefslogtreecommitdiff
path: root/gcc/config/i386/intelmic-mkoffload.c
diff options
context:
space:
mode:
authortschwinge <tschwinge@138bc75d-0d04-0410-961f-82ee72b054a4>2015-01-08 14:58:45 +0000
committertschwinge <tschwinge@138bc75d-0d04-0410-961f-82ee72b054a4>2015-01-08 14:58:45 +0000
commitc049b358f961f72d0c0cf61a707e9a5855b12b28 (patch)
treec4f00143e8a22049b1f6cfddbf1ea04e65f5b4e0 /gcc/config/i386/intelmic-mkoffload.c
parentfb5eef67f6b041cd0bc4f1f8d62c1a000d59f497 (diff)
downloadgcc-c049b358f961f72d0c0cf61a707e9a5855b12b28.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@219345 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/i386/intelmic-mkoffload.c')
-rw-r--r--gcc/config/i386/intelmic-mkoffload.c12
1 files changed, 8 insertions, 4 deletions
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;