QEMU fails to build on CentOS 5.10 with --disable-pie reporting "/usr/bin/ld: -f may not be used without -shared "
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
QEMU |
Invalid
|
Undecided
|
Unassigned |
Bug Description
fails for (7dc65c0 (HEAD, origin/master, origin/HEAD, master) Open 2.0 development tree):
...
libtool --mode=link --tag=CC cc -m64 -D_GNU_SOURCE -D_FILE_
cc -m64 -D_GNU_SOURCE -D_FILE_
/usr/bin/ld: -f may not be used without -shared
collect2: ld returned 1 exit status
make: *** [vscclient] Error 1
rm -rf out/tmp;mkdir out/tmp;pushd out/tmp;
~/qemu/out/tmp ~/qemu
Install prefix /usr/local
BIOS directory /usr/local/
binary directory /usr/local/bin
library directory /usr/local/lib
libexec directory /usr/local/libexec
include directory /usr/local/include
config directory /usr/local/etc
local state directory /usr/local/var
Manual directory /usr/local/
ELF interp prefix /usr/gnemul/qemu-%M
Source path /home/don/qemu
C compiler cc
Host C compiler cc
C++ compiler c++
Objective-C compiler cc
ARFLAGS rv
CFLAGS -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -g
QEMU_CFLAGS -m64 -D_GNU_SOURCE -D_FILE_
LDFLAGS -Wl,--warn-common -m64 -g
make make
install install
python python
smbd /usr/sbin/smbd
host CPU x86_64
host big endian no
target list alpha-softmmu arm-softmmu cris-softmmu i386-softmmu lm32-softmmu m68k-softmmu microblaze-softmmu microblazeel-
tcg debug enabled no
gprof enabled no
sparse enabled no
strip binaries yes
profiler no
static build no
-Werror enabled no
pixman system
SDL support yes
GTK support no
curses support yes
curl support yes
mingw32 support no
Audio drivers oss
Block whitelist (rw)
Block whitelist (ro)
VirtFS support yes
VNC support yes
VNC TLS support no
VNC SASL support yes
VNC JPEG support yes
VNC PNG support yes
VNC WS support no
xen support yes
brlapi support no
bluez support no
Documentation yes
GUEST_BASE yes
PIE no
vde support no
Linux AIO support no
ATTR/XATTR support yes
Install blobs yes
KVM support yes
RDMA support no
TCG interpreter no
fdt support yes
preadv support no
fdatasync yes
madvise yes
posix_madvise yes
sigev_thread_id yes
uuid support yes
libcap-ng support no
vhost-net support yes
vhost-scsi support yes
Trace backend nop
Trace output file trace-<pid>
spice support no (/)
rbd support no
xfsctl support no
nss used yes
libusb no
usb net redir no
GLX support yes
libiscsi support no
build guest agent yes
QGA VSS support no
seccomp support no
coroutine backend ucontext
coroutine pool yes
GlusterFS support no
virtio-
gcov gcov
gcov enabled no
TPM support no
libssh2 support no
TPM passthrough no
QOM debugging yes
vhdx yes
I bisect'd this to:
dcs-xen-
37746c5eacf309f
commit 37746c5eacf309f
Author: Marc-André Lureau <email address hidden>
Date: Mon Feb 25 23:31:12 2013 +0100
build-sys: must link with -fstack-protector
It is needed to give that flag to the linker as well, but latest
libtool 2.4.2 still swallows that argument, so let's pass it with
libtool -Wc argument.
qemu-
Signed-off-by: Marc-André Lureau <email address hidden>
Reviewed-by: Alon Levy <email address hidden>
:100755 100755 33d3354ea308386
:100644 100644 edc2552f0886c99
Using the hack:
git diff
diff --git a/configure b/configure
index 0666228..cf8123b 100755
--- a/configure
+++ b/configure
@@ -1292,7 +1292,9 @@ done
if compile_prog "-Werror -fstack- protector- all" "" ; then CFLAGS= "$QEMU_ CFLAGS -fstack- protector- all" "$LIBTOOLFLAGS -Wc,-fstack- protector- all" "$LIBTOOLFLAGS -Wc,-fstack- protector- all"
QEMU_
- LIBTOOLFLAGS=
+ if test "$pie" != "no" ; then
+ LIBTOOLFLAGS=
+ fi
fi
# Workaround for http:// gcc.gnu. org/PR55489. Happens with -fPIE/-fPIC and
I now get:
/home/don/ qemu/libcacard/ vscclient. c: In function 'do_socket_read': qemu/libcacard/ vscclient. c:410: warning: implicit declaration of function 'g_warn_if_reached' qemu/libcacard/ vscclient. c:410: warning: nested extern declaration of 'g_warn_if_reached' qemu/libcacard/ vscclient. c: In function 'main': qemu/libcacard/ vscclient. c:763: warning: implicit declaration of function 'g_byte_ array_unref' qemu/libcacard/ vscclient. c:763: warning: nested extern declaration of 'g_byte_ array_unref' vscclient. o: In function `do_socket_read': qemu/libcacard/ vscclient. c:410: undefined reference to `g_warn_if_reached' vscclient. o: In function `main': qemu/libcacard/ vscclient. c:763: undefined reference to `g_byte_ array_unref'
/home/don/
/home/don/
/home/don/
/home/don/
/home/don/
...
libcacard/
/home/don/
libcacard/
/home/don/
collect2: ld returned 1 exit status
make: *** [vscclient] Error 1