1. 概要
この記事を書いているのは、2021年9月16日ですが、実は数週間前から発生しています。
「ports - FreeBSD ports tree」を参照すると、「memcached 1.6.10」は、2021年8月28日にリリースされていますので、そのときには、発生していることになります。
$ pkg version -vl "<"
memcached-1.6.9_1 < needs updating (index has 1.6.10)
ちゅうことで、アップグレードしようとしますと。
$ portupgrade -Rr memcached
[Reading data from pkg(8) ... - 386 packages found - done]
[Gathering depends for databases/memcached ....................................................................................... done]
[Exclude up-to-date packages .......................... done]
---> Upgrading 'memcached-1.6.9_1' to 'memcached-1.6.10' (databases/memcached)
---> Building '/usr/ports/databases/memcached'
===> Cleaning for libevent-2.1.12
===> Cleaning for memcached-1.6.10
===> License BSD3CLAUSE accepted by the user
・・・ 略 ・・・
checking for library containing pthread_create... no
configure: error: Can't enable threads without the POSIX thread library.
===> Script "configure" failed unexpectedly.
Please report the problem to swills@FreeBSD.org [maintainer] and attach the
"/usr/ports/databases/memcached/work/memcached-1.6.10/config.log" including
the output of the failure of your make command. Also, it might be a good idea
to provide an overview of all packages installed on your system (e.g. a
/usr/local/sbin/pkg-static info -g -Ea).
*** Error code 1
Stop.
make[1]: stopped in /usr/ports/databases/memcached
*** Error code 1
Stop.
make: stopped in /usr/ports/databases/memcached
** Command failed [exit code 1]: /usr/bin/script -qa /tmp/portupgrade20210916-67566-1aclgnv env UPGRADE_TOOL=portupgrade UPGRADE_PORT=memcached-1.6.9_1 UPGRADE_PORT_VER=1.6.9_1 make
** Fix the problem and try again.
** Listing the failed packages (-:ignored / *:skipped / !:failed)
! databases/memcached (memcached-1.6.9_1) (configure error)
てなことになります。
2. 調査
実は、うまくインストールできている、他のマシンがあります。
メッセージに
Please report the problem to swills@FreeBSD.org [maintainer] and attach the
"/usr/ports/databases/memcached/work/memcached-1.6.10/config.log" including
the output of the failure of your make command. Also, it might be a good idea
to provide an overview of all packages installed on your system (e.g. a
/usr/local/sbin/pkg-static info -g -Ea).
と書いてありますからな・・・。
/usr/ports/databases/memcached/work/memcached-1.6.10/config.log
を見比べてみます。
すると、細かい違いはさておき、うまくいっている方が
configure:6698: cc -o conftest -m64 -O2 -pipe -I/usr/local/include -fstack-protector-strong -fno-strict-aliasing -std=c99 -Wno-language-extension-token -I/usr/local/include -O2 -pipe -I/usr/local/include -fstack-protector-strong -fno-strict-aliasing -std=c99 -L/usr/local/lib -L/usr/local/lib -fstack-protector-strong -Wl,-rpath,/usr/local/lib conftest.c -lpthread -lssl -lcrypto -levent -lsasl2 >&5
configure:6698: $? = 0
configure:6715: result: -lpthread
configure:6729: checking for mlockall
configure:6729: cc -o conftest -m64 -O2 -pipe -I/usr/local/include -fstack-protector-strong -fno-strict-aliasing -std=c99 -Wno-language-extension-token -I/usr/local/include -O2 -pipe -I/usr/local/include -fstack-protector-strong -fno-strict-aliasing -std=c99 -L/usr/local/lib -L/usr/local/lib -fstack-protector-strong -Wl,-rpath,/usr/local/lib conftest.c -lpthread -lssl -lcrypto -levent -lsasl2 >&5
configure:6729: $? = 0
configure:6729: result: yes
configure:6740: checking for getpagesizes
configure:6740: cc -o conftest -m64 -O2 -pipe -I/usr/local/include -fstack-protector-strong -fno-strict-aliasing -std=c99 -Wno-language-extension-token -I/usr/local/include -O2 -pipe -I/usr/local/include -fstack-protector-strong -fno-strict-aliasing -std=c99 -L/usr/local/lib -L/usr/local/lib -fstack-protector-strong -Wl,-rpath,/usr/local/lib conftest.c -lpthread -lssl -lcrypto -levent -lsasl2 >&5
configure:6740: $? = 0
configure:6740: result: yes
configure:6751: checking for sysconf
configure:6751: result: yes
configure:6762: checking for memcntl
configure:6762: cc -o conftest -m64 -O2 -pipe -I/usr/local/include -fstack-protector-strong -fno-strict-aliasing -std=c99 -Wno-language-extension-token -I/usr/local/include -O2 -pipe -I/usr/local/include -fstack-protector-strong -fno-strict-aliasing -std=c99 -L/usr/local/lib -L/usr/local/lib -fstack-protector-strong -Wl,-rpath,/usr/local/lib conftest.c -lpthread -lssl -lcrypto -levent -lsasl2 >&5
ld: error: undefined symbol: memcntl
>>> referenced by conftest.c
>>> /tmp/conftest-b53eb9.o:(main)
cc: error: linker command failed with exit code 1 (use -v to see invocation)
configure:6762: $? = 1
となっている個所が、だめな方は
ld: error: /usr/local/lib/libevent.so: undefined reference to arc4random_addrandom
cc: error: linker command failed with exit code 1 (use -v to see invocation)
configure:6698: $? = 1
となっております。
どうも
/usr/local/lib/libevent.so
に問題があるのね・・・て。
だめな方をみると
$ ls /usr/local/lib/libevent*
/usr/local/lib/libevent_core-2.1.so.7 /usr/local/lib/libevent_openssl.a
/usr/local/lib/libevent_core-2.1.so.7.0.1 /usr/local/lib/libevent_openssl.so
/usr/local/lib/libevent_core.a /usr/local/lib/libevent_pthreads-2.1.so.7
/usr/local/lib/libevent_core.so /usr/local/lib/libevent_pthreads-2.1.so.7.0.1
/usr/local/lib/libevent_extra-2.1.so.7 /usr/local/lib/libevent_pthreads.a
/usr/local/lib/libevent_extra-2.1.so.7.0.1 /usr/local/lib/libevent_pthreads.so
/usr/local/lib/libevent_extra.a /usr/local/lib/libevent-2.1.so.7
/usr/local/lib/libevent_extra.so /usr/local/lib/libevent-2.1.so.7.0.1
/usr/local/lib/libevent_openssl-2.1.so.7 /usr/local/lib/libevent.a
/usr/local/lib/libevent_openssl-2.1.so.7.0.1 /usr/local/lib/libevent.so
一応、それらしいものがあるんだがな。
3. 解決
念のためだ。
cd /usr/ports/devel/libevent
make
make reinstall
したら
portupgrade -Rr memcached
通っちゃいました。
あれ、前ページに書いてある「unbound」も同じじゃねぇの?
でも
$ ls /usr/local/lib/libevent*
/usr/local/lib/libevent_core-2.1.so.7 /usr/local/lib/libevent_openssl.a
/usr/local/lib/libevent_core-2.1.so.7.0.1 /usr/local/lib/libevent_openssl.so
/usr/local/lib/libevent_core.a /usr/local/lib/libevent_pthreads-2.1.so.7
/usr/local/lib/libevent_core.so /usr/local/lib/libevent_pthreads-2.1.so.7.0.1
/usr/local/lib/libevent_extra-2.1.so.7 /usr/local/lib/libevent_pthreads.a
/usr/local/lib/libevent_extra-2.1.so.7.0.1 /usr/local/lib/libevent_pthreads.so
/usr/local/lib/libevent_extra.a /usr/local/lib/libevent-2.1.so.7
/usr/local/lib/libevent_extra.so /usr/local/lib/libevent-2.1.so.7.0.1
/usr/local/lib/libevent_openssl-2.1.so.7 /usr/local/lib/libevent.a
/usr/local/lib/libevent_openssl-2.1.so.7.0.1 /usr/local/lib/libevent.so
ぱっと見、変わらんのじゃがねぇ。