Re: strange message and failure with libgccjit (16, Debian/Trixie/AMD64)

Basile STARYNKEVITCH <[email protected]> Wed, 13 May 2026 09:07:35 +0200
Newsgroups gmane.comp.gcc.jit,gmane.comp.gcc.help
Message-ID <[email protected]>
On Tue, 2026-05-12 at 18:16 -0400, David Malcolm wrote:
> On Tue, 2026-05-12 at 23:54 +0200, Basile STARYNKEVITCH wrote:
> > Hello all,
> >=20
> >=20
> > I am getting strange message with libgccjit.
> >=20
> > You could look at the code in commit 76fa0e724496 of
> > https://github.com/RefPerSys/RefPerSys=C2=A0(a GPL licensed inference
> > engine
> > in C++, work in progress).
> >=20
> > The issue is described in https://github.com/RefPerSys/RefPerSys
>=20
> You didn't give the issue number, but I'm assuming you're referring
> to
> https://github.com/RefPerSys/RefPerSys/issues/36
>=20
> The log shows=20
>=20
> libgccjit.so: error: argument to =E2=80=98-O=E2=80=99 should be a non-neg=
ative
> integer,
> =E2=80=98g=E2=80=99, =E2=80=98s=E2=80=99, =E2=80=98z=E2=80=99 or =E2=80=
=98fast=E2=80=99
>=20
> Looks like:
> =C2=A0 gcc_jit_context_add_command_line_option(ctxt, "-O1 -g -fPIC -
> Wall");
> is wrong; rather than one call you should call it 4 times, once for
> each option:
> =C2=A0 gcc_jit_context_add_command_line_option(ctxt, "-O1");
> =C2=A0 gcc_jit_context_add_command_line_option(ctxt, "-g");
> etc.
>=20
> Does that fix the problem?


Yes, and I suggest improving the libgccjit documentation by mentioning
it (I mean both calls to gcc_jit_context_add_command_line_option above)
as an example.


--=20

Basile STARYNKEVITCH                          =20
<[email protected]>
8 rue de la Fa=C3=AFencerie                     =20
http://starynkevitch.net/Basile/ =20
92340 Bourg-la-Reine                       =20
https://github.com/bstarynk
France                              =20
https://github.com/RefPerSys/RefPerSys
                  https://orcid.org/0000-0003-0908-5250