On Mon, Oct 2, 2017 at 8:17 AM, Timo Myyrä <[email protected]> wrote:
> Hi,
>
> I'm trying to make port of zdoom but I can't get it to link.
>
> The error I got was:
> CMakeFiles/zdoom.dir/scripting/vm/vmexec.cpp.o: In function 
> `__cxx_global_var_init':
> /home/tmy/tmp/gzdoom-g3.1.0/src/scripting/vm/vmexec.cpp:(.text+0x42): 
> undefined reference to `__cxa_thread_atexit'
> c++: error: linker command failed with exit code 1 (use -v to see invocation)
> *** Error 1 in . (src/CMakeFiles/zdoom.dir/build.make:10917 'gzdoom')
>
> I got a bit of help in this and added following to Makefile:
> CONFIGURE_ARGS+= -DCMAKE_EXE_LINKER_FLAGS="-lc++abi"
>
> That changed the above linking error to:
> usr/bin/../lib/libc++abi.so.0.0: undefined reference to 
> `pthread_rwlock_rdlock'
> /usr/bin/../lib/libc++abi.so.0.0: undefined reference to 
> `pthread_rwlock_unlock'
> /usr/bin/../lib/libc++abi.so.0.0: undefined reference to 
> `pthread_rwlock_wrlock'
>
>
> I tried to change CONFIGURE_ARGS as follows:
> CONFIGURE_ARGS+= -DCMAKE_EXE_LINKER_FLAGS="-lpthread -lc++abi"
>
> After compiling the linking failed with "undefined reference to
> `__cxa_thread_atexit'" which seems odd as it should be in the c++abi library.
>
> Any idea whats going on?

Unfortunately, our libc lacks __cxa_thread_atexit().
It is required for C++ TLS, for registering cleanups to be run when a
thread exits.

Mark Kettenis posted a diff on tech@ some time ago[1] but, afaik, it
has not yet been committed.

[1] https://marc.info/?l=openbsd-tech&m=150246192013629

Ciao!
David

Reply via email to