我正在尝试在较旧的嵌入式 Linux 系统上构建最新版本的 bind9。
我在构建命名时遇到此错误:
/bin/sh ../../libtool --tag=CC --mode=link arm-cortexa7hft-linux-gnueabi-gcc -Wall -Wextra -Wwrite-strings -Wpointer-arith -Wno-missing-field-initializers -Wformat -Wshadow -Werror=implicit-function-declaration -Werror=missing-prototypes -Werror=format-security -Werror=parentheses -Werror=implicit -Werror=strict-prototypes -fno-strict-aliasing -fno-delete-null-pointer-checks -fdiagnostics-show-option -O2 -fexpensive-optimizations -fomit-frame-pointer -frename-registers -pthread -Wl,-O1 -Wl,--hash-style=gnu -Wl,-rpath,/home/user/manifest/tmp/work/machine/arm-cortexa7hft-linux-gnueabi/bind-9.17.17/install/usr/lib -Wl,-rpath,/home/user/manifest/tmp/work/machine/arm-cortexa7hft-linux-gnueabi/bind-9.17.17/install/lib -o named builtin.o config.o control.o controlconf.o dlz_dlopen_driver.o fuzz.o log.o logconf.o main.o os.o server.o statschannel.o tkeyconf.o transportconf.o tsigconf.o zoneconf.o xsl.o ../../lib/isc/libisc.la ../../lib/dns/libdns.la ../../lib/ns/libns.la ../../lib/isccc/libisccc.la ../../lib/isccfg/libisccfg.la ../../lib/bind9/libbind9.la -lssl -lcrypto -luv -lxml2 -pthread
libtool: link: arm-cortexa7hft-linux-gnueabi-gcc -Wall -Wextra -Wwrite-strings -Wpointer-arith -Wno-missing-field-initializers -Wformat -Wshadow -Werror=implicit-function-declaration -Werror=missing-prototypes -Werror=format-security -Werror=parentheses -Werror=implicit -Werror=strict-prototypes -fno-strict-aliasing -fno-delete-null-pointer-checks -fdiagnostics-show-option -O2 -fexpensive-optimizations -fomit-frame-pointer -frename-registers -pthread -Wl,-O1 -Wl,--hash-style=gnu -Wl,-rpath -Wl,/home/user/manifest/tmp/work/machine/arm-cortexa7hft-linux-gnueabi/bind-9.17.17/install/usr/lib -Wl,-rpath -Wl,/home/user/manifest/tmp/work/machine/arm-cortexa7hft-linux-gnueabi/bind-9.17.17/install/lib -o .libs/named builtin.o config.o control.o controlconf.o dlz_dlopen_driver.o fuzz.o log.o logconf.o main.o os.o server.o statschannel.o tkeyconf.o transportconf.o tsigconf.o zoneconf.o xsl.o -pthread ../../lib/isc/.libs/libisc.so ../../lib/dns/.libs/libdns.so ../../lib/ns/.libs/libns.so ../../lib/isccc/.libs/libisccc.so ../../lib/isccfg/.libs/libisccfg.so ../../lib/bind9/.libs/libbind9.so -lssl -lcrypto /home/user/manifest/tmp/work/machine/arm-cortexa7hft-linux-gnueabi/bind-9.17.17/stage/machine/usr/lib/libuv.so /home/user/manifest/tmp/work/machine/arm-cortexa7hft-linux-gnueabi/bind-9.17.17/stage/machine/usr/lib/libxml2.so -pthread -Wl,-rpath -Wl,/home/user/manifest/tmp/work/machine/arm-cortexa7hft-linux-gnueabi/bind-9.17.17/stage/machine/usr/lib
/home/user/manifest/tmp/work/machine/arm-cortexa7hft-linux-gnueabi/bind-9.17.17/stage/cross/bin/../lib/gcc/arm-cortexa7hft-linux-gnueabi/6.3.0/../../../../arm-cortexa7hft-linux-gnueabi/bin/ld: .libs/named: hidden symbol `pthread_atfork' in /home/user/manifest/tmp/work/machine/arm-cortexa7hft-linux-gnueabi/bind-9.17.17/stage/cross/bin/../arm-cortexa7hft-linux-gnueabi/sysroot/usr/lib/libpthread_nonshared.a(pthread_atfork.oS) is referenced by DSO
我尝试使用 -pthread 而不是 -lpthread,结果仍然相同。
老最重要的事实是 glibc 是 2.24 对绑定版本 17.17 的 glibc 版本有一些版本要求吗?
构建链使用这些选项通过 cmake 配置 bind9
--enable-ipv6=no \
--with-randomdev=/dev/random \
--disable-threads \
--disable-devpoll --disable-epoll \
--disable-doh \
--disable-linux-caps \
--sysconfdir=${sysconfdir}/bind \
--with-openssl=${TARGET_SYSROOT}${target_prefix} \
--with-gssapi=no \
--enable-exportlib \
--with-export-includedir=${includedir} \
--with-export-libdir=${libdir} \
--with-eddsa=no \
--without-libnghttp2 \
--disable-silent-rules \
一件奇怪的事情是,当我添加了--disable-threads(删除--disable-threads 不会改变任何东西)时,根本就使用了pthreads
我的构建链将其标识为 arm-cortexa7hft-linux-gnueabi
我读了很多关于这种错误的文章,但似乎没有一个匹配。
编辑:
我找到了错误的原因。Bind 使用 libuv,而我使用的版本(最新的 1.42.0)正在调用 pthread_atfork,但由于它被隐藏,所以它失败了。取消注释 pthread_atfork 使其可以编译,但这并不明智。
我现在将尝试在 libuv 上提出一个问题。