【发布时间】:2021-05-24 06:09:09
【问题描述】:
我在 qemu-5.1.0 中添加了一个代码,这个代码应该使用一个 .so 文件。
我使用 configure --extra-cflags/--extra-cxxflags/--extra-ldflags 选项将 -ldl 添加到 QEMU_CFLAGS、QEMU_CXXFLAGS、QEMU_LDFLAGS 中,并且可以看到它们确实已设置。
但是当我真正做“make”时,它给了我这个错误,我不知道出了什么问题。
LINK aarch64-softmmu/qemu-system-aarch64
/usr/bin/ld: ../hw/misc/axpu_if.o: undefined reference to symbol 'dlsym@@GLIBC_2.2.5'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libdl.so: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make[1]: *** [Makefile:219: qemu-system-aarch64] Error 1
make: *** [Makefile:527: aarch64-softmmu/all] Error 2
这是“ldd --version”命令输出。我系统的glibc版本好像是2.31(ubuntu 20.04),但是不知道为什么要从glibc_2.2.5找符号dlsym。
ckim@ckim-ubuntu:~/xxx/qemu-5.1.0/build$ ldd --version
ldd (Ubuntu GLIBC 2.31-0ubuntu9.2) 2.31
Copyright (C) 2020 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Written by Roland McGrath and Ulrich Drepper.
谁能帮帮我?
【问题讨论】:
-
库
-ldl应该被传递给链接器。