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

Jakub Jelinek jakub@redhat.com
Wed Jun 24 13:48:42 GMT 2020


On Wed, Jun 24, 2020 at 03:36:25PM +0200, Tobias Burnus wrote:
> > What about 'gcc/config/i386/intelmic-mkoffload.c'?  I see that one
> > unconditionally passes '-fPIC' to some things -- is that doing the right
> > thing for your case, too?
> 
> I have not setup intelmic to test, but it uses -fPIC -share throughout
> and in particular for the sister function to the one to those patched.
> Hence, I expect that it will simply work. – But I wouldn't mind if you
> could test that it indeed does work.

The intelmic model was that both the main program and shared libraries
(which need offloading) contain in data section a shared library, and a
small main program always the same (if I remember well) dlopens those shared
libraries at runtime.
While not very common today, it is possible multiple shared libraries or
executable and one or more shared libraries have offloading code in them
for the same offloading target.
And one can deal with that only at runtime (== dynamic linking).

	Jakub



More information about the Gcc-patches mailing list