[Openmp-dev] Generic_GCC::TranslateArgs() forces -shared -fpic for offloading

Andreas Hommel via Openmp-dev openmp-dev at lists.llvm.org
Mon Oct 14 00:25:48 PDT 2019


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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/openmp-dev/attachments/20191014/6381fcb6/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 9859 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-dev/attachments/20191014/6381fcb6/attachment-0001.bin>


More information about the Openmp-dev mailing list