On 23/06/2020 16:21, Tobias Burnus wrote:
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?
The GCN bit is OK. Andrew
