FreeBSD で nix をビルドしようとしています。コンパイルできるようにいくつか変更しました。パッチを適用したソースは次のとおりです: https://github.com/ysangkok/nix
./bootstrap.sh
と を使用して構成しますbash configure CXX=clang++ CC=clang
。
nix 実行可能ファイル自体は問題なくリンクしていますが、リンクできませんnix-channel
:
[janus@xn--kn-1ia ~/nix] gmake V=1
local.mk:13: warning: overriding recipe for target '/usr/local/include/nix/shared.hh'
local.mk:13: warning: ignoring old recipe for target '/usr/local/include/nix/shared.hh'
local.mk:13: warning: overriding recipe for target '/usr/local/include/nix/common-args.hh'
local.mk:13: warning: ignoring old recipe for target '/usr/local/include/nix/common-args.hh'
clang++ -o src/nix-channel/nix-channel src/nix-channel/nix-channel.o src/libmain/libnixmain.a -L/usr/local/lib -lcrypto src/libutil/libnixutil.a -llzma -lbz2 -pthread -L/usr/local/lib -lcrypto src/boost/format/libnixformat.a src/libstore/libnixstore.a -L/usr/local/lib -lsqlite3 -lbz2 -L/usr/local/lib -lcurl -pthread
/usr/bin/ld: warning: libcrypto.so.7, needed by /usr/local/lib/libcurl.so, may conflict with libcrypto.so.8
/usr/bin/ld: warning: libcrypto.so.7, needed by /usr/local/lib/libcurl.so, may conflict with libcrypto.so.8
src/libstore/libnixstore.a(misc.o): In function `nix::Store::computeFSClosure(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::set<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::less<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > >&, bool, bool, bool)':
/home/janus/nix/src/libstore/misc.cc:14: undefined reference to `nix::ThreadPool::ThreadPool(unsigned long)'
/home/janus/nix/src/libstore/misc.cc:68: undefined reference to `nix::ThreadPool::enqueue(std::__1::function<void ()()> const&)'
/home/janus/nix/src/libstore/misc.cc:70: undefined reference to `nix::ThreadPool::process()'
/home/janus/nix/src/libstore/misc.cc:71: undefined reference to `nix::ThreadPool::~ThreadPool()'
/home/janus/nix/src/libstore/misc.cc:71: undefined reference to `nix::ThreadPool::~ThreadPool()'
src/libstore/libnixstore.a(misc.o): In function `nix::Store::queryMissing(std::__1::set<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::less<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&, std::__1::set<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::less<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > >&, std::__1::set<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::less<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > >&, std::__1::set<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::less<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > >&, unsigned long long&, unsigned long long&)':
/home/janus/nix/src/libstore/misc.cc:80: undefined reference to `nix::ThreadPool::ThreadPool(unsigned long)'
/home/janus/nix/src/libstore/misc.cc:201: undefined reference to `nix::ThreadPool::enqueue(std::__1::function<void ()()> const&)'
/home/janus/nix/src/libstore/misc.cc:203: undefined reference to `nix::ThreadPool::process()'
/home/janus/nix/src/libstore/misc.cc:204: undefined reference to `nix::ThreadPool::~ThreadPool()'
/home/janus/nix/src/libstore/misc.cc:204: undefined reference to `nix::ThreadPool::~ThreadPool()'
src/libstore/libnixstore.a(misc.o): In function `operator()':
/home/janus/nix/src/libstore/misc.cc:168: undefined reference to `nix::ThreadPool::enqueue(std::__1::function<void ()()> const&)'
/home/janus/nix/src/libstore/misc.cc:196: undefined reference to `nix::ThreadPool::enqueue(std::__1::function<void ()()> const&)'
src/libstore/libnixstore.a(misc.o): In function `nix::Store::queryMissing(std::__1::set<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::less<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&, std::__1::set<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::less<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > >&, std::__1::set<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::less<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > >&, std::__1::set<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::less<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > >&, unsigned long long&, unsigned long long&)::$_4::operator()(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, nix::Derivation const&) const':
/home/janus/nix/src/libstore/misc.cc:109: undefined reference to `nix::ThreadPool::enqueue(std::__1::function<void ()()> const&)'
src/libstore/libnixstore.a(misc.o): In function `ref':
/home/janus/nix/src/libstore/misc.cc:132: undefined reference to `nix::ThreadPool::enqueue(std::__1::function<void ()()> const&)'
src/libstore/libnixstore.a(misc.o): In function `operator()':
/home/janus/nix/src/libstore/misc.cc:35: undefined reference to `nix::ThreadPool::enqueue(std::__1::function<void ()()> const&)'
src/libstore/libnixstore.a(misc.o):/home/janus/nix/src/libstore/misc.cc:40: more undefined references to `nix::ThreadPool::enqueue(std::__1::function<void ()()> const&)' follow
src/libstore/libnixstore.a(build.o): In function `nix::DerivationGoal::openLogFile()':
/home/janus/nix/src/libstore/build.cc:2948: undefined reference to `nix::makeCompressionSink(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, nix::Sink&)'
src/libstore/libnixstore.a(builtins.o): In function `nix::builtinFetchurl(nix::BasicDerivation const&)':
/home/janus/nix/src/libstore/builtins.cc:48: undefined reference to `nix::decompress(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)'
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
gmake: *** [mk/lib.mk:105: src/nix-channel/nix-channel] Error 1
[janus@xn--kn-1ia ~/nix]
ThreadPool は で定義されていsrc/libutil/thread-pool.cc
ます。libutil
上記のコマンドでもリンクされています。参照が定義されていないのはなぜですか?
パッチを適用したソースを Linux でビルドしても、まだ問題が発生します。