Generic_GCC::TranslateArgs() forces -shared -fpic for offloading

Generic_GCC::TranslateArgs() in Gnu.cpp unconditionally adds this

// Request the shared library. Given that these options are decided

// implicitly, they do not refer to any base argument.

DAL->AddFlagArg(/BaseArg=/nullptr, Opts.getOption(options::OPT_shared));

DAL->AddFlagArg(/BaseArg=/nullptr, Opts.getOption(options::OPT_fPIC));

and removes other shared/pic/pie options when generating the command line options for offloaded code.

This breaks our internal target which does not support PIC or shared. I have added a check to skip this part when generating code for our target, but I am wondering if it would be better to use a positive check for this so that only targets that require these options (SMP target devices), e.g., something like this:

if (DeviceOffloadKind == Action::OFK_OpenMP &&

(getTriple().getArch() == llvm::Triple:: x86_64 || …) ) {

-Andreas