gnustep-dev
[Top][All Lists]
Advanced

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

Re: libobjc2 on OpenBSD 6.8 build errors - C++ runtime not found


From: David Chisnall
Subject: Re: libobjc2 on OpenBSD 6.8 build errors - C++ runtime not found
Date: Sun, 7 Feb 2021 17:49:08 +0000

Hi,

> On 2 Feb 2021, at 14:22, Riccardo Mottola <riccardo.mottola@libero.it> wrote:
> 
> Hi,
> 
> while I need to find some time to reply about NetBSD issues, I wanted to test 
> current  base/gui/back on OpenBSD before our release and as I was also test 
> latest libobjc2. Since I had pending to upgraded to latest OpenBSD 6.8, I did 
> that too.
> 
> Before upgrading, I did build libobjc2 on 6.7 which had an older clang: it 
> did build and 95% of the test passed (the failures being similar to 
> NetBSD/amd64 btw). After that I proceeded upgrading my system, userland, 
> packages and restarted building libobjc2.
> 
> I get this failure during build:
> 
> Scanning dependencies of target CXXExceptions_legacy_optimised
> [  9%] Building C object 
> Test/CMakeFiles/CXXExceptions_legacy_optimised.dir/CXXException.m.o
> [ 10%] Building CXX object 
> Test/CMakeFiles/CXXExceptions_legacy_optimised.dir/CXXException.cc.o
> [ 10%] Linking C executable CXXExceptions_legacy_optimised
> ld: error: /home/multix/code/gnustep-cvs/libobjc2/Build/libobjc.so: undefined 
> reference to cxx_throw()
> ld: error: /home/multix/code/gnustep-cvs/libobjc2/Build/libobjc.so: undefined 
> reference to test_eh_personality
> cc: error: linker command failed with exit code 1 (use -v to see invocation)
> gmake[2]: *** 
> [Test/CMakeFiles/CXXExceptions_legacy_optimised.dir/build.make:123: 
> Test/CXXExceptions_legacy_optimised] Error 1
> gmake[1]: *** [CMakeFiles/Makefile2:558: 
> Test/CMakeFiles/CXXExceptions_legacy_optimised.dir/all] Error 2
> gmake: *** [Makefile:183: all] Error 2

This looks as if we’re still compiling in the code that calls the function that 
figures out the the C++ ABI at run time dynamically.  This is added here:

https://github.com/gnustep/libobjc2/blob/93fbf4d4bcf8b7bdb2dd2f11207a2e6eeba9c46c/CMakeLists.txt#L325

I believe it should be pulled out into a separate if block, because we disable 
ObjC++ here:

https://github.com/gnustep/libobjc2/blob/93fbf4d4bcf8b7bdb2dd2f11207a2e6eeba9c46c/CMakeLists.txt#L318

Can you try moving it out and raise a PR if it fixes the build for you?  We 
shouldn’t break the no-C++ case, at least, though it should be working on 
OpenBSD.

> 
> 
> (which, if memory serves me, was one of the tests failing on 6.7, but at 
> leaste everything compiled)
> 
> I am suspicious that I do not find the CXX_RUNTIME_LIB set by cmake.
> 
> While runing cmake, I saw this:
> 
> -- Testing C++ interop
> -- Testing /usr/lib/libsupc++.a as the C++ runtime library
> -- Testing /usr/lib/libc++abi.so.3.0 as the C++ runtime library
> -- Testing C++ standard library
> -- Using /usr/bin/cc
> -- No useable C++ runtime found
> 
> 
> why doesn't it like my runtime library?

The file that it tries to compile is in the cmake directory, can you try 
compiling it and see what happens?  The line that tries to compile it is here:

https://github.com/gnustep/libobjc2/blob/93fbf4d4bcf8b7bdb2dd2f11207a2e6eeba9c46c/CMakeLists.txt#L231

I don’t know why this would fail with either libc++abi.so.3.0 or with your C++ 
standard library.  Either should work and so I don’t know why this test would 
fail.

David




reply via email to

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