NetBSD上的Clang和-std = libc ++?

时间:2017-01-12 18:31:16

标签: clang libc++ netbsd

我正在尝试在NetBSD上编译clang++libc++的程序。 Clang版本为3.9.0,NetBSD版本为7.0.2。编译失败了:

$ make
clang++  -D_NETBSD_SOURCE -m64 -pthread -stdlib=libc++ -fPIC -fvisibility=hidden \
  -std=c++11 -D_REENTRANT -O3 -Wall -Ibuild/include -c ./src/lib/asn1/alg_id.cpp \
  -o build/obj/lib/asn1_alg_id.o
In file included from ./src/lib/asn1/alg_id.cpp:8:
In file included from build/include/botan/alg_id.h:11:
In file included from build/include/botan/asn1_obj.h:11:
In file included from build/include/botan/secmem.h:11:
In file included from build/include/botan/mem_ops.h:11:
build/include/botan/types.h:14:10: fatal error: 'cstddef' file not found
#include <cstddef>
         ^
1 error generated.
*** Error code 1

<cstddef>存在,但它似乎是GCC的:

$ find /usr -name cstddef
/usr/include/g++/cstddef

如果我正确解析Index of pub/NetBSD/NetBSD-release-7/src/external/bsd/libc++,则该库可用。当我尝试安装libc++libcxx时:

bash-4.4$ sudo PKG_PATH="http://ftp.NetBSD.org/pub/pkgsrc/packages/NetBSD/`uname -m`/`uname -r`/All/" pkg_add libcxx
pkg_add: no pkg found for 'libcxx', sorry.
pkg_add: 1 package addition failed
bash-4.4$ sudo PKG_PATH="http://ftp.NetBSD.org/pub/pkgsrc/packages/NetBSD/`uname -m`/`uname -r`/All/" pkg_add libc++
pkg_add: no pkg found for 'libc++', sorry.
pkg_add: 1 package addition failed

在NetBSD上使用libc ++是否支持配置?我们如何在NetBSD上使用Clang和libc ++?

1 个答案:

答案 0 :(得分:1)

NetBSD支持Libc ++(虽然它没有定期测试)。不幸的是,我不确定它提供了什么包(如果有的话)。

另一种选择是build and install libc++ from source。 Clang将首先搜索自己的libc ++标头前缀,然后/usr/local/include/c++/v1秒,因此您要在这两个位置之一安装libc ++(例如-DCMAKE_INSTALL_PREFIX=/usr/local)。