summaryrefslogtreecommitdiff
path: root/lang
diff options
context:
space:
mode:
authorryoon <ryoon@pkgsrc.org>2021-12-19 14:12:20 +0000
committerryoon <ryoon@pkgsrc.org>2021-12-19 14:12:20 +0000
commit415d6dbe78a2ddca05e5dc2fc1b2555cd5e83629 (patch)
tree0f488dd9d0c1d483a5680a7fa59c8bdd416669e2 /lang
parent82c61b75f5380fb574d124993011d1d2aef454a7 (diff)
downloadpkgsrc-415d6dbe78a2ddca05e5dc2fc1b2555cd5e83629.tar.gz
lang/wasi-libcxx: import wasi-libcxx-13.0.0
libc++abi and libc++ for WebAssembly WASI environment.
Diffstat (limited to 'lang')
-rw-r--r--lang/wasi-libcxx/DESCR1
-rw-r--r--lang/wasi-libcxx/Makefile175
-rw-r--r--lang/wasi-libcxx/PLIST392
-rw-r--r--lang/wasi-libcxx/buildlink3.mk15
-rw-r--r--lang/wasi-libcxx/distinfo11
5 files changed, 594 insertions, 0 deletions
diff --git a/lang/wasi-libcxx/DESCR b/lang/wasi-libcxx/DESCR
new file mode 100644
index 00000000000..f0bc2ed2aef
--- /dev/null
+++ b/lang/wasi-libcxx/DESCR
@@ -0,0 +1 @@
+libc++abi and libc++ for WebAssembly WASI environment.
diff --git a/lang/wasi-libcxx/Makefile b/lang/wasi-libcxx/Makefile
new file mode 100644
index 00000000000..05e0882ec39
--- /dev/null
+++ b/lang/wasi-libcxx/Makefile
@@ -0,0 +1,175 @@
+# $NetBSD: Makefile,v 1.1 2021/12/19 14:12:20 ryoon Exp $
+
+.include "../../lang/llvm/version.mk"
+
+DISTNAME= libcxxabi-${LLVM_VERSION}.src
+PKGNAME= ${DISTNAME:S/.src//:S/libcxxabi-/wasi-libcxx-/}
+CATEGORIES= lang devel
+
+MAINTAINER= pkgsrc-users@NetBSD.org
+HOMEPAGE= https://libcxxabi.llvm.org/
+COMMENT= C++ Standard Librares (libc++/libc++abi) for WASI/WebAssembly
+LICENSE= apache-2.0
+
+# libcxx requires libcxxabi's cxxabi.h to build, but libcxxabi requires
+# libcxx's includes to build, so we have this unholy extra distfiles thing
+# in both of them to get them to build against each other without causing
+# circular dependencies. This must be kept in sync with libcxxabi/Makefile.
+LIBCXX= libcxx-${LLVM_VERSION}.src
+LLVMDIST= llvm-${LLVM_VERSION}.src
+_EXTRA_DIST= ${LIBCXX}${EXTRACT_SUFX} ${LLVMDIST}${EXTRACT_SUFX}
+SITES.${LIBCXX}${EXTRACT_SUFX}= ${MASTER_SITES:=${GITHUB_PROJECT}/releases/download/${GITHUB_RELEASE}/}
+SITES.${LLLVMDIST}${EXTRACT_SUFX}= ${MASTER_SITES:=${GITHUB_PROJECT}/releases/download/${GITHUB_RELEASE}/}
+
+DISTFILES= ${DEFAULT_DISTFILES} ${_EXTRA_DIST}
+
+BUILD_DEPENDS+= lld-[0-9]*:../../devel/lld
+
+CXXFLAGS+= -Wno-reserved-user-defined-literal
+# Workaround for header conflicts
+BUILDLINK_TRANSFORM+= rm:-I/usr/include
+BUILDLINK_TRANSFORM+= rm:-I${PREFIX}/include
+
+BUILD_DIRS+= ../build_libcxx
+BUILD_DIRS+= ../build_libcxxabi
+INSTALL_DIRS+= ${BUILD_DIRS}
+
+USE_LANGUAGES= c c++
+USE_CMAKE= yes
+SSP_SUPPORTED= no
+
+CMAKE_ARGS+= -DCMAKE_VERBOSE_MAKEFILE=1
+
+CMAKE_ARGS+= -DCMAKE_BUILD_TYPE=Release
+CMAKE_ARGS+= -DCMAKE_C_COMPILER=${CC:Q}
+CMAKE_ARGS+= -DCMAKE_CXX_COMPILER=${CXX:Q}
+CMAKE_ARGS+= -DLIBCXXABI_LIBCXX_INCLUDES=${WRKDIR}/${LIBCXX}/include
+CMAKE_ARGS+= -DLIBCXXABI_USE_LLVM_UNWINDER=ON
+CMAKE_ARGS+= -DCMAKE_C_COMPILER_WORKS=1
+CMAKE_ARGS+= -DCMAKE_CXX_COMPILER_WORKS=1
+CMAKE_ARGS+= -DCXX_SUPPORTS_CXX11=ON
+CMAKE_ARGS+= -DLLVM_COMPILER_CHECKED=ON
+CMAKE_ARGS+= -DUNIX:BOOL=ON
+CMAKE_ARGS+= -DCMAKE_SYSROOT=${PREFIX}/wasi
+CMAKE_ARGS+= -DCMAKE_CXX_COMPILER_TARGET=wasm32-wasi
+CMAKE_ARGS+= -DLLVM_CONFIG_PATH=${PREFIX}/bin/llvm-config
+CMAKE_ARGS+= -DLIBCXX_LIBDIR_SUFFIX=/wasm32-wasi
+CMAKE_ARGS+= -DLIBCXX_INCLUDE_BENCHMARKS:BOOL=FALSE
+CMAKE_ARGS+= -DLIBCXX_INCLUDE_TESTS:BOOL=FALSE
+CMAKE_ARGS+= -DLIBCXX_ENABLE_THREADS:BOOL=OFF
+CMAKE_ARGS+= -DLIBCXX_HAS_PTHREAD_API:BOOL=OFF
+CMAKE_ARGS+= -DLIBCXX_HAS_EXTERNAL_THREAD_API:BOOL=OFF
+CMAKE_ARGS+= -DLIBCXX_BUILD_EXTERNAL_THREAD_LIBRARY:BOOL=OFF
+CMAKE_ARGS+= -DLIBCXX_HAS_WIN32_THREAD_API:BOOL=OFF
+CMAKE_ARGS+= -DLIBCXX_ENABLE_SHARED:BOOL=OFF
+CMAKE_ARGS+= -DLIBCXX_ENABLE_EXPERIMENTAL_LIBRARY:BOOL=OFF
+CMAKE_ARGS+= -DLIBCXX_ENABLE_EXCEPTIONS:BOOL=OFF
+CMAKE_ARGS+= -DLIBCXX_ENABLE_FILESYSTEM:BOOL=OFF
+CMAKE_ARGS+= -DLIBCXX_CXX_ABI=libcxxabi
+CMAKE_ARGS+= -DLIBCXX_HAS_MUSL_LIBC:BOOL=ON
+CMAKE_ARGS+= -DLIBCXX_ABI_VERSION=2
+CMAKE_ARGS+= -DLIBCXXABI_LIBDIR_SUFFIX=/wasm32-wasi
+CMAKE_ARGS+= -DLIBCXXABI_ENABLE_EXCEPTIONS:BOOL=OFF
+CMAKE_ARGS+= -DLIBCXXABI_ENABLE_SHARED:BOOL=OFF
+CMAKE_ARGS+= -DLIBCXXABI_SILENT_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LAG:BOOL=ON
+CMAKE_ARGS+= -DLIBCXXABI_SUPPORTS_WNEWLINE_EOF_FLAG:BOOL=ON
+CMAKE_ARGS+= -DLIBCXXABI_SUPPORTS_WUNUSED_FUNCTION_FLAG:BOOL=ON
+CMAKE_ARGS+= -DLIBCXXABI_SUPPORTS_WSHADOW_FLAG:BOOL=ON
+CMAKE_ARGS+= -DLIBCXXABI_SUPPORTS_WSHORTEN_64_TO_32_FLAG:BOOL=ON
+CMAKE_ARGS+= -DLIBCXXABI_SUPPORTS_WSIGN_COMPARE_FLAG:BOOL=ON
+CMAKE_ARGS+= -DLIBCXXABI_SUPPORTS_WSIGN_CONVERSION_FLAG:BOOL=ON
+CMAKE_ARGS+= -DLIBCXXABI_SUPPORTS_WSTRICT_ALIASING_EQ_2_FLAG:BOOL=ON
+CMAKE_ARGS+= -DLIBCXXABI_SUPPORTS_WSTRICT_OVERFLOW_EQ_4_FLAG:BOOL=ON
+CMAKE_ARGS+= -DLIBCXXABI_SUPPORTS_WUNUSED_PARAMETER_FLAG:BOOL=ON
+CMAKE_ARGS+= -DLIBCXXABI_SUPPORTS_WUNUSED_VARIABLE_FLAG:BOOL=ON
+CMAKE_ARGS+= -DLIBCXXABI_SUPPORTS_PEDANTIC_FLAG:BOOL=ON
+CMAKE_ARGS+= -DLIBCXXABI_SUPPORTS_FSTRICT_ALIASING_FLAG:BOOL=ON
+CMAKE_ARGS+= -DCMAKE_CXX_LINK_FLAGS=${LDFLAGS:Q}
+CMAKE_ARGS+= -DLIBCXX_CXX_ABI=libcxxabi
+CMAKE_ARGS+= -DLIBCXX_CXX_ABI_INCLUDE_PATHS=${WRKDIR}/${DISTNAME}/include
+
+CMAKE_INSTALL_PREFIX= ${PREFIX}/wasi
+
+# avoid conflict with stddef.h
+CPPFLAGS.NetBSD+= -D__DEFINED_max_align_t=1
+
+post-extract:
+ ${MKDIR} ${WRKDIR}/build_libcxx
+ ${MKDIR} ${WRKDIR}/build_libcxxabi
+ ${LN} -f -s ${WRKDIR}/${DISTNAME} ${WRKDIR}/libcxxabi
+ ${LN} -f -s ${WRKDIR}/${LIBCXX} ${WRKDIR}/libcxx
+ ${LN} -f -s ${WRKDIR}/${LLVMDIST} ${WRKDIR}/llvm
+ # TODO: not sure what should create this and with which contents
+ ${TOUCH} ${WRKDIR}/${LIBCXX}/include/__config_site
+
+do-configure:
+ cd ${WRKSRC} && cd ../build_libcxx && \
+ ${PKGSRC_SETENV} ${_CONFIGURE_CMAKE_ENV} \
+ cmake ${CMAKE_ARGS} ../libcxx
+ cd ${WRKSRC} && cd ../build_libcxxabi && \
+ ${PKGSRC_SETENV} ${_CONFIGURE_CMAKE_ENV} \
+ cmake ${CMAKE_ARGS} ../libcxxabi
+
+.include "../../lang/llvm/buildlink3.mk"
+.include "../../lang/wasi-compiler-rt/buildlink3.mk"
+PKGSRC_COMPILER= clang
+PKG_CC= ${PREFIX}/bin/clang
+PKG_CXX= ${PREFIX}/bin/clang++
+BUILDLINK_DEPMETHOD.clang= build
+.include "../../lang/clang/buildlink3.mk"
+.include "../../mk/bsd.pkg.mk"
diff --git a/lang/wasi-libcxx/PLIST b/lang/wasi-libcxx/PLIST
new file mode 100644
index 00000000000..ce632384151
--- /dev/null
+++ b/lang/wasi-libcxx/PLIST
@@ -0,0 +1,392 @@
+@comment $NetBSD: PLIST,v 1.1 2021/12/19 14:12:20 ryoon Exp $
+wasi/include/c++/v1/__algorithm/adjacent_find.h
+wasi/include/c++/v1/__algorithm/all_of.h
+wasi/include/c++/v1/__algorithm/any_of.h
+wasi/include/c++/v1/__algorithm/binary_search.h
+wasi/include/c++/v1/__algorithm/clamp.h
+wasi/include/c++/v1/__algorithm/comp.h
+wasi/include/c++/v1/__algorithm/comp_ref_type.h
+wasi/include/c++/v1/__algorithm/copy.h
+wasi/include/c++/v1/__algorithm/copy_backward.h
+wasi/include/c++/v1/__algorithm/copy_if.h
+wasi/include/c++/v1/__algorithm/copy_n.h
+wasi/include/c++/v1/__algorithm/count.h
+wasi/include/c++/v1/__algorithm/count_if.h
+wasi/include/c++/v1/__algorithm/equal.h
+wasi/include/c++/v1/__algorithm/equal_range.h
+wasi/include/c++/v1/__algorithm/fill.h
+wasi/include/c++/v1/__algorithm/fill_n.h
+wasi/include/c++/v1/__algorithm/find.h
+wasi/include/c++/v1/__algorithm/find_end.h
+wasi/include/c++/v1/__algorithm/find_first_of.h
+wasi/include/c++/v1/__algorithm/find_if.h
+wasi/include/c++/v1/__algorithm/find_if_not.h
+wasi/include/c++/v1/__algorithm/for_each.h
+wasi/include/c++/v1/__algorithm/for_each_n.h
+wasi/include/c++/v1/__algorithm/generate.h
+wasi/include/c++/v1/__algorithm/generate_n.h
+wasi/include/c++/v1/__algorithm/half_positive.h
+wasi/include/c++/v1/__algorithm/includes.h
+wasi/include/c++/v1/__algorithm/inplace_merge.h
+wasi/include/c++/v1/__algorithm/is_heap.h
+wasi/include/c++/v1/__algorithm/is_heap_until.h
+wasi/include/c++/v1/__algorithm/is_partitioned.h
+wasi/include/c++/v1/__algorithm/is_permutation.h
+wasi/include/c++/v1/__algorithm/is_sorted.h
+wasi/include/c++/v1/__algorithm/is_sorted_until.h
+wasi/include/c++/v1/__algorithm/iter_swap.h
+wasi/include/c++/v1/__algorithm/lexicographical_compare.h
+wasi/include/c++/v1/__algorithm/lower_bound.h
+wasi/include/c++/v1/__algorithm/make_heap.h
+wasi/include/c++/v1/__algorithm/max.h
+wasi/include/c++/v1/__algorithm/max_element.h
+wasi/include/c++/v1/__algorithm/merge.h
+wasi/include/c++/v1/__algorithm/min.h
+wasi/include/c++/v1/__algorithm/min_element.h
+wasi/include/c++/v1/__algorithm/minmax.h
+wasi/include/c++/v1/__algorithm/minmax_element.h
+wasi/include/c++/v1/__algorithm/mismatch.h
+wasi/include/c++/v1/__algorithm/move.h
+wasi/include/c++/v1/__algorithm/move_backward.h
+wasi/include/c++/v1/__algorithm/next_permutation.h
+wasi/include/c++/v1/__algorithm/none_of.h
+wasi/include/c++/v1/__algorithm/nth_element.h
+wasi/include/c++/v1/__algorithm/partial_sort.h
+wasi/include/c++/v1/__algorithm/partial_sort_copy.h
+wasi/include/c++/v1/__algorithm/partition.h
+wasi/include/c++/v1/__algorithm/partition_copy.h
+wasi/include/c++/v1/__algorithm/partition_point.h
+wasi/include/c++/v1/__algorithm/pop_heap.h
+wasi/include/c++/v1/__algorithm/prev_permutation.h
+wasi/include/c++/v1/__algorithm/push_heap.h
+wasi/include/c++/v1/__algorithm/remove.h
+wasi/include/c++/v1/__algorithm/remove_copy.h
+wasi/include/c++/v1/__algorithm/remove_copy_if.h
+wasi/include/c++/v1/__algorithm/remove_if.h
+wasi/include/c++/v1/__algorithm/replace.h
+wasi/include/c++/v1/__algorithm/replace_copy.h
+wasi/include/c++/v1/__algorithm/replace_copy_if.h
+wasi/include/c++/v1/__algorithm/replace_if.h
+wasi/include/c++/v1/__algorithm/reverse.h
+wasi/include/c++/v1/__algorithm/reverse_copy.h
+wasi/include/c++/v1/__algorithm/rotate.h
+wasi/include/c++/v1/__algorithm/rotate_copy.h
+wasi/include/c++/v1/__algorithm/sample.h
+wasi/include/c++/v1/__algorithm/search.h
+wasi/include/c++/v1/__algorithm/search_n.h
+wasi/include/c++/v1/__algorithm/set_difference.h
+wasi/include/c++/v1/__algorithm/set_intersection.h
+wasi/include/c++/v1/__algorithm/set_symmetric_difference.h
+wasi/include/c++/v1/__algorithm/set_union.h
+wasi/include/c++/v1/__algorithm/shift_left.h
+wasi/include/c++/v1/__algorithm/shift_right.h
+wasi/include/c++/v1/__algorithm/shuffle.h
+wasi/include/c++/v1/__algorithm/sift_down.h
+wasi/include/c++/v1/__algorithm/sort.h
+wasi/include/c++/v1/__algorithm/sort_heap.h
+wasi/include/c++/v1/__algorithm/stable_partition.h
+wasi/include/c++/v1/__algorithm/stable_sort.h
+wasi/include/c++/v1/__algorithm/swap_ranges.h
+wasi/include/c++/v1/__algorithm/transform.h
+wasi/include/c++/v1/__algorithm/unique.h
+wasi/include/c++/v1/__algorithm/unique_copy.h
+wasi/include/c++/v1/__algorithm/unwrap_iter.h
+wasi/include/c++/v1/__algorithm/upper_bound.h
+wasi/include/c++/v1/__availability
+wasi/include/c++/v1/__bit_reference
+wasi/include/c++/v1/__bits
+wasi/include/c++/v1/__bsd_locale_defaults.h
+wasi/include/c++/v1/__bsd_locale_fallbacks.h
+wasi/include/c++/v1/__config
+wasi/include/c++/v1/__config_site
+wasi/include/c++/v1/__cxxabi_config.h
+wasi/include/c++/v1/__debug
+wasi/include/c++/v1/__errc
+wasi/include/c++/v1/__format/format_error.h
+wasi/include/c++/v1/__format/format_parse_context.h
+wasi/include/c++/v1/__function_like.h
+wasi/include/c++/v1/__functional/binary_function.h
+wasi/include/c++/v1/__functional/binary_negate.h
+wasi/include/c++/v1/__functional/bind.h
+wasi/include/c++/v1/__functional/bind_front.h
+wasi/include/c++/v1/__functional/binder1st.h
+wasi/include/c++/v1/__functional/binder2nd.h
+wasi/include/c++/v1/__functional/default_searcher.h
+wasi/include/c++/v1/__functional/function.h
+wasi/include/c++/v1/__functional/hash.h
+wasi/include/c++/v1/__functional/identity.h
+wasi/include/c++/v1/__functional/invoke.h
+wasi/include/c++/v1/__functional/is_transparent.h
+wasi/include/c++/v1/__functional/mem_fn.h
+wasi/include/c++/v1/__functional/mem_fun_ref.h
+wasi/include/c++/v1/__functional/not_fn.h
+wasi/include/c++/v1/__functional/operations.h
+wasi/include/c++/v1/__functional/perfect_forward.h
+wasi/include/c++/v1/__functional/pointer_to_binary_function.h
+wasi/include/c++/v1/__functional/pointer_to_unary_function.h
+wasi/include/c++/v1/__functional/ranges_operations.h
+wasi/include/c++/v1/__functional/reference_wrapper.h
+wasi/include/c++/v1/__functional/unary_function.h
+wasi/include/c++/v1/__functional/unary_negate.h
+wasi/include/c++/v1/__functional/unwrap_ref.h
+wasi/include/c++/v1/__functional/weak_result_type.h
+wasi/include/c++/v1/__functional_base
+wasi/include/c++/v1/__hash_table
+wasi/include/c++/v1/__iterator/access.h
+wasi/include/c++/v1/__iterator/advance.h
+wasi/include/c++/v1/__iterator/back_insert_iterator.h
+wasi/include/c++/v1/__iterator/common_iterator.h
+wasi/include/c++/v1/__iterator/concepts.h
+wasi/include/c++/v1/__iterator/counted_iterator.h
+wasi/include/c++/v1/__iterator/data.h
+wasi/include/c++/v1/__iterator/default_sentinel.h
+wasi/include/c++/v1/__iterator/distance.h
+wasi/include/c++/v1/__iterator/empty.h
+wasi/include/c++/v1/__iterator/erase_if_container.h
+wasi/include/c++/v1/__iterator/front_insert_iterator.h
+wasi/include/c++/v1/__iterator/incrementable_traits.h
+wasi/include/c++/v1/__iterator/insert_iterator.h
+wasi/include/c++/v1/__iterator/istream_iterator.h
+wasi/include/c++/v1/__iterator/istreambuf_iterator.h
+wasi/include/c++/v1/__iterator/iter_move.h
+wasi/include/c++/v1/__iterator/iter_swap.h
+wasi/include/c++/v1/__iterator/iterator.h
+wasi/include/c++/v1/__iterator/iterator_traits.h
+wasi/include/c++/v1/__iterator/move_iterator.h
+wasi/include/c++/v1/__iterator/next.h
+wasi/include/c++/v1/__iterator/ostream_iterator.h
+wasi/include/c++/v1/__iterator/ostreambuf_iterator.h
+wasi/include/c++/v1/__iterator/prev.h
+wasi/include/c++/v1/__iterator/projected.h
+wasi/include/c++/v1/__iterator/readable_traits.h
+wasi/include/c++/v1/__iterator/reverse_access.h
+wasi/include/c++/v1/__iterator/reverse_iterator.h
+wasi/include/c++/v1/__iterator/size.h
+wasi/include/c++/v1/__iterator/wrap_iter.h
+wasi/include/c++/v1/__libcpp_version
+wasi/include/c++/v1/__locale
+wasi/include/c++/v1/__memory/addressof.h
+wasi/include/c++/v1/__memory/allocation_guard.h
+wasi/include/c++/v1/__memory/allocator.h
+wasi/include/c++/v1/__memory/allocator_arg_t.h
+wasi/include/c++/v1/__memory/allocator_traits.h
+wasi/include/c++/v1/__memory/auto_ptr.h
+wasi/include/c++/v1/__memory/compressed_pair.h
+wasi/include/c++/v1/__memory/construct_at.h
+wasi/include/c++/v1/__memory/pointer_safety.h
+wasi/include/c++/v1/__memory/pointer_traits.h
+wasi/include/c++/v1/__memory/raw_storage_iterator.h
+wasi/include/c++/v1/__memory/shared_ptr.h
+wasi/include/c++/v1/__memory/temporary_buffer.h
+wasi/include/c++/v1/__memory/uninitialized_algorithms.h
+wasi/include/c++/v1/__memory/unique_ptr.h
+wasi/include/c++/v1/__memory/uses_allocator.h
+wasi/include/c++/v1/__mutex_base
+wasi/include/c++/v1/__node_handle
+wasi/include/c++/v1/__nullptr
+wasi/include/c++/v1/__random/uniform_int_distribution.h
+wasi/include/c++/v1/__ranges/access.h
+wasi/include/c++/v1/__ranges/all.h
+wasi/include/c++/v1/__ranges/common_view.h
+wasi/include/c++/v1/__ranges/concepts.h
+wasi/include/c++/v1/__ranges/copyable_box.h
+wasi/include/c++/v1/__ranges/dangling.h
+wasi/include/c++/v1/__ranges/data.h
+wasi/include/c++/v1/__ranges/drop_view.h
+wasi/include/c++/v1/__ranges/empty.h
+wasi/include/c++/v1/__ranges/empty_view.h
+wasi/include/c++/v1/__ranges/enable_borrowed_range.h
+wasi/include/c++/v1/__ranges/enable_view.h
+wasi/include/c++/v1/__ranges/non_propagating_cache.h
+wasi/include/c++/v1/__ranges/ref_view.h
+wasi/include/c++/v1/__ranges/size.h
+wasi/include/c++/v1/__ranges/subrange.h
+wasi/include/c++/v1/__ranges/transform_view.h
+wasi/include/c++/v1/__ranges/view_interface.h
+wasi/include/c++/v1/__split_buffer
+wasi/include/c++/v1/__std_stream
+wasi/include/c++/v1/__string
+wasi/include/c++/v1/__support/android/locale_bionic.h
+wasi/include/c++/v1/__support/fuchsia/xlocale.h
+wasi/include/c++/v1/__support/ibm/gettod_zos.h
+wasi/include/c++/v1/__support/ibm/limits.h
+wasi/include/c++/v1/__support/ibm/locale_mgmt_aix.h
+wasi/include/c++/v1/__support/ibm/locale_mgmt_zos.h
+wasi/include/c++/v1/__support/ibm/nanosleep.h
+wasi/include/c++/v1/__support/ibm/support.h
+wasi/include/c++/v1/__support/ibm/xlocale.h
+wasi/include/c++/v1/__support/musl/xlocale.h
+wasi/include/c++/v1/__support/newlib/xlocale.h
+wasi/include/c++/v1/__support/nuttx/xlocale.h
+wasi/include/c++/v1/__support/openbsd/xlocale.h
+wasi/include/c++/v1/__support/solaris/floatingpoint.h
+wasi/include/c++/v1/__support/solaris/wchar.h
+wasi/include/c++/v1/__support/solaris/xlocale.h
+wasi/include/c++/v1/__support/win32/limits_msvc_win32.h
+wasi/include/c++/v1/__support/win32/locale_win32.h
+wasi/include/c++/v1/__support/xlocale/__nop_locale_mgmt.h
+wasi/include/c++/v1/__support/xlocale/__posix_l_fallback.h
+wasi/include/c++/v1/__support/xlocale/__strtonum_fallback.h
+wasi/include/c++/v1/__threading_support
+wasi/include/c++/v1/__tree
+wasi/include/c++/v1/__tuple
+wasi/include/c++/v1/__undef_macros
+wasi/include/c++/v1/__utility/__decay_copy.h
+wasi/include/c++/v1/__utility/as_const.h
+wasi/include/c++/v1/__utility/cmp.h
+wasi/include/c++/v1/__utility/declval.h
+wasi/include/c++/v1/__utility/exchange.h
+wasi/include/c++/v1/__utility/forward.h
+wasi/include/c++/v1/__utility/in_place.h
+wasi/include/c++/v1/__utility/integer_sequence.h
+wasi/include/c++/v1/__utility/move.h
+wasi/include/c++/v1/__utility/pair.h
+wasi/include/c++/v1/__utility/piecewise_construct.h
+wasi/include/c++/v1/__utility/rel_ops.h
+wasi/include/c++/v1/__utility/swap.h
+wasi/include/c++/v1/__utility/to_underlying.h
+wasi/include/c++/v1/__variant/monostate.h
+wasi/include/c++/v1/algorithm
+wasi/include/c++/v1/any
+wasi/include/c++/v1/array
+wasi/include/c++/v1/atomic
+wasi/include/c++/v1/barrier
+wasi/include/c++/v1/bit
+wasi/include/c++/v1/bitset
+wasi/include/c++/v1/cassert
+wasi/include/c++/v1/ccomplex
+wasi/include/c++/v1/cctype
+wasi/include/c++/v1/cerrno
+wasi/include/c++/v1/cfenv
+wasi/include/c++/v1/cfloat
+wasi/include/c++/v1/charconv
+wasi/include/c++/v1/chrono
+wasi/include/c++/v1/cinttypes
+wasi/include/c++/v1/ciso646
+wasi/include/c++/v1/climits
+wasi/include/c++/v1/clocale
+wasi/include/c++/v1/cmath
+wasi/include/c++/v1/codecvt
+wasi/include/c++/v1/compare
+wasi/include/c++/v1/complex
+wasi/include/c++/v1/complex.h
+wasi/include/c++/v1/concepts
+wasi/include/c++/v1/condition_variable
+wasi/include/c++/v1/csetjmp
+wasi/include/c++/v1/csignal
+wasi/include/c++/v1/cstdarg
+wasi/include/c++/v1/cstdbool
+wasi/include/c++/v1/cstddef
+wasi/include/c++/v1/cstdint
+wasi/include/c++/v1/cstdio
+wasi/include/c++/v1/cstdlib
+wasi/include/c++/v1/cstring
+wasi/include/c++/v1/ctgmath
+wasi/include/c++/v1/ctime
+wasi/include/c++/v1/ctype.h
+wasi/include/c++/v1/cwchar
+wasi/include/c++/v1/cwctype
+wasi/include/c++/v1/cxxabi.h
+wasi/include/c++/v1/deque
+wasi/include/c++/v1/errno.h
+wasi/include/c++/v1/exception
+wasi/include/c++/v1/execution
+wasi/include/c++/v1/experimental/__config
+wasi/include/c++/v1/experimental/__memory
+wasi/include/c++/v1/experimental/algorithm
+wasi/include/c++/v1/experimental/coroutine
+wasi/include/c++/v1/experimental/deque
+wasi/include/c++/v1/experimental/filesystem
+wasi/include/c++/v1/experimental/forward_list
+wasi/include/c++/v1/experimental/functional
+wasi/include/c++/v1/experimental/iterator
+wasi/include/c++/v1/experimental/list
+wasi/include/c++/v1/experimental/map
+wasi/include/c++/v1/experimental/memory_resource
+wasi/include/c++/v1/experimental/propagate_const
+wasi/include/c++/v1/experimental/regex
+wasi/include/c++/v1/experimental/set
+wasi/include/c++/v1/experimental/simd
+wasi/include/c++/v1/experimental/string
+wasi/include/c++/v1/experimental/type_traits
+wasi/include/c++/v1/experimental/unordered_map
+wasi/include/c++/v1/experimental/unordered_set
+wasi/include/c++/v1/experimental/utility
+wasi/include/c++/v1/experimental/vector
+wasi/include/c++/v1/ext/__hash
+wasi/include/c++/v1/ext/hash_map
+wasi/include/c++/v1/ext/hash_set
+wasi/include/c++/v1/fenv.h
+wasi/include/c++/v1/filesystem
+wasi/include/c++/v1/float.h
+wasi/include/c++/v1/format
+wasi/include/c++/v1/forward_list
+wasi/include/c++/v1/fstream
+wasi/include/c++/v1/functional
+wasi/include/c++/v1/future
+wasi/include/c++/v1/initializer_list
+wasi/include/c++/v1/inttypes.h
+wasi/include/c++/v1/iomanip
+wasi/include/c++/v1/ios
+wasi/include/c++/v1/iosfwd
+wasi/include/c++/v1/iostream
+wasi/include/c++/v1/istream
+wasi/include/c++/v1/iterator
+wasi/include/c++/v1/latch
+wasi/include/c++/v1/limits
+wasi/include/c++/v1/limits.h
+wasi/include/c++/v1/list
+wasi/include/c++/v1/locale
+wasi/include/c++/v1/locale.h
+wasi/include/c++/v1/map
+wasi/include/c++/v1/math.h
+wasi/include/c++/v1/memory
+wasi/include/c++/v1/module.modulemap
+wasi/include/c++/v1/mutex
+wasi/include/c++/v1/new
+wasi/include/c++/v1/numbers
+wasi/include/c++/v1/numeric
+wasi/include/c++/v1/optional
+wasi/include/c++/v1/ostream
+wasi/include/c++/v1/queue
+wasi/include/c++/v1/random
+wasi/include/c++/v1/ranges
+wasi/include/c++/v1/ratio
+wasi/include/c++/v1/regex
+wasi/include/c++/v1/scoped_allocator
+wasi/include/c++/v1/semaphore
+wasi/include/c++/v1/set
+wasi/include/c++/v1/setjmp.h
+wasi/include/c++/v1/shared_mutex
+wasi/include/c++/v1/span
+wasi/include/c++/v1/sstream
+wasi/include/c++/v1/stack
+wasi/include/c++/v1/stdbool.h
+wasi/include/c++/v1/stddef.h
+wasi/include/c++/v1/stdexcept
+wasi/include/c++/v1/stdint.h
+wasi/include/c++/v1/stdio.h
+wasi/include/c++/v1/stdlib.h
+wasi/include/c++/v1/streambuf
+wasi/include/c++/v1/string
+wasi/include/c++/v1/string.h
+wasi/include/c++/v1/string_view
+wasi/include/c++/v1/strstream
+wasi/include/c++/v1/system_error
+wasi/include/c++/v1/tgmath.h
+wasi/include/c++/v1/thread
+wasi/include/c++/v1/tuple
+wasi/include/c++/v1/type_traits
+wasi/include/c++/v1/typeindex
+wasi/include/c++/v1/typeinfo
+wasi/include/c++/v1/unordered_map
+wasi/include/c++/v1/unordered_set
+wasi/include/c++/v1/utility
+wasi/include/c++/v1/valarray
+wasi/include/c++/v1/variant
+wasi/include/c++/v1/vector
+wasi/include/c++/v1/version
+wasi/include/c++/v1/wchar.h
+wasi/include/c++/v1/wctype.h
+wasi/lib/wasm32-wasi/libc++.a
+wasi/lib/wasm32-wasi/libc++abi.a
diff --git a/lang/wasi-libcxx/buildlink3.mk b/lang/wasi-libcxx/buildlink3.mk
new file mode 100644
index 00000000000..8c711596b92
--- /dev/null
+++ b/lang/wasi-libcxx/buildlink3.mk
@@ -0,0 +1,15 @@
+# $NetBSD: buildlink3.mk,v 1.1 2021/12/19 14:12:20 ryoon Exp $
+
+BUILDLINK_TREE+= wasi-libcxx
+
+BUILDLINK_DEPMETHOD.wasi-libcxx?= build
+
+.if !defined(WASI_LIBCXX_BUILDLINK3_MK)
+WASI_LIBCXX_BUILDLINK3_MK:=
+
+BUILDLINK_API_DEPENDS.wasi-libcxx+= wasi-libcxx>=13.0.0
+BUILDLINK_PKGSRCDIR.wasi-libcxx?= ../../lang/wasi-libcxx
+
+.endif # WASI_LIBCXX_BUILDLINK3_MK
+
+BUILDLINK_TREE+= -wasi-libcxx
diff --git a/lang/wasi-libcxx/distinfo b/lang/wasi-libcxx/distinfo
new file mode 100644
index 00000000000..7823ca95333
--- /dev/null
+++ b/lang/wasi-libcxx/distinfo
@@ -0,0 +1,11 @@
+$NetBSD: distinfo,v 1.1 2021/12/19 14:12:20 ryoon Exp $
+
+BLAKE2s (libcxx-13.0.0.src.tar.xz) = ade0de63ce72d50ae1276cf71da17aa5fa375e9ad767e2c1abecaa7f57953768
+SHA512 (libcxx-13.0.0.src.tar.xz) = deaf166ea9b5ffe4d7d1ace86fb4ed33317c610ff41947d2b0b18934b2a54601521f1021c5fd43bdba3a08779f3be98e13d2565c0d4374d849c5eff487eda2dd
+Size (libcxx-13.0.0.src.tar.xz) = 2086032 bytes
+BLAKE2s (libcxxabi-13.0.0.src.tar.xz) = d0d7712e3affd61a122fa4a305a1c05a6f3362cbe10c80bc93ed8b3065ecf6bb
+SHA512 (libcxxabi-13.0.0.src.tar.xz) = e7c8177898f344d4a16bf199ddbae4c8ae0d31e2961c5946934abb30631c386d2d28bf4804e65faa9f6298aca01e6e925fd88a13c918d8e5d1b175720e600823
+Size (libcxxabi-13.0.0.src.tar.xz) = 554780 bytes
+BLAKE2s (llvm-13.0.0.src.tar.xz) = ffdfed33e870715f2e8c0efdc2c29566a2bffe5a6efce90ea7ca4990c9067f0f
+SHA512 (llvm-13.0.0.src.tar.xz) = c307500a5fdc2bf6d768a808cf879d33914e24437f4f794361eccedb28ac6a98ebc41ca6140d09364c9bdec565fabd049e364d3f5b39f1751ecff51b687c4eff
+Size (llvm-13.0.0.src.tar.xz) = 45471992 bytes