[Bug 215709] Use of thread_local produces linking errors [now with gcc]

[email protected]
Newsgroups gmane.os.freebsd.devel.threading
Message-ID <[email protected]/bugzilla/>
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=215709

            Bug ID: 215709
           Summary: Use of thread_local produces linking errors [now with
                    gcc]
           Product: Base System
           Version: 11.0-RELEASE
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Some People
          Priority: ---
         Component: threads
          Assignee: [email protected]
          Reporter: [email protected]

192320 implemented __cxa_thread_atexit so that base's clang now supports
c++11's thread_local keyword. However, this seems to now have broken static
linking with the GCCs that complain about double definitions:

cd /home/mi/h4nn3s/devel/lambda-build/pkg/src && /usr/local/bin/cmake -E
cmake_link_script CMakeFiles/lambda.dir/link.txt --verbose=1
/usr/local/libexec/ccache/g++6     -fopenmp -Wno-vla -O3 -DNDEBUG -flto=8 -s  
-static CMakeFiles/lambda.dir/lambda.cpp.o  -o ../bin/lambda  -lpthread
-lexecinfo -lelf -lz -lbz2 
//usr/lib/libc.a(cxa_thread_atexit.o): In function `__cxa_thread_atexit':
/usr/src/lib/libc/stdlib/cxa_thread_atexit.c:(.text+0x0): multiple definition
of `__cxa_thread_atexit'
/usr/local/lib/gcc6/gcc/x86_64-portbld-freebsd11.0/6.3.0/../../../libstdc++.a(atexit_thread.o):/wrkdirs/usr/ports/lang/gcc6/work/gcc-6.3.0/libstdc++-v3/libsupc++/atexit_thread.cc:117:
first defined here
collect2: error: ld returned 1 exit status

So now a I have a workaround for FreeBSD<11 + LLVM and I seem to need one for
FreeBSD>=11 + GCC. Needless to say, static linking with LLVM already doesn't
work at all, because the necessary openmp .a is not shipped.
It's starting to really get confusing :o

Anything I can do to help fix this?

Thanks!

-- 
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-threads
To unsubscribe, send any mail to "[email protected]"
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.