public inbox for jit@gcc.gnu.org
 help / color / mirror / Atom feed
* Re: Basic linking / compilation question
  2015-01-01  0:00 Basic linking / compilation question Dibyendu Majumdar
@ 2015-01-01  0:00 ` David Malcolm
  2015-01-01  0:00   ` Dibyendu Majumdar
  0 siblings, 1 reply; 6+ messages in thread
From: David Malcolm @ 2015-01-01  0:00 UTC (permalink / raw)
  To: Dibyendu Majumdar; +Cc: jit

On Mon, 2015-06-08 at 21:58 +0100, Dibyendu Majumdar wrote:
> Is it a requirement that the application using libgccjit needs to be
> compiled using gcc 5.1 or does it not matter?

I don't think it should matter; I think it ought to just work.  For
example, using an older gcc for the application ought to be fine (though
that said, the testsuite doesn't cover this possibility).

[I'm assuming that the compiler you're using for the application is
sufficiently ABI-compatible with that used to compile libgccjit (e.g.
calling conventions) - you're not attempting to e.g. link code compiled
with Visual C++ against code compiled with gcc or anything like that are
you?]

Dave

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

* Re: Basic linking / compilation question
  2015-01-01  0:00   ` Dibyendu Majumdar
@ 2015-01-01  0:00     ` Dibyendu Majumdar
  2015-01-01  0:00       ` David Malcolm
  0 siblings, 1 reply; 6+ messages in thread
From: Dibyendu Majumdar @ 2015-01-01  0:00 UTC (permalink / raw)
  To: David Malcolm; +Cc: jit

Basic helloworld example works.

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

* Re: Basic linking / compilation question
  2015-01-01  0:00     ` Dibyendu Majumdar
@ 2015-01-01  0:00       ` David Malcolm
  2015-01-01  0:00         ` Dibyendu Majumdar
  0 siblings, 1 reply; 6+ messages in thread
From: David Malcolm @ 2015-01-01  0:00 UTC (permalink / raw)
  To: Dibyendu Majumdar; +Cc: jit

On Mon, 2015-06-08 at 23:41 +0100, Dibyendu Majumdar wrote:
> Basic helloworld example works.

Thanks.

It occurred to me overnight that given that libgccjit.so is linked
against the C++ STL (libstdc++.so.6 on my box), there's a chance of
issues when linking against C++ code, due to the change in the ABI of
std::string in GCC 5 (for adherence to the C++11 language standard).

So if you start seeing linker errors about unresolved symbols involving
"__cxx11", you might want to build with -D_GLIBCXX_USE_CXX11_ABI=0.

See:
http://developerblog.redhat.com/2015/02/05/gcc5-and-the-c11-abi/
and possibly this:
http://developerblog.redhat.com/2015/02/10/gcc-5-in-fedora/
(though you're on Ubuntu; I don't know if they did something similar).

That said, I don't *think* we use std::string anywhere inside gcc
itself, so this might still be a non-issue for you.

Hope this is helpful
Dave


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

* Basic linking / compilation question
@ 2015-01-01  0:00 Dibyendu Majumdar
  2015-01-01  0:00 ` David Malcolm
  0 siblings, 1 reply; 6+ messages in thread
From: Dibyendu Majumdar @ 2015-01-01  0:00 UTC (permalink / raw)
  To: jit

Is it a requirement that the application using libgccjit needs to be
compiled using gcc 5.1 or does it not matter?

Regards
Dibyendu

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

* Re: Basic linking / compilation question
  2015-01-01  0:00       ` David Malcolm
@ 2015-01-01  0:00         ` Dibyendu Majumdar
  0 siblings, 0 replies; 6+ messages in thread
From: Dibyendu Majumdar @ 2015-01-01  0:00 UTC (permalink / raw)
  To: David Malcolm; +Cc: jit

On 9 June 2015 at 15:37, David Malcolm <dmalcolm@redhat.com> wrote:
> It occurred to me overnight that given that libgccjit.so is linked
> against the C++ STL (libstdc++.so.6 on my box), there's a chance of
> issues when linking against C++ code, due to the change in the ABI of
> std::string in GCC 5 (for adherence to the C++11 language standard).
>
> So if you start seeing linker errors about unresolved symbols involving
> "__cxx11", you might want to build with -D_GLIBCXX_USE_CXX11_ABI=0.
>

Ok thanks - will bear that in mind. I do use C++ but only for the LLVM
implementation. Lua itself is in C, and my intention is keep to C for
libgccjit. So unless both LLVM and libgccjit are linked at the same
time hopefully there will not be an issue.

Regards

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

* Re: Basic linking / compilation question
  2015-01-01  0:00 ` David Malcolm
@ 2015-01-01  0:00   ` Dibyendu Majumdar
  2015-01-01  0:00     ` Dibyendu Majumdar
  0 siblings, 1 reply; 6+ messages in thread
From: Dibyendu Majumdar @ 2015-01-01  0:00 UTC (permalink / raw)
  To: David Malcolm; +Cc: jit

On 8 June 2015 at 22:25, David Malcolm <dmalcolm@redhat.com> wrote:
> On Mon, 2015-06-08 at 21:58 +0100, Dibyendu Majumdar wrote:
>> Is it a requirement that the application using libgccjit needs to be
>> compiled using gcc 5.1 or does it not matter?
>
> I don't think it should matter; I think it ought to just work.  For
> example, using an older gcc for the application ought to be fine (though
> that said, the testsuite doesn't cover this possibility).
>
> [I'm assuming that the compiler you're using for the application is
> sufficiently ABI-compatible with that used to compile libgccjit (e.g.
> calling conventions) - you're not attempting to e.g. link code compiled
> with Visual C++ against code compiled with gcc or anything like that are
> you?]

I used gcc 4.8.2 to compile gcc 5.1 (building on Ubuntu so no VC++).
Would like to continue using 4.8.2 for building Ravi (simply because
that's the installed version).

Regards
Dibyendu

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

end of thread, other threads:[~2015-06-09 19:08 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-01  0:00 Basic linking / compilation question Dibyendu Majumdar
2015-01-01  0:00 ` David Malcolm
2015-01-01  0:00   ` Dibyendu Majumdar
2015-01-01  0:00     ` Dibyendu Majumdar
2015-01-01  0:00       ` David Malcolm
2015-01-01  0:00         ` Dibyendu Majumdar

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