提交 67a0383d 编写于 作者: R Rich Felker

avoid linking main program in linker tests

it's possible that the user has provided a compiler that does not have
any libc to link to, so linking a main program is a bad idea. instead,
generate an empty shared library with no dependencies.
上级 0c5efde8
...@@ -69,8 +69,8 @@ fi ...@@ -69,8 +69,8 @@ fi
tryldflag () { tryldflag () {
printf "checking whether linker accepts %s... " "$2" printf "checking whether linker accepts %s... " "$2"
echo "int main() { return 0; }" > "$tmpc" echo "typedef int x;" > "$tmpc"
if "$CC" "$2" -o /dev/null "$tmpc" 2>/dev/null ; then if "$CC" -shared "$2" -o /dev/null "$tmpc" 2>/dev/null ; then
printf "yes\n" printf "yes\n"
eval "$1=\"\${$1} \$2\"" eval "$1=\"\${$1} \$2\""
eval "$1=\${$1# }" eval "$1=\${$1# }"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册