[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [Bug 1258168] Re: QEMU fails to build on CentOS 5.10 wi
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [Bug 1258168] Re: QEMU fails to build on CentOS 5.10 with --disable-pie reporting "/usr/bin/ld: -f may not be used without -shared " |
Date: |
Thu, 13 Nov 2014 18:53:22 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 |
Here is a fixed version. I missed the -rpath /usr/local/lib in
the libtool_prog function:
diff --git a/configure b/configure
index 47048f0..b7bf30a 100755
--- a/configure
+++ b/configure
@@ -140,8 +140,10 @@ do_libtool() {
}
libtool_prog() {
- do_libtool --mode=compile $QEMU_CFLAGS -c -fPIE -DPIE -o $TMPO $TMPC ||
return $?
- do_libtool --mode=link $LDFLAGS -o $TMPA $TMPL -rpath /usr/local/lib
+ local_cflags="$1"
+ local_ldflags="$2"
+ do_libtool --mode=compile $QEMU_CFLAGS $local_cflags -c -fPIE -DPIE -o
$TMPO $TMPC || return $?
+ do_libtool --mode=link $LDFLAGS $local_ldflags -o $TMPA $TMPL
}
# symbolically link $1 to $2. Portable version of "ln -sf".
@@ -1501,13 +1503,16 @@ if test "$stack_protector" != "no"; then
for flag in $gcc_flags; do
# We need to check both a compile and a link, since some compiler
# setups fail only on a .c->.o compile and some only at link time
- if do_cc $QEMU_CFLAGS -Werror $flag -c -o $TMPO $TMPC &&
- compile_prog "-Werror $flag" ""; then
- QEMU_CFLAGS="$QEMU_CFLAGS $flag"
- LIBTOOLFLAGS="$LIBTOOLFLAGS -Wc,$flag"
- sp_on=1
- break
+ do_cc $QEMU_CFLAGS -Werror $flag -c -o $TMPO $TMPC || continue
+ compile_prog "-Werror $flag" "" || continue
+ if test -n "$libtool"; then
+ libtool_prog "-Werror $flag" "-Wc,$flag" || continue
fi
+
+ QEMU_CFLAGS="$QEMU_CFLAGS $flag"
+ LIBTOOLFLAGS="$LIBTOOLFLAGS -Wc,$flag"
+ sp_on=1
+ break
done
if test "$stack_protector" = yes; then
if test $sp_on = 0; then
@@ -1608,7 +1613,7 @@ g(unsigned char *buf, int len)
}
EOF
- if ! libtool_prog; then
+ if ! libtool_prog "" "-rpath /usr/local/lib"; then
echo "Disabling libtool due to broken toolchain support"
libtool=
fi