public inbox for jit@gcc.gnu.org
 help / color / mirror / Atom feed
* AOT compiling and libraries to link against
@ 2022-01-29 22:09 Marc Nieper-Wißkirchen
  2022-01-29 22:26 ` SV: " Petter Tomner
  0 siblings, 1 reply; 3+ messages in thread
From: Marc Nieper-Wißkirchen @ 2022-01-29 22:09 UTC (permalink / raw)
  To: Marc Nieper-Wißkirchen via Jit

In the documentation about AOT compiling ([1]) it says that there is
currently no support for specifying libraries to link against.

And, indeed, if I add, say, "-lname" via add_command_line_option to the
driver command line, I get an error message

libgccjit.so: error: command-line option '-lname' is valid for the driver
but not for

Is there a principal reason why specifying such flags is not possible?
Could it be easily added or are there workarounds?

Thanks,

Marc

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

* SV: AOT compiling and libraries to link against
  2022-01-29 22:09 AOT compiling and libraries to link against Marc Nieper-Wißkirchen
@ 2022-01-29 22:26 ` Petter Tomner
  2022-01-30 15:57   ` Marc Nieper-Wißkirchen
  0 siblings, 1 reply; 3+ messages in thread
From: Petter Tomner @ 2022-01-29 22:26 UTC (permalink / raw)
  To: Marc Nieper-Wißkirchen, jit

The docs are not synced with the addition of gcc_jit_context_add_driver_option,
which allows linking.

You can use:

E.g.
gcc_jit_context_add_driver_option(ctxt, "obj.o")
or
gcc_jit_context_add_driver_option(ctxt, "-L.")
gcc_jit_context_add_driver_option(ctxt, "-lwhatever")

for that.

Regards,    

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

* Re: AOT compiling and libraries to link against
  2022-01-29 22:26 ` SV: " Petter Tomner
@ 2022-01-30 15:57   ` Marc Nieper-Wißkirchen
  0 siblings, 0 replies; 3+ messages in thread
From: Marc Nieper-Wißkirchen @ 2022-01-30 15:57 UTC (permalink / raw)
  To: Petter Tomner, David Malcolm; +Cc: Marc Nieper-Wißkirchen, jit

Thank you, Petter!

I missed gcc_jit_context_add_driver_option (and just noticed
gcc_jit_context_add_command_line_option).

@David Malcolm <dmalcolm@redhat.com> The method add_driver_option is also
implemented in the C++ API, but not documented ([1]).

--

[1] https://gcc.gnu.org/onlinedocs/jit/cp/topics/contexts.html#options

Am Sa., 29. Jan. 2022 um 23:26 Uhr schrieb Petter Tomner <tomner@kth.se>:

> The docs are not synced with the addition of
> gcc_jit_context_add_driver_option,
> which allows linking.
>
> You can use:
>
> E.g.
> gcc_jit_context_add_driver_option(ctxt, "obj.o")
> or
> gcc_jit_context_add_driver_option(ctxt, "-L.")
> gcc_jit_context_add_driver_option(ctxt, "-lwhatever")
>
> for that.
>
> Regards,

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

end of thread, other threads:[~2022-01-30 15:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-29 22:09 AOT compiling and libraries to link against Marc Nieper-Wißkirchen
2022-01-29 22:26 ` SV: " Petter Tomner
2022-01-30 15:57   ` Marc Nieper-Wißkirchen

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).