Re: [Patch][gcn, nvptx, offloading] mkoffload – handle -fpic/-fPIC

Tom de Vries tdevries@suse.de
Fri Jul 3 10:52:22 GMT 2020


On 6/26/20 9:35 PM, Moore, Catherine wrote:
> Hi Tom,
> 
> It doesn't look like you were explicitly cc'd on this patch and probably haven't seen it.  Would you mind taking a look and approving the nvptx portions?
> 

[ thanks for the ping, I think was explicitly cc-ed though.  I'm usually
not too fast in reviewing, and this time a vacation added to that. ]

The patch looks good to me.

I tried out the patch with one test-case and -pie -fPIC/-fpic already
seems to works, so perhaps we could have at least one test-case
exercising this in libgomp?  That sounds easier to do than the
shared-lib test-case.

I think it's a good idea though to do fPIE/fpie as well, either in this
patch or as follow-up.

Thanks,
- Tom

> Thanks,
> Catherine
> 
>> -----Original Message-----
>> From: Gcc-patches [mailto:gcc-patches-bounces@gcc.gnu.org] On Behalf
>> Of Burnus, Tobias
>> Sent: Tuesday, June 23, 2020 11:21 AM
>> To: gcc-patches <gcc-patches@gcc.gnu.org>; Jakub Jelinek
>> <jakub@redhat.com>
>> Cc: Stubbs, Andrew <Andrew_Stubbs@mentor.com>; Schwinge, Thomas
>> <Thomas_Schwinge@mentor.com>
>> Subject: [Patch][gcn, nvptx, offloading] mkoffload – handle -fpic/-fPIC
>>
>> If the offloading code is (only) in a library, one can come up
>> with the idea to build those parts as shared library – and link
>> it to the nonoffloading code.(*)
>>
>> Currently, this fails as the mkoffload calls the nonoffloading
>> compiler without the -fpic/-fPIC flags, even though the compiler
>> was originally invoked with those options. – And at some point,
>> the linker then complains.
>>
>> This patch simply adds -fpic/-fPIC to the calls to the nonoffloading
>> ("host") compiler, invoked from mkoffload, if they were present before.
>>
>> For the testcase at hand, this works with both AMDGCN and nvptx
>> with the attached patch.
>>
>> OK for the trunk?
>>
>> Tobias
>>
>> PS: I think as mid-/longterm project it would be nice to test this
>> in the testsuite, but that's unfortunately a larger task.
>>
>> (*) Thomas mentioned that this is supposed to work also in more
>> complex cases than the one I outlined, although, that is probably
>> currently the most common one.
>>
>> -----------------
>> Mentor Graphics (Deutschland) GmbH, Arnulfstraße 201, 80634 München /
>> Germany
>> Registergericht München HRB 106955, Geschäftsführer: Thomas Heurung,
>> Alexander Walter


More information about the Gcc-patches mailing list