device: 0.958 other: 0.954 mistranslation: 0.951 instruction: 0.949 vnc: 0.945 assembly: 0.942 network: 0.936 KVM: 0.933 semantic: 0.932 boot: 0.928 socket: 0.923 graphic: 0.918 Git version: Build process is broken in block_curl.c.o Gcc version: 10.2.0 Glusterfs: 8.1 Libguestfs: 1.42 Configure options used: configure \ --prefix=/usr \ --sysconfdir=/etc \ --localstatedir=/var \ --libexecdir=/usr/lib/qemu \ --extra-ldflags="$LDFLAGS" \ --smbd=/usr/bin/smbd \ --enable-modules \ --enable-sdl \ --disable-werror \ --enable-slirp=system \ --enable-xfsctl \ --audio-drv-list="pa alsa sdl" Error log attached. Here is the beginning: /usr/bin/ld: /usr/lib/gcc/x86_64-pc-linux-gnu/10.2.0/../../../../lib/Scrt1.o: in function `_start': (.text+0x24): undefined reference to `main' /usr/bin/ld: libblock-curl.a(block_curl.c.o): in function `curl_block_init': Please give more info on your host OS build environment, and most importantly confirm that you have tried doing a build from a *completely* clean git checkout. Recent build system changes introduced risk of problems if you have not done a full clean. "git clean -f -x -d" will delete every file in your git checkout that is not committed, ensuring you are starting from a pristine checkout. I'm using Archlinux. Trying right now a build from scratch and I will report asap. Keeping fingers crossed. Build process is still broken even with a blank new version of git source code. Once again, everything start while processing block_curl.so. Here is the beginning of the error log: Linking target block-curl.so /usr/bin/ld: /usr/lib/gcc/x86_64-pc-linux-gnu/10.2.0/../../../../lib/Scrt1.o: in function `_start': (.text+0x24): undefined reference to `main' /usr/bin/ld: libblock-curl.a(block_curl.c.o): in function `curl_block_init': Curl version: 7.72.0 if it matters. Attaching error log. Can you attach the full build log, including all the "configure" output, and ideally pass "V=1" as an arg to 'make' Full build log from start to crash. Nothing looks especially unusual there, but clear it is failing to link the block-curl.so as a library and is instead linking it as an executable and thus failing to find "main". I can't explain why that would be the case. From log: > The Meson build system > Version: 0.55.3 Perhaps a(nother) problem with meson? Try "meson=git" Added Paolo for his Meson expertize in case he can spot the flaw Tried meson-git, and it is still breaking on the same file. No luck here. Can you do the build using "make V=1" so that we actually see the compiler command lines used in the log file. Log with make V=1 as requested. cc -o block-curl.so -Wl,--as-needed -Wl,--allow-shlib-undefined -shared -fPIC -Wl,--start-group -Wl,-soname,block-curl.so -Wl,--whole-archive libblock-curl.a -Wl,--no-whole-archive -Wl,--warn-common -Wl,-z,relro -Wl,-z,now -m64 -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now -fstack-protector-strong -O2 -g -fPIE -DPIE -std=gnu99 -Wall -g -pie -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now libmodule-common.a -lcurl -Wl,--export-dynamic -pthread -lgmodule-2.0 -lglib-2.0 -lglib-2.0 -Wl,--end-group It could be because of -pie overriding -shared. You wrote that you have --extra-ldflags="$LDFLAGS" but what is $LDFLAGS? When I looked at /etc/makepkg.conf on my Archlinux, I found; LDFLAGS="-Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now" Please attach config-host.mak and config.log. Hopefully that is enough to blame one of you, :) configure, meson.build or Meson itself. The problem is caused by the extra flags you're forcing on the compiler: Using 'CFLAGS' from environment with value: '-O2 -g -fPIE -DPIE -std=gnu99 -Wall' Using 'LDFLAGS' from environment with value: '-g -pie -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now' Using 'CPPFLAGS' from environment with value: '-D_FORTIFY_SOURCE=2' Most particularly the "-pie" in LDFLAGS. This is only valid for executables, not shared libraries, and thus it breaks the build. I used these settings until Qemu 5.1.0 was released and it worked. These flags are used by archlinux for stable qemu release packaging. See https://github.com/archlinux/svntogit-packages/blob/packages/qemu/trunk/PKGBUILD Since qemu moved to meson, it breaks. I don't know why it used to work before. Thanks for your answer anyway. FYI, QEMU automatically enables PIC/PIE as needed, so there's no need to set it via these flags. In fact everything in your $CFLAGS is already set by QEMU out of the box too. For LDFLAGS you can cull the -g and -pie Before the meson port, the "-pie" arg was on the CLI *before* the "-shared" arg so the "-shared" wins and results in a shared library. After the meson port, "-shared" appears first, and so "-pie" wins and tries to create an executable. IOW, this passing of -pie was always wrong, and it was only by luck that it didn't break the build before. So, I'll try to tweak LDFLAGS and if it doesn't work, well... That's life. Thanks for the infos. Even with LDFLAGS tweaking, it breaks. Anyway, thanks for your help here. What's your new configure command line? Attach the config.log and make V=1 log again please. That said, I noticed that the flags were included twice in the linker command line so maybe you've only removed them in one place. Il ven 18 set 2020, 18:20 Frederic Bezies