EnumValue
Enum(offload_abi) String(lp64) Value(OFFLOAD_ABI_LP64)
+foffload-abi-host-opts=
+Common Joined MissingArgError(option missing after %qs)
+-foffload-abi-host-opts=<options> Specify host ABI options.
+
fomit-frame-pointer
Common Var(flag_omit_frame_pointer) Optimization
When possible do not generate stack frames.
aarch64_offload_options (void)
{
if (TARGET_ILP32)
- return xstrdup ("-foffload-abi=ilp32");
+ return xstrdup ("-foffload-abi=ilp32 -foffload-abi-host-opts=-mabi=ilp32");
else
- return xstrdup ("-foffload-abi=lp64");
+ return xstrdup ("-foffload-abi=lp64 -foffload-abi-host-opts=-mabi=lp64");
}
static struct machine_function *
static struct obstack files_to_cleanup;
enum offload_abi offload_abi = OFFLOAD_ABI_UNSET;
+const char *offload_abi_host_opts = NULL;
+
uint32_t elf_arch = EF_AMDGPU_MACH_AMDGCN_GFX900; // Default GPU architecture.
uint32_t elf_flags = EF_AMDGPU_FEATURE_SRAMECC_UNSUPPORTED_V4;
obstack_ptr_grow (&argv_obstack, gcn_dumpbase);
obstack_ptr_grow (&argv_obstack, "-dumpbase-ext");
obstack_ptr_grow (&argv_obstack, ".c");
- switch (offload_abi)
- {
- case OFFLOAD_ABI_LP64:
- obstack_ptr_grow (&argv_obstack, "-m64");
- break;
- case OFFLOAD_ABI_ILP32:
- obstack_ptr_grow (&argv_obstack, "-m32");
- break;
- default:
- gcc_unreachable ();
- }
+ if (!offload_abi_host_opts)
+ fatal_error (input_location,
+ "%<-foffload-abi-host-opts%> not specified.");
+ obstack_ptr_grow (&argv_obstack, offload_abi_host_opts);
obstack_ptr_grow (&argv_obstack, infile);
obstack_ptr_grow (&argv_obstack, "-c");
obstack_ptr_grow (&argv_obstack, "-o");
"unrecognizable argument of option %<" STR "%>");
}
#undef STR
+ else if (startswith (argv[i], "-foffload-abi-host-opts="))
+ {
+ if (offload_abi_host_opts)
+ fatal_error (input_location,
+ "%<-foffload-abi-host-opts%> specified "
+ "multiple times");
+ offload_abi_host_opts
+ = argv[i] + strlen ("-foffload-abi-host-opts=");
+ }
else if (strcmp (argv[i], "-fopenmp") == 0)
fopenmp = true;
else if (strcmp (argv[i], "-fopenacc") == 0)
ix86_offload_options (void)
{
if (TARGET_LP64)
- return xstrdup ("-foffload-abi=lp64");
- return xstrdup ("-foffload-abi=ilp32");
+ return xstrdup ("-foffload-abi=lp64 -foffload-abi-host-opts=-m64");
+ return xstrdup ("-foffload-abi=ilp32 -foffload-abi-host-opts=-m32");
}
/* Handle "cdecl", "stdcall", "fastcall", "regparm", "thiscall",
static const char *ptx_dumpbase;
enum offload_abi offload_abi = OFFLOAD_ABI_UNSET;
+const char *offload_abi_host_opts = NULL;
/* Delete tempfiles. */
obstack_ptr_grow (&argv_obstack, ptx_dumpbase);
obstack_ptr_grow (&argv_obstack, "-dumpbase-ext");
obstack_ptr_grow (&argv_obstack, ".c");
- switch (offload_abi)
- {
- case OFFLOAD_ABI_LP64:
- obstack_ptr_grow (&argv_obstack, "-m64");
- break;
- case OFFLOAD_ABI_ILP32:
- obstack_ptr_grow (&argv_obstack, "-m32");
- break;
- default:
- gcc_unreachable ();
- }
+ if (!offload_abi_host_opts)
+ fatal_error (input_location,
+ "%<-foffload-abi-host-opts%> not specified.");
+ obstack_ptr_grow (&argv_obstack, offload_abi_host_opts);
obstack_ptr_grow (&argv_obstack, infile);
obstack_ptr_grow (&argv_obstack, "-c");
obstack_ptr_grow (&argv_obstack, "-o");
"unrecognizable argument of option " STR);
}
#undef STR
+ else if (startswith (argv[i], "-foffload-abi-host-opts="))
+ {
+ if (offload_abi_host_opts)
+ fatal_error (input_location,
+ "%<-foffload-abi-host-opts%> specified "
+ "multiple times");
+ offload_abi_host_opts
+ = argv[i] + strlen ("-foffload-abi-host-opts=");
+ }
else if (strcmp (argv[i], "-fopenmp") == 0)
fopenmp = true;
else if (strcmp (argv[i], "-fopenacc") == 0)
rs6000_offload_options (void)
{
if (TARGET_64BIT)
- return xstrdup ("-foffload-abi=lp64");
+ return xstrdup ("-foffload-abi=lp64 -foffload-abi-host-opts=-m64");
else
- return xstrdup ("-foffload-abi=ilp32");
+ return xstrdup ("-foffload-abi=ilp32 -foffload-abi-host-opts=-m32");
}
\f
case OPT_foffload_abi_:
+ case OPT_foffload_abi_host_opts_:
if (existing_opt == -1)
decoded_options.safe_push (*foption);
else if (foption->value != decoded_options[existing_opt].value)
case OPT_fopenacc:
case OPT_fopenacc_dim_:
case OPT_foffload_abi_:
+ case OPT_foffload_abi_host_opts_:
case OPT_fcf_protection_:
case OPT_fasynchronous_unwind_tables:
case OPT_funwind_tables:
break;
case OPT_foffload_abi_:
+ case OPT_foffload_abi_host_opts_:
#ifdef ACCEL_COMPILER
/* Handled in the 'mkoffload's. */
#else
- error_at (loc, "%<-foffload-abi%> option can be specified only for "
- "offload compiler");
+ error_at (loc,
+ "%qs option can be specified only for offload compiler",
+ (code == OPT_foffload_abi_) ? "-foffload-abi"
+ : "-foffload-abi-host-opts");
#endif
break;