mirror of
https://github.com/apple/foundationdb.git
synced 2025-05-15 18:32:18 +08:00
Updated the linker to support clang libraries
This commit is contained in:
parent
e59fb55342
commit
d56f95f624
@ -43,13 +43,23 @@ case $1 in
|
|||||||
|
|
||||||
OPTIONS=$( eval echo "$OPTIONS $LDFLAGS \$$2_OBJECTS \$$2_LIBS \$$2_STATIC_LIBS_REAL \$$2_LDFLAGS -o $3" )
|
OPTIONS=$( eval echo "$OPTIONS $LDFLAGS \$$2_OBJECTS \$$2_LIBS \$$2_STATIC_LIBS_REAL \$$2_LDFLAGS -o $3" )
|
||||||
|
|
||||||
if echo $OPTIONS | grep -q -- -static-libstdc\+\+ ; then
|
if [[ "${OPTIONS}" == *"-static-libstdc++"* ]]; then
|
||||||
OPTIONS=$( echo $OPTIONS | sed -e s,-static-libstdc\+\+,, -e s,\$,\ `$CC -print-file-name=libstdc++.a`\ -lm, )
|
staticlibs=()
|
||||||
|
staticpaths=''
|
||||||
|
if [[ "${CC}" == *"gcc"* ]]; then
|
||||||
|
staticlibs+=('libstdc++.a')
|
||||||
|
elif [[ "${CXX}" == *"clang++"* ]]; then
|
||||||
|
staticlibs+=('libc++.a' 'libc++abi.a')
|
||||||
|
fi
|
||||||
|
for staticlib in "${staticlibs[@]}"; do
|
||||||
|
staticpaths+="$("${CC}" -print-file-name="${staticlib}") "
|
||||||
|
done
|
||||||
|
OPTIONS=$( echo $OPTIONS | sed -e s,-static-libstdc\+\+,, -e s,\$,\ "${staticpaths}"\ -lm, )
|
||||||
fi
|
fi
|
||||||
|
|
||||||
case $PLATFORM in
|
case $PLATFORM in
|
||||||
osx)
|
osx)
|
||||||
if echo $OPTIONS | grep -q -- -static-libgcc ; then
|
if [[ "${OPTIONS}" == *"-static-libgcc"* ]]; then
|
||||||
$( $CC -### $OPTIONS 2>&1 | grep '^ ' | sed -e s,^\ ,, -e s,-lgcc[^\ ]*,,g -e s,\",,g -e s,\$,\ `$CC -print-file-name=libgcc_eh.a`, -e s,10.8.2,10.6, )
|
$( $CC -### $OPTIONS 2>&1 | grep '^ ' | sed -e s,^\ ,, -e s,-lgcc[^\ ]*,,g -e s,\",,g -e s,\$,\ `$CC -print-file-name=libgcc_eh.a`, -e s,10.8.2,10.6, )
|
||||||
else
|
else
|
||||||
$CC $OPTIONS
|
$CC $OPTIONS
|
||||||
|
Loading…
x
Reference in New Issue
Block a user