clearlinux / distribution

Placeholder repository to allow filing of general bugs/issues/etc against the Clear Linux OS for Intel Architecture linux distribution
522 stars 29 forks source link

QEMU 3.1 fails to compile (crc32/zlib) #346

Closed Andy2244 closed 5 years ago

Andy2244 commented 5 years ago

Describe the bug QEMU 3.1 wont compile under clearlinux.

To Reproduce Steps to reproduce the behavior:

wget https://download.qemu.org/qemu-3.1.0.tar.xz
tar xvJf qemu-3.1.0.tar.xz
cd qemu-3.1.0
./configure
make

I use those configure options:

./configure \
    --audio-drv-list=''     \
    --disable-slirp         \
    --disable-debug-info    \
    --disable-modules       \
    --disable-sdl           \
    --disable-qom-cast-debug    \
    --disable-virtfs        \
    --disable-vnc           \
    --disable-debug-tcg     \
    --disable-sparse        \
    --disable-strip         \
    --disable-vnc-sasl      \
    --disable-vnc-jpeg      \
    --disable-vnc-png       \
    --disable-vde           \
    --disable-netmap        \
    --disable-xen           \
    --disable-xen-pci-passthrough   \
    --disable-xen-pv-domain-build   \
    --disable-brlapi        \
    --disable-bluez         \
    --disable-tcg-interpreter   \
    --disable-cap-ng        \
    --disable-spice         \
    --disable-libiscsi      \
    --disable-libnfs        \
    --disable-cocoa         \
    --disable-werror        \
    --disable-stack-protector   \
    --disable-curl          \
    --disable-crypto-afalg  \
    --disable-docs          \
    --disable-vhost-net     \
    --disable-vhost-scsi    \
    --disable-vhost-vsock   \
    --disable-opengl        \
    --disable-rbd           \
    --disable-xfsctl        \
    --disable-smartcard     \
    --disable-libusb        \
    --disable-usb-redir     \
    --disable-zlib-test     \
    --disable-lzo           \
    --disable-snappy        \
    --disable-bzip2         \
    --disable-guest-agent-msi   \
    --without-vss-sdk       \
    --without-win-sdk       \
    --disable-tools         \
    --disable-glusterfs     \
    --disable-gtk           \
    --disable-gnutls        \
    --disable-nettle        \
    --disable-gcrypt        \
    --disable-rdma          \
    --disable-vte           \
    --disable-virglrenderer \
    --disable-tpm           \
    --disable-libssh2       \
    --disable-strip         \
    --disable-replication   \
    --disable-vxhs          \
    --disable-system        \
    --disable-guest-agent   \
    --disable-pie           \
    --disable-live-block-migration \
    --disable-numa          \
    --disable-libxml2       \
    --disable-capstone      \
    --disable-debug-mutex   \
    --disable-git-update    \
    --disable-hax           \
    --disable-kvm           \
    --disable-hvf           \
    --disable-whpx          \
    --disable-blobs

Expected behavior The error i get is:

/usr/bin/ld: target/arm/helper.o: in function `helper_crc32':
/root/qemu-3.1.0/target/arm/helper.c:12718: undefined reference to `crc32'
collect2: error: ld returned 1 exit status

This might be zlib related, from what i have seen in the helper.h file.

Environment (please complete the following information):

NAME="Clear Linux OS"
VERSION=1
ID=clear-linux-os
ID_LIKE=clear-linux-os
VERSION_ID=27050
acpica-unix2
bc
bootloader
c-basic
cloc
containers-basic
cpio
curl
dev-utils
diffutils
docutils
editors
emacs
ethtool
file
findutils
gdb
git
gzip
htop
icdiff
inotify-tools
iproute2
irssi
joe
kbd
kernel-hyperv
kernel-install
less
linux-tools
llvm
make
nasm
network-basic
openssh-server
openssl
os-core
os-core-dev
os-core-update
p11-kit
parallel
patch
perl-basic
powertop
python3-basic
shells
strace
subversion
sudo
sysadmin-basic
tmux
tzdata
unzip
valgrind
vim
weechat
which
wpa_supplicant
xz
znc
zsh
zstd
AthenasJimenez commented 5 years ago

If you don't mind to wait, qemu 3.1 would be available in next release.

Andy2244 commented 5 years ago

I use clearlinux as build system to cross compile, so i need to-be able to compile qemu on clearlinux. So i'm looking for the specific compile fix, probably zlib related. It seems qemu 3.1 compiles fine under ubuntu.

ahkok commented 5 years ago

Can you post the whole compile log, and not just the (last) failure?

Andy2244 commented 5 years ago

Everything beforehand compiles fine without errors/warnings:

