Matthias Klose <d...@ubuntu.com> writes: > Trying to build a nvptx offload compiler on aarch64-linux-gnu, the libgomp > tests > error out with > > unrecognizable argument of option -foffload-abi > > Passing that option goes a step further, hitting PR target/96265. Define that > hook, as it was done for rs6000 in 2015. Ok for the trunk?
OK, thanks. Up to you whether to reorder as Thomas suggested. Richard > Matthias > > > * config/aarch64/aarch64.c (+aarch64_offload_options, > TARGET_OFFLOAD_OPTIONS): New. > > --- a/gcc/config/aarch64/aarch64.c > +++ b/gcc/config/aarch64/aarch64.c > @@ -22739,6 +22739,16 @@ aarch64_stack_protect_guard (void) > return NULL_TREE; > } > > +/* Implement the TARGET_OFFLOAD_OPTIONS hook. */ > +static char * > +aarch64_offload_options (void) > +{ > + if (TARGET_ILP32) > + return xstrdup ("-foffload-abi=ilp32"); > + else > + return xstrdup ("-foffload-abi=lp64"); > +} > + > /* Return the diagnostic message string if conversion from FROMTYPE to > TOTYPE is not allowed, NULL otherwise. */ > > @@ -23079,6 +23089,9 @@ aarch64_libgcc_floating_mode_supported_p > #undef TARGET_NARROW_VOLATILE_BITFIELD > #define TARGET_NARROW_VOLATILE_BITFIELD hook_bool_void_false > > +#undef TARGET_OFFLOAD_OPTIONS > +#define TARGET_OFFLOAD_OPTIONS aarch64_offload_options > + > #undef TARGET_OPTION_OVERRIDE > #define TARGET_OPTION_OVERRIDE aarch64_override_options >