This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [libgomp] No references to env.c -> no libgomp construction


Hello,

On Tue, 29 Nov 2016, Sebastian Huber wrote:
>         * env.c: Split out ICV definitions into...
>         * icv.c: ...here (new file) and...
>         * icv-device.c: ...here. New file.
> 
> the env.c contains now only local symbols (at least for target *-rtems*-*):
> 
[...]
> 
> Thus the libgomp constructor is not linked in into executables.

Thanks for the report.  This issue affects only static libgomp.a (and not on
NVPTX where env.c is deliberately empty).

I think the minimal solution here is to #include <env.c> from icv.c instead of
compiling it separately (using <> inclusion rather than "" so in case of NVPTX
we pick up the empty config/nvptx/env.c from toplevel icv.c).

A slightly more involved but perhaps a preferable approach is to remove
config/nvptx/env.c, introduce LIBGOMP_OFFLOADED_ONLY macro, and use it to
guard inclusion of env.c from icv.c (which then can use the #include "env.c"
form).

Thanks.
Alexander


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]