...
 GEN     aarch64_be-linux-user/gdbstub-xml.c
  CC      aarch64_be-linux-user/gdbstub-xml.o
  CC      aarch64_be-linux-user/gdbstub.o
  CC      aarch64_be-linux-user/thunk.o
  CC      aarch64_be-linux-user/accel/stubs/hax-stub.o
  CC      aarch64_be-linux-user/accel/stubs/hvf-stub.o
  CC      aarch64_be-linux-user/accel/stubs/whpx-stub.o
  CC      aarch64_be-linux-user/accel/stubs/kvm-stub.o
  CC      aarch64_be-linux-user/accel/tcg/tcg-runtime.o
  CC      aarch64_be-linux-user/accel/tcg/tcg-runtime-gvec.o
  CC      aarch64_be-linux-user/accel/tcg/cpu-exec.o
  CC      aarch64_be-linux-user/accel/tcg/cpu-exec-common.o
  CC      aarch64_be-linux-user/accel/tcg/translate-all.o
  CC      aarch64_be-linux-user/accel/tcg/translator.o
  CC      aarch64_be-linux-user/accel/tcg/user-exec.o
  CC      aarch64_be-linux-user/accel/tcg/user-exec-stub.o
  CC      aarch64_be-linux-user/linux-user/main.o
  CC      aarch64_be-linux-user/linux-user/syscall.o
  CC      aarch64_be-linux-user/linux-user/strace.o
  CC      aarch64_be-linux-user/linux-user/mmap.o
  CC      aarch64_be-linux-user/linux-user/signal.o
  CC      aarch64_be-linux-user/linux-user/elfload.o
  CC      aarch64_be-linux-user/linux-user/linuxload.o
  CC      aarch64_be-linux-user/linux-user/uaccess.o
  CC      aarch64_be-linux-user/linux-user/uname.o
  CCAS    aarch64_be-linux-user/linux-user/safe-syscall.o
  CC      aarch64_be-linux-user/linux-user/aarch64/signal.o
  CC      aarch64_be-linux-user/linux-user/aarch64/cpu_loop.o
  CC      aarch64_be-linux-user/linux-user/exit.o
  CC      aarch64_be-linux-user/linux-user/fd-trans.o
  CC      aarch64_be-linux-user/linux-user/flatload.o
  CC      aarch64_be-linux-user/target/arm/arm-semi.o
  CC      aarch64_be-linux-user/target/arm/kvm-stub.o
  CC      aarch64_be-linux-user/target/arm/translate.o
  CC      aarch64_be-linux-user/target/arm/op_helper.o
  CC      aarch64_be-linux-user/target/arm/helper.o
  CC      aarch64_be-linux-user/target/arm/cpu.o
  CC      aarch64_be-linux-user/target/arm/neon_helper.o
  CC      aarch64_be-linux-user/target/arm/iwmmxt_helper.o
  CC      aarch64_be-linux-user/target/arm/vec_helper.o
  CC      aarch64_be-linux-user/target/arm/gdbstub.o
  CC      aarch64_be-linux-user/target/arm/cpu64.o
  CC      aarch64_be-linux-user/target/arm/translate-a64.o
  CC      aarch64_be-linux-user/target/arm/helper-a64.o
  CC      aarch64_be-linux-user/target/arm/gdbstub64.o
  CC      aarch64_be-linux-user/target/arm/crypto_helper.o
  CC      aarch64_be-linux-user/target/arm/translate-sve.o
  CC      aarch64_be-linux-user/target/arm/sve_helper.o
  CC      aarch64_be-linux-user/trace/generated-helpers.o
  CC      aarch64_be-linux-user/trace/control-target.o
  LINK    aarch64_be-linux-user/qemu-aarch64_be
/usr/bin/ld: target/arm/helper.o: in function `helper_crc32':
/root/qemu-3.1.0/target/arm/helper.c:12718: undefined reference to `crc32'
/usr/bin/ld: target/arm/helper-a64.o: in function `helper_crc32_64':
/root/qemu-3.1.0/target/arm/helper-a64.c:500: undefined reference to `crc32'
collect2: error: ld returned 1 exit status
make[1]: *** [Makefile:199: qemu-aarch64_be] Error 1
make: *** [Makefile:483: subdir-aarch64_be-linux-user] Error 2
ahkok commented 5 years ago

Can't reproduce without configure flags, it just compiles fine for me.

Andy2244 commented 5 years ago

Can't reproduce without configure flags, it just compiles fine for me.

yeah thats why i posted the configure flags, i only need the qemu userspace bins and not the full system ones, so i disable anything else. Just tested 3.0 and it compiles fine with the same flags, so something changed for qemu and clearlinux.

You know from which lib the crc32 function should come from?

ahkok commented 5 years ago

all those flags are what cause the compile error. You'll have to figure out which thing you disable causes the crc32 function not to be compiled. It appears this may be an upstream bug, even. Although given the sheer amount of --disable flags you're passing, it's kinda logical. I mean, you even disable KVM support :)

Andy2244 commented 5 years ago

Although given the sheer amount of --disable flags you're passing, it's kinda logical. I mean, you even disable KVM support :)

Don't blame me, blame the samba.org team :) This config is the minimal setup to cross compile samba4 via WAF/QEMU, without having a long list of extra compile dependency's, just for qemu.

PS: Guess i have to check all of them one by one.... thanks for the quick check on your side.

ahkok commented 5 years ago

well, there's a zlib-test one that pops out, as well as other compression related ones, I'd try them first. :)

Andy2244 commented 5 years ago

@ahkok Sorry for the late reply, did forget about this. Your guess was spot on, allowing zlib-test fixed it.

thanks