[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: OpenBSD crashes - GWorkspace coredumps - mismatched C++ libraries

From: Riccardo Mottola
Subject: Re: OpenBSD crashes - GWorkspace coredumps - mismatched C++ libraries
Date: Wed, 21 Jul 2021 01:12:26 +0200
User-agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:60.0) Gecko/20100101 SeaMonkey/2.53.8

Hi David,

David Chisnall wrote:
Hi Riccardo,

On 21/05/2021 15:14, Riccardo Mottola wrote:
So indeed, once running, there is a mix of:

         0f88c000 2f96f000 rlib  0    1   0 /usr/local/lib/

         08fb7000 28fbd000 rlib  0    2   0 /usr/lib/
         0ca18000 2ca1c000 rlib  0    3   0 /usr/lib/

That is, indeed, the problem.  You can mix libc++ and libstdc++ (though the types cannot cross a library boundary) but both libc++abi and libsupc++ expose the same symbols and cannot be mixed.  By default, libstdc++ statically links libsupc++.  On FreeBSD, we avoid this by linking both libc++ and libstdc++ against the system-provided libcxxrt.  It looks as if OpenBSD (at least with your egcc build) doesn't do this.

where do you do this logic... is it insite a specific FreeBSD section of gnustep-make? I looked for it without finding it.

We need to hook into the C++ runtime library to ensure that Objective-C++ exceptions work.  You need to either:

 - Compile and link the C++ library (PDFKit) against the system C++ implementation (libc++ / libc++abi), or  - Compile and link the Objective-C runtime against the extra c++ runtime (libestd++).  Note that libestdc++ is an unusual name and so won't be found by default, you will need to pass this as an explicit option in the libobjc2 build (ccmake will show you the name).

You speak about the Objective-C runtime, but I use the GCC provided one, so I don't have control on that.

I noticed that even base is linked about libc++
        0eca7000 2ed8a000 rlib  0    1   0 /usr/local/lib/
        006b8000 206be000 rlib  0    2   0 /usr/lib/
        0e776000 2e77a000 rlib  0    3   0 /usr/lib/

So it is already a strange "mix". I checked what I have with the "e" prefix in OpenBSD local:
/usr/local/lib/libestdc++.a /usr/local/lib/
/usr/local/lib/ /usr/local/lib/libexslt.a

so the issue is libc++abi as far as you tell me. I'd like to link anything about the "new" runtime I have in local coming from gcc 8, named egcc (hence the e prefix) how should I do that? tricks in tools make?

I don't think it is easy to have PDFKit link against the system C++ libraries, since it compiles with CXX=eg++ and will favour its own library.

Thank you,


reply via email to

[Prev in Thread] Current Thread [Next in Thread]