# pre-set since we need to pass it to cmake
BUILD_DIR=${WORKDIR}/${P}_build
+ local nolib_flags=( -nodefaultlibs -lc )
if use clang; then
local -x CC=${CHOST}-clang
local -x CXX=${CHOST}-clang++
# ensure we can use clang before installing compiler-rt
- local -x LDFLAGS="${LDFLAGS} -nodefaultlibs -lc"
+ local -x LDFLAGS="${LDFLAGS} ${nolib_flags[*]}"
strip-unsupported-flags
elif ! test_compiler; then
- local extra_flags=( -nodefaultlibs -lc )
- if test_compiler "${extra_flags[@]}"; then
- local -x LDFLAGS="${LDFLAGS} ${extra_flags[*]}"
- ewarn "${CC} seems to lack runtime, trying with ${extra_flags[*]}"
+ if test_compiler "${nolib_flags[@]}"; then
+ local -x LDFLAGS="${LDFLAGS} ${nolib_flags[*]}"
+ ewarn "${CC} seems to lack runtime, trying with ${nolib_flags[*]}"
fi
fi
# pre-set since we need to pass it to cmake
BUILD_DIR=${WORKDIR}/${P}_build
+ local nolib_flags=( -nodefaultlibs -lc )
if use clang; then
local -x CC=${CHOST}-clang
local -x CXX=${CHOST}-clang++
# ensure we can use clang before installing compiler-rt
- local -x LDFLAGS="${LDFLAGS} -nodefaultlibs -lc"
+ local -x LDFLAGS="${LDFLAGS} ${nolib_flags[*]}"
strip-unsupported-flags
elif ! test_compiler; then
- local extra_flags=( -nodefaultlibs -lc )
- if test_compiler "${extra_flags[@]}"; then
- local -x LDFLAGS="${LDFLAGS} ${extra_flags[*]}"
- ewarn "${CC} seems to lack runtime, trying with ${extra_flags[*]}"
+ if test_compiler "${nolib_flags[@]}"; then
+ local -x LDFLAGS="${LDFLAGS} ${nolib_flags[*]}"
+ ewarn "${CC} seems to lack runtime, trying with ${nolib_flags[*]}"
fi
fi