1

我正在尝试在 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 上构建补丁源,我仍然会遇到问题。

4

0 回答 0