--- a/libcxx-6.0.1.ebuild 2018-08-07 23:22:18.588066104 +0000 +++ b/libcxx-6.0.1.ebuild 2018-08-08 16:39:40.197601590 +0000 @@ -103,14 +103,11 @@ if tc-is-clang; then # get the full library list out of 'pretend mode' # and grep it for libclang_rt references - local args=( $($(tc-getCC) -### -x c - 2>&1 | tail -n 1) ) - local i - for i in "${args[@]}"; do - if [[ ${i} == *libclang_rt* ]]; then - want_gcc_s=OFF - extra_libs+=( "${i}" ) - fi - done + local compiler_rt=( $($(tc-getCC) -print-libgcc-file-name - 2>&1 ) ) + if [[ ${compiler-rt} == *libclang_rt* ]]; then + want_gcc_s=OFF + extra_libs+=( "${compiler-rt}" ) + fi fi fi