Skip to contentSkip to conversation

Latest QEMU does not support --enable-check-utests on Debian with --enable-pie (default)

Qemu-devel Stefan Weil 2 participants 3 messages Nov 23, 2011 – Nov 24, 2011

lore
Share & tools
lore
#0 lore raw

This is my configuration and the output from configure:

configure '--audio-card-list=ac97,es1370,sb16,cs4231a,adlib,gus,hda' '--audio-drv-list=alsa,sdl,oss,esd,pa' '--enable-mixemu' '--enable-check-utests' '--enable-vnc-thread' ERROR
ERROR: User requested feature check
ERROR: configure was not able to find it
ERROR

This is what configure does internally:

gcc -fPIE -DPIE -m64 -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Wstrict-prototypes -Wredundant-decls -Wmissing-format-attribute -Wall -Wundef -Wwrite-strings -Wmissing-prototypes -fno-strict-aliasing -fstack-protector-all -Wendif-labels -Wmissing-include-dirs -Wempty-body -Wnested-externs -Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers -Wold-style-declaration -Wold-style-definition -Wtype-limits -I/usr/include/libpng12 -o /tmp/qemu-conf--4272-.exe /tmp/qemu-conf--4272-.c -Wl,-z,relro -Wl,-z,now -pie -m64 -g -lcheck /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/4.4.5/../../../../lib/libcheck.a(check.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/usr/lib/gcc/x86_64-linux-gnu/4.4.5/../../../../lib/libcheck.a: could not read symbols: Bad value

When I add --disable-pie, configure works.

Regards,
Stefan Weil

#1 lore raw
Quoted 9 lines · Stefan Weil

This is my configuration and the output from configure:

configure '--audio-card-list=ac97,es1370,sb16,cs4231a,adlib,gus,hda' --audio-drv-list=alsa,sdl,oss,esd,pa' '--enable-mixemu' --enable-check-utests' '--enable-vnc-thread'
ERROR
ERROR: User requested feature check
ERROR: configure was not able to find it
ERROR

Works for me, see appended log.

Quoted 19 lines

This is what configure does internally:

gcc -fPIE -DPIE -m64 -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE

(quoted diff) +0 -7
-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Wstrict-prototypes
-Wredundant-decls -Wmissing-format-attribute -Wall -Wundef
-Wwrite-strings -Wmissing-prototypes -fno-strict-aliasing
-fstack-protector-all -Wendif-labels -Wmissing-include-dirs
-Wempty-body -Wnested-externs -Wformat-security -Wformat-y2k
-Winit-self -Wignored-qualifiers -Wold-style-declaration
-Wold-style-definition -Wtype-limits -I/usr/include/libpng12 -o

/tmp/qemu-conf--4272-.exe /tmp/qemu-conf--4272-.c -Wl,-z,relro -Wl,-z,now -pie -m64 -g -lcheck
/usr/bin/ld:
/usr/lib/gcc/x86_64-linux-gnu/4.4.5/../../../../lib/libcheck.a(check.o):
relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC /usr/lib/gcc/x86_64-linux-gnu/4.4.5/../../../../lib/libcheck.a: could not read symbols: Bad value

Quoted 1 line

When I add --disable-pie, configure works.

You can't link non-PIC code like libcheck.a into a PIE. Do you have libcheck.so?

$ ../configure '--audio-card-list=ac97,es1370,sb16,cs4231a,adlib,gus,hda' --audio-drv-list=alsa,sdl,oss,pa '--enable-mixemu' --enable-check-utests '--enable-vnc-thread'
Install prefix    /usr/local
BIOS directory    /usr/local/share/qemu
binary directory  /usr/local/bin
library directory /usr/local/lib
include directory /usr/local/include
config directory  /usr/local/etc
Manual directory  /usr/local/share/man
ELF interp prefix /usr/gnemul/qemu-%M
Source path       /home/armbru/work/qemu
C compiler        gcc
Host C compiler   gcc
CFLAGS            -O2 -g 
QEMU_CFLAGS       -fPIE -DPIE -m64 -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Wstrict-prototypes -Wredundant-decls -Wall -Wundef -Wwrite-strings -Wmissing-prototypes -fno-strict-aliasing  -fstack-protector-all -Wendif-labels -Wmissing-include-dirs -Wempty-body -Wnested-externs -Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers -Wold-style-declaration -Wold-style-definition -Wtype-limits -I/usr/include/libpng12   -I/usr/include/spice-server -I/usr/include/pixman-1 -I/usr/include/spice-1  
LDFLAGS           -Wl,--warn-common -Wl,-z,relro -Wl,-z,now -pie -m64 -g 
make              make
install           install
python            python
smbd              /usr/sbin/smbd
host CPU          x86_64
host big endian   no
target list       i386-softmmu x86_64-softmmu alpha-softmmu arm-softmmu cris-softmmu lm32-softmmu m68k-softmmu microblaze-softmmu microblazeel-softmmu mips-softmmu mipsel-softmmu mips64-softmmu mips64el-softmmu ppc-softmmu ppcemb-softmmu ppc64-softmmu sh4-softmmu sh4eb-softmmu sparc-softmmu sparc64-softmmu s390x-softmmu xtensa-softmmu xtensaeb-softmmu i386-linux-user x86_64-linux-user alpha-linux-user arm-linux-user armeb-linux-user cris-linux-user m68k-linux-user microblaze-linux-user microblazeel-linux-user mips-linux-user mipsel-linux-user ppc-linux-user ppc64-linux-user ppc64abi32-linux-user sh4-linux-user sh4eb-linux-user sparc-linux-user sparc64-linux-user sparc32plus-linux-user unicore32-linux-user s390x-linux-user 
tcg debug enabled no
Mon debug enabled no
gprof enabled     no
sparse enabled    no
strip binaries    yes
profiler          no
static build      no
-Werror enabled   no
SDL support       yes
curses support    yes
curl support      yes
check support     yes
mingw32 support   no
Audio drivers     alsa sdl oss pa
Extra audio cards ac97 es1370 sb16 cs4231a adlib gus hda
Block whitelist   
Mixer emulation   yes
VNC support       yes
VNC TLS support   yes
VNC SASL support  yes
VNC JPEG support  yes
VNC PNG support   yes
VNC thread        yes
xen support       yes
brlapi support    no
bluez  support    no
Documentation     yes
NPTL support      yes
GUEST_BASE        yes
PIE               yes
vde support       no
Linux AIO support yes
ATTR/XATTR support yes
Install blobs     yes
KVM support       yes
TCG interpreter   no
fdt support       no
preadv support    yes
fdatasync         yes
madvise           yes
posix_madvise     yes
uuid support      yes
vhost-net support yes
Trace backend     nop
Trace output file trace-<pid>
spice support     yes
rbd support       no
xfsctl support    no
nss used          no
usb net redir     no
OpenGL support    yes
libiscsi support  no
build guest agent yes
$ grep lcheck config.log 
gcc -fPIE -DPIE -m64 -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Wstrict-prototypes -Wredundant-decls -Wall -Wundef -Wwrite-strings -Wmissing-prototypes -fno-strict-aliasing -fstack-protector-all -Wendif-labels -Wmissing-include-dirs -Wempty-body -Wnested-externs -Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers -Wold-style-declaration -Wold-style-definition -Wtype-limits -I/usr/include/libpng12 -o /tmp/qemu-conf-29100-10373-30351.exe /tmp/qemu-conf-2019-10373-32038.c -Wl,-z,relro -Wl,-z,now -pie -m64 -g -lcheck

Note I dropped esd (too lazy to install right now), fixed up your quoting, and run in a sub-directory.

#2 lore raw

Am 24.11.2011 09:00, schrieb Markus Armbruster:

Quoted 35 lines
Quoted 10 lines · Stefan Weil

This is my configuration and the output from configure:

configure '--audio-card-list=ac97,es1370,sb16,cs4231a,adlib,gus,hda' --audio-drv-list=alsa,sdl,oss,esd,pa' '--enable-mixemu' --enable-check-utests' '--enable-vnc-thread'
ERROR
ERROR: User requested feature check
ERROR: configure was not able to find it
ERROR

Works for me, see appended log.

Quoted 19 lines

This is what configure does internally:

gcc -fPIE -DPIE -m64 -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE

(quoted diff) +0 -7
-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Wstrict-prototypes
-Wredundant-decls -Wmissing-format-attribute -Wall -Wundef
-Wwrite-strings -Wmissing-prototypes -fno-strict-aliasing
-fstack-protector-all -Wendif-labels -Wmissing-include-dirs
-Wempty-body -Wnested-externs -Wformat-security -Wformat-y2k
-Winit-self -Wignored-qualifiers -Wold-style-declaration
-Wold-style-definition -Wtype-limits -I/usr/include/libpng12 -o

/tmp/qemu-conf--4272-.exe /tmp/qemu-conf--4272-.c -Wl,-z,relro -Wl,-z,now -pie -m64 -g -lcheck
/usr/bin/ld:
/usr/lib/gcc/x86_64-linux-gnu/4.4.5/../../../../lib/libcheck.a(check.o):
relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC /usr/lib/gcc/x86_64-linux-gnu/4.4.5/../../../../lib/libcheck.a: could not read symbols: Bad value

Quoted 5 lines
Quoted 2 lines

When I add --disable-pie, configure works.

You can't link non-PIC code like libcheck.a into a PIE. Do you have libcheck.so?

Debian squeeze has libcheck.a and libcheck_pic.a, but no libcheck.so in package 'check'.

There are other files names *_pic.a, and obviously those libraries are to be linked to a PIE. If I use -lcheck_pic, building PIEs works.

Maybe configure must be extended to try library names with an additional _pic for PIE.

Regards,
Stefan Weil