diff options
author | Michał Górny <mgorny@gentoo.org> | 2017-11-10 23:41:55 +0100 |
---|---|---|
committer | Michał Górny <mgorny@gentoo.org> | 2018-08-09 13:52:57 +0200 |
commit | 5c01167303f7baaec381a4a85ad5f4f3ca16c3c6 (patch) | |
tree | 811ee9ef92066ef3c024d33127757e66b7b2776d /sys-devel | |
parent | games-arcade/methane: Drop comments (diff) | |
download | gentoo-5c01167303f7baaec381a4a85ad5f4f3ca16c3c6.tar.gz gentoo-5c01167303f7baaec381a4a85ad5f4f3ca16c3c6.tar.bz2 gentoo-5c01167303f7baaec381a4a85ad5f4f3ca16c3c6.zip |
sys-devel/llvm: Add custom SOVERSION suffix when linking to libc++
Diffstat (limited to 'sys-devel')
-rw-r--r-- | sys-devel/llvm/llvm-9999.ebuild | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/sys-devel/llvm/llvm-9999.ebuild b/sys-devel/llvm/llvm-9999.ebuild index 612f8a07e7b8..d5404d204a07 100644 --- a/sys-devel/llvm/llvm-9999.ebuild +++ b/sys-devel/llvm/llvm-9999.ebuild @@ -89,6 +89,18 @@ src_prepare() { cmake-utils_src_prepare } +# Is LLVM being linked against libc++? +is_libcxx_linked() { + local code='#include <ciso646> +#if defined(_LIBCPP_VERSION) + HAVE_LIBCXX +#endif +' + local out=$($(tc-getCXX) ${CXXFLAGS} ${CPPFLAGS} -x c++ -E -P - <<<"${code}") || return 1 + + [[ ${out} == *HAVE_LIBCXX* ]] +} + multilib_src_configure() { local ffi_cflags ffi_ldflags if use libffi; then @@ -132,6 +144,15 @@ multilib_src_configure() { -DOCAMLFIND=NO ) + if is_libcxx_linked; then + # Smart hack: alter version suffix -> SOVERSION when linking + # against libc++. This way we won't end up mixing LLVM libc++ + # libraries with libstdc++ clang, and the other way around. + mycmakeargs+=( + -DLLVM_VERSION_SUFFIX="libcxx" + ) + fi + # Note: go bindings have no CMake rules at the moment # but let's kill the check in case they are introduced # if ! multilib_is_native_abi || ! use go; then |