On 14.02.2019 19:44, Paolo Bonzini wrote: > On 02/02/19 15:45, Kamil Rytarowski wrote: >> >> Clang/LLVM on NetBSD with enabled optimization cannot link >> correct qemu program because of a missing symbol of >> kvm_arch_get_supported_cpuid() in kvm-stubs.o used by executables. > > Can you please include the full error message? Usually these things are > a sign of a bug elsewhere. > > Paolo >
Please do replace the current kludge that is sensitive to: - compiler behavior that can change with new versions - compiler gcc/clang - optimization options - linux(KVM) - non-linux (no-KVM) build - community not actively testing non-linux no-kvm build with optimization on clang My patch replaced it makes it work. Build error: LINK i386-bsd-user/qemu-i386 /usr/bin/ld: /usr/lib/libc.so and /usr/lib/crt0.o: warning: multiple common of `environ' /usr/bin/ld: target/i386/cpu.o: in function `x86_cpu_filter_features': /tmp/pkgsrc-tmp/emulators/qemu/work/qemu-3.1.0/target/i386/cpu.c:5047: undefined reference to `kvm_arch_get_supported_cpuid' /usr/bin/ld: /tmp/pkgsrc-tmp/emulators/qemu/work/qemu-3.1.0/target/i386/cpu.c:5048: undefined reference to `kvm_arch_get_supported_cpuid' /usr/bin/ld: /tmp/pkgsrc-tmp/emulators/qemu/work/qemu-3.1.0/target/i386/cpu.c:5049: undefined reference to `kvm_arch_get_supported_cpuid' /usr/bin/ld: /tmp/pkgsrc-tmp/emulators/qemu/work/qemu-3.1.0/target/i386/cpu.c:5050: undefined reference to `kvm_arch_get_supported_cpuid' /usr/bin/ld: /tmp/pkgsrc-tmp/emulators/qemu/work/qemu-3.1.0/target/i386/cpu.c:5051: undefined reference to `kvm_arch_get_supported_cpuid' clang-9: error: linker command failed with exit code 1 (use -v to see invocation) make[1]: *** [Makefile:199: qemu-i386] Error 1 gmake: *** [Makefile:483: subdir-i386-bsd-user] Error 2 gmake: *** Waiting for unfinished jobs.... LINK x86_64-bsd-user/qemu-x86_64 /usr/bin/ld: /usr/lib/libc.so and /usr/lib/crt0.o: warning: multiple common of `environ' /usr/bin/ld: target/i386/cpu.o: in function `x86_cpu_filter_features': /tmp/pkgsrc-tmp/emulators/qemu/work/qemu-3.1.0/target/i386/cpu.c:5047: undefined reference to `kvm_arch_get_supported_cpuid' /usr/bin/ld: /tmp/pkgsrc-tmp/emulators/qemu/work/qemu-3.1.0/target/i386/cpu.c:5048: undefined reference to `kvm_arch_get_supported_cpuid' /usr/bin/ld: /tmp/pkgsrc-tmp/emulators/qemu/work/qemu-3.1.0/target/i386/cpu.c:5049: undefined reference to `kvm_arch_get_supported_cpuid' /usr/bin/ld: /tmp/pkgsrc-tmp/emulators/qemu/work/qemu-3.1.0/target/i386/cpu.c:5050: undefined reference to `kvm_arch_get_supported_cpuid' /usr/bin/ld: /tmp/pkgsrc-tmp/emulators/qemu/work/qemu-3.1.0/target/i386/cpu.c:5051: undefined reference to `kvm_arch_get_supported_cpuid' clang-9: error: linker command failed with exit code 1 (use -v to see invocation) make[1]: *** [Makefile:199: qemu-x86_64] Error 1 gmake: *** [Makefile:483: subdir-x86_64-bsd-user] Error 2 *** Error code 2
signature.asc
Description: OpenPGP digital signature