public inbox for jit@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH 0/3] jit: Add support for weak linkage
@ 2021-08-08 15:07 Petter Tomner
  2021-08-08 15:18 ` [PATCH 1/3] " Petter Tomner
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Petter Tomner @ 2021-08-08 15:07 UTC (permalink / raw)
  To: jit, gcc-patches

Hi,

To implement generics/C++ template-ish with libgccjit it would be very useful to have the possibility to declare functions and variables with weak linkage, to be able to have independent AOT compilation of object files without needing to keep track of what is "instantiated" where to prevent collisions.

I implemented this by giving 'gcc_jit_context_new_function()' and  'gcc_jit_context_new_global()' one new enum value EXPORTED_WEAK each that specifies an exported symbol with weak linkage. The variable or function is accessible from a 'result' as would it be EXPORTED.

I split the code up for it to be easier to read:

Patch 1 is the implementation.
Patch 2 is a test case.
Patch 3 is documentation updates.

I ran 'make check-jit' successfully on a x64-pc-gnu linux. I didn't make any ABI tag and the docs need regeneration in path 3.

Regards, Petter Tomner

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-08-08 15:21 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-08 15:07 [PATCH 0/3] jit: Add support for weak linkage Petter Tomner
2021-08-08 15:18 ` [PATCH 1/3] " Petter Tomner
2021-08-08 15:20 ` [PATCH 2/3] " Petter Tomner
2021-08-08 15:21 ` [PATCH 3/3] " Petter Tomner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).