diff options
author | Thomas Schwinge <thomas@codesourcery.com> | 2015-01-08 15:58:45 +0100 |
---|---|---|
committer | Thomas Schwinge <tschwinge@gcc.gnu.org> | 2015-01-08 15:58:45 +0100 |
commit | 4f929d9da16fca9bcde0d1077c15136e944c5c0d (patch) | |
tree | c4f00143e8a22049b1f6cfddbf1ea04e65f5b4e0 /gcc | |
parent | 53dd59bff5ade371a5d0d78a720330c2b2f68976 (diff) | |
download | gcc-4f929d9da16fca9bcde0d1077c15136e944c5c0d.zip gcc-4f929d9da16fca9bcde0d1077c15136e944c5c0d.tar.gz gcc-4f929d9da16fca9bcde0d1077c15136e944c5c0d.tar.bz2 |
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
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/config/i386/intelmic-mkoffload.c | 12 |
2 files changed, 16 insertions, 4 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index bee5f1e..01b6cc6 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2015-01-08 Thomas Schwinge <thomas@codesourcery.com> + + * 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 <olegendo@gcc.gnu.org> * 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 c3d2b23..23bc955 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; |