summaryrefslogtreecommitdiffstats
path: root/gnu
diff options
context:
space:
mode:
authorpatrick <patrick@openbsd.org>2021-01-02 20:04:36 +0000
committerpatrick <patrick@openbsd.org>2021-01-02 20:04:36 +0000
commitf950054f2b0e132abaf0afe27922f4cc1a4eead5 (patch)
treee59e06e3a4042e86f9afbe14a474838505259d12 /gnu
parentTweak previous: (diff)
downloadwireguard-openbsd-f950054f2b0e132abaf0afe27922f4cc1a4eead5.tar.xz
wireguard-openbsd-f950054f2b0e132abaf0afe27922f4cc1a4eead5.zip
Move Makefiles for libc++ and libc++abi to gnu/lib in preparation for an
upcoming update to those, which will see both codebases heading into the gnu/llvm dumpster. Feedback from jsg@ ok deraadt@ kettenis@
Diffstat (limited to 'gnu')
-rw-r--r--gnu/lib/Makefile3
-rw-r--r--gnu/lib/libcxx/Makefile294
-rw-r--r--gnu/lib/libcxx/shlib_version2
-rw-r--r--gnu/lib/libcxxabi/Makefile107
-rw-r--r--gnu/lib/libcxxabi/shlib_version3
5 files changed, 408 insertions, 1 deletions
diff --git a/gnu/lib/Makefile b/gnu/lib/Makefile
index 63d88969467..f784a6d945e 100644
--- a/gnu/lib/Makefile
+++ b/gnu/lib/Makefile
@@ -1,8 +1,9 @@
-# $OpenBSD: Makefile,v 1.23 2020/08/10 21:09:39 patrick Exp $
+# $OpenBSD: Makefile,v 1.24 2021/01/02 20:04:36 patrick Exp $
.include <bsd.own.mk>
SUBDIR+=libcompiler_rt libiberty libreadline
+SUBDIR+=libcxxabi libcxx
.if make(obj)
SUBDIR+=libstdc++ libstdc++-v3 libsupc++-v3
.else
diff --git a/gnu/lib/libcxx/Makefile b/gnu/lib/libcxx/Makefile
new file mode 100644
index 00000000000..e2d9816cd38
--- /dev/null
+++ b/gnu/lib/libcxx/Makefile
@@ -0,0 +1,294 @@
+# $OpenBSD: Makefile,v 1.1 2021/01/02 20:04:36 patrick Exp $
+
+.include <bsd.own.mk>
+
+.if ${COMPILER_VERSION:L} != "clang"
+CC= clang
+CXX= clang++
+.endif
+
+.if ${BUILD_CLANG:L} == "yes"
+
+HDRDIR= ${.CURDIR}/../../../lib/libcxx/include
+SRCDIR= ${.CURDIR}/../../../lib/libcxx/src
+AHDRDIR= ${.CURDIR}/../../../lib/libcxxabi/include
+UHDRDIR= ${.CURDIR}/../../../gnu/llvm/libunwind/include
+CXXINCLUDEDIR= /usr/include/c++/v1
+
+.PATH: ${SRCDIR} ${SRCDIR}/filesystem
+
+LIB= c++
+
+
+SRCS+= algorithm.cpp \
+ any.cpp \
+ bind.cpp \
+ charconv.cpp \
+ chrono.cpp \
+ condition_variable.cpp \
+ debug.cpp \
+ directory_iterator.cpp \
+ exception.cpp \
+ functional.cpp \
+ future.cpp \
+ hash.cpp \
+ ios.cpp \
+ iostream.cpp \
+ locale.cpp \
+ memory.cpp \
+ mutex.cpp \
+ new.cpp \
+ operations.cpp \
+ optional.cpp \
+ random.cpp \
+ regex.cpp \
+ shared_mutex.cpp \
+ stdexcept.cpp \
+ string.cpp \
+ strstream.cpp \
+ system_error.cpp \
+ thread.cpp \
+ typeinfo.cpp \
+ utility.cpp \
+ valarray.cpp \
+ variant.cpp \
+ vector.cpp
+
+CPPFLAGS+= -Wall -DLIBCXXABI -I${HDRDIR} -D_LIBCPP_BUILDING_LIBRARY \
+ -DLIBCXX_BUILDING_LIBCXXABI -I${AHDRDIR} -I${UHDRDIR} \
+ -DNDEBUG
+CXXFLAGS+= -nostdlib -nostdinc++
+.if empty(CXXFLAGS:M-std=*)
+CXXFLAGS+= -std=c++14
+.endif
+
+LDADD+= -L${BSDOBJDIR}/lib/libcxxabi -lc++abi
+
+
+STD_HEADERS= __bit_reference \
+ __bsd_locale_defaults.h \
+ __bsd_locale_fallbacks.h \
+ __config \
+ __config_site.in \
+ __debug \
+ __errc \
+ __functional_03 \
+ __functional_base \
+ __functional_base_03 \
+ __hash_table \
+ __libcpp_version \
+ __locale \
+ __mutex_base \
+ __node_handle \
+ __nullptr \
+ __split_buffer \
+ __sso_allocator \
+ __std_stream \
+ __string \
+ __threading_support \
+ __tree \
+ __tuple \
+ __undef_macros \
+ algorithm \
+ any \
+ array \
+ atomic \
+ bit \
+ bitset \
+ cassert \
+ ccomplex \
+ cctype \
+ cerrno \
+ cfenv \
+ cfloat \
+ charconv \
+ chrono \
+ cinttypes \
+ ciso646 \
+ climits \
+ clocale \
+ cmath \
+ codecvt \
+ compare \
+ complex \
+ complex.h \
+ condition_variable \
+ csetjmp \
+ csignal \
+ cstdarg \
+ cstdbool \
+ cstddef \
+ cstdint \
+ cstdio \
+ cstdlib \
+ cstring \
+ ctgmath \
+ ctime \
+ ctype.h \
+ cwchar \
+ cwctype \
+ deque \
+ errno.h \
+ exception \
+ filesystem \
+ float.h \
+ forward_list \
+ fstream \
+ functional \
+ future \
+ initializer_list \
+ inttypes.h \
+ iomanip \
+ ios \
+ iosfwd \
+ iostream \
+ istream \
+ iterator \
+ limits \
+ limits.h \
+ list \
+ locale \
+ locale.h \
+ map \
+ math.h \
+ memory \
+ module.modulemap \
+ mutex \
+ new \
+ numeric \
+ optional \
+ ostream \
+ queue \
+ random \
+ ratio \
+ regex \
+ scoped_allocator \
+ set \
+ setjmp.h \
+ shared_mutex \
+ span \
+ sstream \
+ stack \
+ stdbool.h \
+ stddef.h \
+ stdexcept \
+ stdint.h \
+ stdio.h \
+ stdlib.h \
+ streambuf \
+ string \
+ string.h \
+ string_view \
+ strstream \
+ system_error \
+ tgmath.h \
+ thread \
+ tuple \
+ type_traits \
+ typeindex \
+ typeinfo \
+ unordered_map \
+ unordered_set \
+ utility \
+ valarray \
+ variant \
+ vector \
+ version \
+ wchar.h \
+ wctype.h
+
+.for hdr in ${STD_HEADERS}
+STD+= ${hdr} ${HDRDIR}/${hdr}
+.endfor
+STDDIR= ${CXXINCLUDEDIR}
+
+EXT_HEADERS= __hash\
+ hash_map\
+ hash_set
+
+.for hdr in ${EXT_HEADERS}
+EXT+= ${hdr} ${HDRDIR}/ext/${hdr}
+.endfor
+EXTDIR= ${CXXINCLUDEDIR}/ext
+
+
+EXP_HEADERS= __config \
+ __memory \
+ algorithm \
+ any \
+ chrono \
+ coroutine \
+ deque \
+ filesystem \
+ forward_list \
+ functional \
+ iterator \
+ list \
+ map \
+ memory_resource \
+ numeric \
+ optional \
+ propagate_const \
+ ratio \
+ regex \
+ set \
+ simd \
+ string \
+ string_view \
+ system_error \
+ tuple \
+ utility \
+ type_traits \
+ unordered_map \
+ unordered_set \
+ vector
+
+.for hdr in ${EXP_HEADERS}
+EXP+= ${hdr} ${HDRDIR}/experimental/${hdr}
+.endfor
+EXPDIR= ${CXXINCLUDEDIR}/experimental
+
+XLOCALE_HEADERS= __nop_locale_mgmt.h\
+ __posix_l_fallback.h\
+ __strtonum_fallback.h\
+ xlocale.h
+
+.for hdr in ${XLOCALE_HEADERS}
+XLOCALE+= ${hdr} ${HDRDIR}/support/xlocale/${hdr}
+.endfor
+XLOCALEDIR= ${CXXINCLUDEDIR}/support/xlocale
+
+includes:
+ @echo installing ${STD_HEADERS}
+ ${INSTALL} -d -m 755 ${DESTDIR}/${STDDIR};
+. for hdr src in ${STD}
+ cmp -s ${src} ${DESTDIR}/${STDDIR}/${hdr} || \
+ ${INSTALL} ${INSTALL_COPY} -m 444 ${src} ${DESTDIR}/${STDDIR}/${hdr};
+. endfor
+ ${INSTALL} -d -m 755 ${DESTDIR}/${EXTDIR};
+. for hdr src in ${EXT}
+ cmp -s ${src} ${DESTDIR}/${EXTDIR}/${hdr} || \
+ ${INSTALL} ${INSTALL_COPY} -m 444 ${src} ${DESTDIR}/${EXTDIR}/${hdr};
+. endfor
+ ${INSTALL} -d -m 755 ${DESTDIR}/${EXPDIR};
+. for hdr src in ${EXP}
+ cmp -s ${src} ${DESTDIR}/${EXPDIR}/${hdr} || \
+ ${INSTALL} ${INSTALL_COPY} -m 444 ${src} ${DESTDIR}/${EXPDIR}/${hdr};
+. endfor
+ ${INSTALL} -d -m 755 ${DESTDIR}/${CXXINCLUDEDIR}/support/newlib;
+ cmp -s ${HDRDIR}/support/newlib/xlocale.h \
+ ${DESTDIR}/${CXXINCLUDEDIR}/support/newlib/xlocale.h || \
+ ${INSTALL} ${INSTALL_COPY} -m 444 ${HDRDIR}/support/newlib/xlocale.h \
+ ${DESTDIR}/${CXXINCLUDEDIR}/support/newlib/xlocale.h;
+ ${INSTALL} -d -m 755 ${DESTDIR}/${CXXINCLUDEDIR}/support/xlocale;
+. for hdr src in ${XLOCALE}
+ cmp -s ${src} ${DESTDIR}/${XLOCALEDIR}/${hdr} || \
+ ${INSTALL} ${INSTALL_COPY} -m 444 ${src} ${DESTDIR}/${XLOCALEDIR}/${hdr};
+. endfor
+
+.include <bsd.lib.mk>
+
+.else
+NOPROG=
+.include <bsd.prog.mk>
+.endif
diff --git a/gnu/lib/libcxx/shlib_version b/gnu/lib/libcxx/shlib_version
new file mode 100644
index 00000000000..9c1551636c5
--- /dev/null
+++ b/gnu/lib/libcxx/shlib_version
@@ -0,0 +1,2 @@
+major=6
+minor=0
diff --git a/gnu/lib/libcxxabi/Makefile b/gnu/lib/libcxxabi/Makefile
new file mode 100644
index 00000000000..e55ff595da1
--- /dev/null
+++ b/gnu/lib/libcxxabi/Makefile
@@ -0,0 +1,107 @@
+# $OpenBSD: Makefile,v 1.1 2021/01/02 20:04:36 patrick Exp $
+
+.include <bsd.own.mk>
+
+.if ${COMPILER_VERSION:L} != "clang"
+CC= clang
+CXX= clang++
+.endif
+
+.if ${BUILD_CLANG:L} == "yes"
+
+HDRDIR= ${.CURDIR}/../../../lib/libcxxabi/include
+SRCDIR= ${.CURDIR}/../../../lib/libcxxabi/src
+SHDRDIR= ${.CURDIR}/../../../lib/libcxx/include
+UHDRDIR= ${.CURDIR}/../../../gnu/llvm/libunwind/include
+CXXINCLUDEDIR= /usr/include/c++/v1
+
+.PATH: ${SRCDIR} ${.CURDIR}/../../../gnu/llvm/libunwind/src
+
+LIB= c++abi
+
+
+SRCS+= abort_message.cpp \
+ cxa_aux_runtime.cpp \
+ cxa_default_handlers.cpp \
+ cxa_demangle.cpp \
+ cxa_exception.cpp \
+ cxa_exception_storage.cpp \
+ cxa_guard.cpp \
+ cxa_handlers.cpp \
+ cxa_personality.cpp \
+ cxa_thread_atexit.cpp \
+ cxa_unexpected.cpp \
+ cxa_vector.cpp \
+ cxa_virtual.cpp \
+ fallback_malloc.cpp \
+ private_typeinfo.cpp \
+ stdlib_exception.cpp \
+ stdlib_new_delete.cpp \
+ stdlib_stdexcept.cpp \
+ stdlib_typeinfo.cpp \
+ Unwind-EHABI.cpp \
+ Unwind-sjlj.c \
+ UnwindLevel1-gcc-ext.c \
+ UnwindLevel1.c \
+ UnwindRegistersRestore.S \
+ UnwindRegistersSave.S \
+ libunwind.cpp
+
+CPPFLAGS+= -Wall -I${SHDRDIR} -I${HDRDIR} -I${UHDRDIR}
+CPPFLAGS+= -D_LIBUNWIND_IS_NATIVE_ONLY
+CPPFLAGS+= -D_LIBCXXABI_BUILDING_LIBRARY
+CPPFLAGS+= -DNDEBUG
+CFLAGS+= -nostdlib -funwind-tables
+CXXFLAGS+= -nostdlib -nostdinc++ -funwind-tables
+.if empty(CXXFLAGS:M-std=*)
+CXXFLAGS+= -std=c++11
+.endif
+
+STD_HEADERS= cxxabi.h \
+ __cxxabi_config.h
+
+.for hdr in ${STD_HEADERS}
+STD+= ${hdr} ${HDRDIR}/${hdr}
+.endfor
+STDDIR= ${CXXINCLUDEDIR}
+
+STD_UHEADERS= libunwind.h \
+ __libunwind_config.h \
+ unwind.h
+
+.for hdr in ${STD_UHEADERS}
+USTD+= ${hdr} ${UHDRDIR}/${hdr}
+.endfor
+USTDDIR= ${CXXINCLUDEDIR}
+
+MACHO_HEADERS=compact_unwind_encoding.h
+
+.for hdr in ${MACHO_HEADERS}
+MACHO+= ${hdr} ${UHDRDIR}/mach-o/${hdr}
+.endfor
+MACHODIR= ${CXXINCLUDEDIR}/mach-o
+
+includes:
+ @echo installing ${STD_HEADERS}
+ ${INSTALL} -d -m 755 ${DESTDIR}/${STDDIR};
+. for hdr src in ${STD}
+ cmp -s ${src} ${DESTDIR}/${STDDIR}/${hdr} || \
+ ${INSTALL} ${INSTALL_COPY} -m 444 ${src} ${DESTDIR}/${STDDIR}/${hdr};
+. endfor
+ ${INSTALL} -d -m 755 ${DESTDIR}/${USTDDIR};
+. for hdr src in ${USTD}
+ cmp -s ${src} ${DESTDIR}/${USTDDIR}/${hdr} || \
+ ${INSTALL} ${INSTALL_COPY} -m 444 ${src} ${DESTDIR}/${USTDDIR}/${hdr};
+. endfor
+ ${INSTALL} -d -m 755 ${DESTDIR}/${MACHODIR};
+. for hdr src in ${MACHO}
+ cmp -s ${src} ${DESTDIR}/${MACHODIR}/${hdr} || \
+ ${INSTALL} ${INSTALL_COPY} -m 444 ${src} ${DESTDIR}/${MACHODIR}/${hdr};
+. endfor
+
+.include <bsd.lib.mk>
+
+.else
+NOPROG=
+.include <bsd.prog.mk>
+.endif
diff --git a/gnu/lib/libcxxabi/shlib_version b/gnu/lib/libcxxabi/shlib_version
new file mode 100644
index 00000000000..9b77ea1766d
--- /dev/null
+++ b/gnu/lib/libcxxabi/shlib_version
@@ -0,0 +1,3 @@
+# Don't forget to give libc++ the same type of bump!
+major=4
+minor=0