diff options
Diffstat (limited to 'sys-libs')
-rw-r--r-- | sys-libs/libcxx/libcxx-6.0.0.ebuild | 14 | ||||
-rw-r--r-- | sys-libs/libcxx/libcxx-6.0.9999.ebuild | 14 | ||||
-rw-r--r-- | sys-libs/libcxx/libcxx-9999.ebuild | 14 |
3 files changed, 42 insertions, 0 deletions
diff --git a/sys-libs/libcxx/libcxx-6.0.0.ebuild b/sys-libs/libcxx/libcxx-6.0.0.ebuild index 9c9b75e3d7f1..0948ab0c6825 100644 --- a/sys-libs/libcxx/libcxx-6.0.0.ebuild +++ b/sys-libs/libcxx/libcxx-6.0.0.ebuild @@ -73,6 +73,11 @@ pkg_setup() { fi } +test_compiler() { + $(tc-getCXX) ${CXXFLAGS} ${LDFLAGS} "${@}" -o /dev/null -x c++ - \ + <<<'int main() { return 0; }' &>/dev/null +} + multilib_src_configure() { local cxxabi cxxabi_incs if use libcxxabi; then @@ -109,6 +114,15 @@ multilib_src_configure() { fi fi + # bootstrap: cmake is unhappy if compiler can't link to stdlib + local nolib_flags=( -nodefaultlibs -lc ) + if ! test_compiler; then + if test_compiler "${nolib_flags[@]}"; then + local -x LDFLAGS="${LDFLAGS} ${nolib_flags[*]}" + ewarn "${CXX} seems to lack runtime, trying with ${nolib_flags[*]}" + fi + fi + local libdir=$(get_libdir) local mycmakeargs=( -DLIBCXX_LIBDIR_SUFFIX=${libdir#lib} diff --git a/sys-libs/libcxx/libcxx-6.0.9999.ebuild b/sys-libs/libcxx/libcxx-6.0.9999.ebuild index cf76bba5fdfd..4e687c722c60 100644 --- a/sys-libs/libcxx/libcxx-6.0.9999.ebuild +++ b/sys-libs/libcxx/libcxx-6.0.9999.ebuild @@ -85,6 +85,11 @@ pkg_setup() { fi } +test_compiler() { + $(tc-getCXX) ${CXXFLAGS} ${LDFLAGS} "${@}" -o /dev/null -x c++ - \ + <<<'int main() { return 0; }' &>/dev/null +} + multilib_src_configure() { local cxxabi cxxabi_incs if use libcxxabi; then @@ -121,6 +126,15 @@ multilib_src_configure() { fi fi + # bootstrap: cmake is unhappy if compiler can't link to stdlib + local nolib_flags=( -nodefaultlibs -lc ) + if ! test_compiler; then + if test_compiler "${nolib_flags[@]}"; then + local -x LDFLAGS="${LDFLAGS} ${nolib_flags[*]}" + ewarn "${CXX} seems to lack runtime, trying with ${nolib_flags[*]}" + fi + fi + local libdir=$(get_libdir) local mycmakeargs=( -DLIBCXX_LIBDIR_SUFFIX=${libdir#lib} diff --git a/sys-libs/libcxx/libcxx-9999.ebuild b/sys-libs/libcxx/libcxx-9999.ebuild index 214c61d31f67..f304a076c171 100644 --- a/sys-libs/libcxx/libcxx-9999.ebuild +++ b/sys-libs/libcxx/libcxx-9999.ebuild @@ -84,6 +84,11 @@ pkg_setup() { fi } +test_compiler() { + $(tc-getCXX) ${CXXFLAGS} ${LDFLAGS} "${@}" -o /dev/null -x c++ - \ + <<<'int main() { return 0; }' &>/dev/null +} + multilib_src_configure() { local cxxabi cxxabi_incs if use libcxxabi; then @@ -120,6 +125,15 @@ multilib_src_configure() { fi fi + # bootstrap: cmake is unhappy if compiler can't link to stdlib + local nolib_flags=( -nodefaultlibs -lc ) + if ! test_compiler; then + if test_compiler "${nolib_flags[@]}"; then + local -x LDFLAGS="${LDFLAGS} ${nolib_flags[*]}" + ewarn "${CXX} seems to lack runtime, trying with ${nolib_flags[*]}" + fi + fi + local libdir=$(get_libdir) local mycmakeargs=( -DLIBCXX_LIBDIR_SUFFIX=${libdir#lib} |