It is enabled by setting WITH_LLVM_LIBUNWIND in src.conf(5). It is currently built in libgcc_s.so and libgcc_eh.a to simplify the transition.
Details
Diff Detail
- Repository
- rS FreeBSD src repository - subversion
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
I ran nm --dynamic over a copy of libgcc_s.so built with and without this patch, here is the diff (after stripping addresses). The orig file is the current code, the new file is with this patch.
--- nm_orig_noaddr.txt 2016-01-08 16:53:09.888377000 +0000 +++ nm_new_noaddr.txt 2016-01-08 16:53:17.568408000 +0000 @@ -24,32 +24,30 @@ T _Unwind_Resume_or_Rethrow T _Unwind_SetGR T _Unwind_SetIP + U __assert T __bswapdi2 T __bswapsi2 T __clear_cache w __cxa_finalize T __deregister_frame - T __deregister_frame_info - T __deregister_frame_info_bases T __divsc3 T __enable_execute_stack T __gcc_personality_v0 T __mulsc3 T __powisf2 T __register_frame - T __register_frame_info - T __register_frame_info_bases - T __register_frame_info_table - T __register_frame_info_table_bases - T __register_frame_table + U __stderrp U abort U dl_iterate_phdr + U dladdr + U fprintf U free + U fwrite + U getenv U malloc U memcpy U memset - w pthread_mutex_lock - w pthread_mutex_unlock - w pthread_once - U puts - U strlen + U pthread_rwlock_rdlock + U pthread_rwlock_unlock + U pthread_rwlock_wrlock + U snprintf
frame registration functions
T __deregister_frame_info T __deregister_frame_info_bases T __register_frame_info T __register_frame_info_bases T __register_frame_info_table T __register_frame_info_table_bases T __register_frame_table
I think these are all fine as previously built binaries carry a weak stub.
string and misc libc functions
- U puts - U strlen + U dladdr + U fprintf + U fwrite + U getenv + U snprintf
An artifact of different implementations, should be fine.
+ U __assert + U __stderrp
I think this is fine.
- w pthread_mutex_lock - w pthread_mutex_unlock - w pthread_once + U pthread_rwlock_rdlock + U pthread_rwlock_unlock + U pthread_rwlock_wrlock
Switch from mutex to rwlock is fine. I suspect the weak ones date from before libc carried weak versions of pthread functions and this is acceptable now.
@kan can you comment on the symbol changes introduced here (specifically wrt. the weak thread functions)?
exp-run requested in PR 206039 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=206039
I'm happy with this on arm64, it may need more work for other architectures but this shouldn't stop us using it now.
In discussion on IRC we did discover that old GCCs don't put the eh into a separate segment and therefore require __register_frame_info et al. It is still unclear whether this is an issue that needs to be solved.