Browse Source

boost: Package Version Update (1.71.0) + bugfixes

This commit updates Boost to version 1.71.0 and disables Boost.Context
 for arc and mips64 architectures, since either jump_fcontext or
 getcontext are undefined for those architectures.

It also fixes a bug were Boost.Fiber was not properly disabled for
mips32 and mips64 architectures.

Boost.Coroutine2 option was removed since it was redundant. By selecting
the Coroutine package, Coroutine2 is also installed.

Boost.Fiber has been disabled for target brcm47xx_generic and brcm47xx_legacy
due to misssing opcode support from instruction set.

Boost 1.71.0 brings a new header-only library
 - Boost.Variant2 [1]
   -> A never-valueless, strong guarantee implementation of
      std::variant, from Peter Dimov.

More info about Boost 1.71.0 can be found at the usual place [2].

[1]: https://www.boost.org/doc/libs/1_71_0/libs/variant2/doc/html/variant2.html
[2]: https://www.boost.org/users/history/version_1_71_0.html

Signed-off-by: Carlos Miguel Ferreira <carlosmf.pt@gmail.com>
lilik-openwrt-22.03
Carlos Miguel Ferreira 5 years ago
parent
commit
0cd9824623
No known key found for this signature in database GPG Key ID: 33A82DFF65092E55
5 changed files with 124 additions and 176 deletions
  1. +53
    -59
      libs/boost/Makefile
  2. +0
    -0
      libs/boost/patches/001-uclibc-asio.patch
  3. +71
    -0
      libs/boost/patches/002-utime-filesystem.patch
  4. +0
    -117
      libs/boost/patches/100-fix-apply_visitor-on-lvalue-variant.patch
  5. +0
    -0
      libs/boost/patches/101-uclibc-ng-math.patch

+ 53
- 59
libs/boost/Makefile View File

@ -11,13 +11,13 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=boost
PKG_VERSION:=1.70.0
PKG_SOURCE_VERSION:=1_70_0
PKG_RELEASE:=7
PKG_VERSION:=1.71.0
PKG_SOURCE_VERSION:=1_71_0
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)_$(PKG_SOURCE_VERSION).tar.bz2
PKG_SOURCE_URL:=@SF/$(PKG_NAME)/$(PKG_NAME)/$(PKG_VERSION) https://dl.bintray.com/boostorg/release/$(PKG_VERSION)/source/
PKG_HASH:=430ae8354789de4fd19ee52f3b1f739e1fba576f0aded0897c3c2bc00fb38778
PKG_HASH:=d73a8da01e8bf8c7eda40b4c84915071a8c8a0df4a6734537ddde4a8580524ee
PKG_MAINTAINER:=Carlos M. Ferreira <carlosmf.pt@gmail.com>
PKG_LICENSE:=BSL-1.0
@ -26,6 +26,7 @@ PKG_LICENSE_FILES:=LICENSE_1_0.txt
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)_$(PKG_SOURCE_VERSION)
HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/$(PKG_NAME)_$(PKG_SOURCE_VERSION)
HOST_BUILD_PARALLEL:=1
PKG_BUILD_PARALLEL:=1
PKG_USE_MIPS16:=0
@ -41,32 +42,20 @@ define Package/boost/Default
endef
define Package/boost/description
This package provides the Boost v1.70.0 libraries.
This package provides the Boost v1.71.0 libraries.
Boost is a set of free, peer-reviewed, portable C++ source libraries.
-----------------------------------------------------------------------------
| Warning |
| In order to build all of the Boost Libraries, it is necessary |
| to use, at least, GCC version 5 (C++14 support) and, it is necessary to |
| compile the kernel with Full Language Support. |
| Without these requirerements, the following libs will not be available: |
| - Boost.Locale |
| - Boost.Coroutine2 (header-only library - requires C++11) |
| - Boost.Fiber (requires C++14) |
-----------------------------------------------------------------------------
This package provides the following run-time libraries:
- atomic
- chrono
- container
- context
- contract
- coroutine (Deprecated - use Coroutine2)
- - coroutine2 (Requires GCC v5 and up)
- coroutine and coroutine2 (Coroutine is deprecated - use Coroutine2)
- date_time
- exception
- filesystem
- fiber (Requires GCC v5 and up)
- fiber
- graph
- - graph-parallel
- iostreams
@ -87,7 +76,7 @@ This package provides the following run-time libraries:
- wave
There are many more header-only libraries supported by Boost.
See more at http://www.boost.org/doc/libs/1_70_0/
See more at http://www.boost.org/doc/libs/1_71_0/
endef
PKG_BUILD_DEPENDS:=boost/host PACKAGE_python:python PACKAGE_python3:python3
@ -127,6 +116,22 @@ define Package/boost
endef
define Package/boost/config
# Invisible config dependency
config boost-context-exclude
bool
default y if (mips64 || arc || arc700)
default n
config boost-coroutine-exclude
bool
default y if boost-context-exclude
default n
config boost-fiber-exclude
bool
default y if (TARGET_brcm47xx_generic || TARGET_brcm47xx_legacy || mips32 || mips64 || boost-coroutine-exclude)
default n
menu "Select Boost Options"
depends on PACKAGE_boost
comment "Boost compilation options."
@ -199,11 +204,11 @@ define Package/boost/config
bool "Shared"
config boost-runtime-static
depends on !boost-shared-libs&&!boost-static-and-shared-libs
depends on (!boost-shared-libs && !boost-static-and-shared-libs)
bool "Static"
config boost-runtime-static-and-shared
depends on boost-use-name-tags&&!boost-shared-libs&&!boost-static-and-shared-libs
depends on (boost-use-name-tags && !boost-shared-libs && !boost-static-and-shared-libs)
bool "Both"
endchoice
@ -263,29 +268,17 @@ define Package/boost/config
default m if ALL
select PACKAGE_boost-libs
select boost-test-pkg
select boost-coroutine2
select boost-graph-parallel
# Invisible config dependency
config boost-fiber-exclude
bool
default y if (CPU_TYPE=mips32 || CPU_TYPE=mips64)
config boost-test-pkg
bool "Boost test package."
default m if ALL
select PACKAGE_boost-test
config boost-coroutine2
depends on !GCC_VERSION_4_8
bool "Boost couroutine2 support."
select PACKAGE_boost-coroutine
default n
config boost-graph-parallel
bool "Boost parallel graph support."
select PACKAGE_boost-graph
default n
default m if ALL
$(foreach lib,$(BOOST_LIBS), \
config PACKAGE_boost-$(lib)
@ -293,10 +286,11 @@ define Package/boost/config
default m if ALL
$(if $(findstring locale,$(lib)),depends on BUILD_NLS,)\
$(if $(findstring python,$(lib)),depends on PACKAGE_$(lib),)\
$(if $(findstring fiber,$(lib)),depends on (CPU_TYPE!=mips32 && CPU_TYPE!=mips64),)
$(if $(findstring fiber,$(lib)),depends on !boost-fiber-exclude,)\
$(if $(findstring context,$(lib)),depends on !boost-context-exclude,)
$(if $(findstring coroutine,$(lib)),depends on !boost-coroutine-exclude,)
)
endmenu
endef
PKG_CONFIG_DEPENDS:= CONFIG_PACKAGE_boost-test
@ -334,35 +328,35 @@ define DefineBoostLibrary
endef
endef
$(eval $(call DefineBoostLibrary,atomic,system,))
$(eval $(call DefineBoostLibrary,chrono,system,))
$(eval $(call DefineBoostLibrary,container,,))
$(eval $(call DefineBoostLibrary,context,chrono system thread,))
$(eval $(call DefineBoostLibrary,contract,system,))
$(eval $(call DefineBoostLibrary,coroutine,system chrono context thread,))
$(eval $(call DefineBoostLibrary,date_time,,))
$(eval $(call DefineBoostLibrary,atomic,system))
$(eval $(call DefineBoostLibrary,chrono,system))
$(eval $(call DefineBoostLibrary,container))
$(eval $(call DefineBoostLibrary,context,chrono system thread,,!boost-context-exclude))
$(eval $(call DefineBoostLibrary,contract,system))
$(eval $(call DefineBoostLibrary,coroutine,system chrono context thread,,!boost-coroutine-exclude))
$(eval $(call DefineBoostLibrary,date_time))
#$(eval $(call DefineBoostLibrary,exception,,))
$(eval $(call DefineBoostLibrary,fiber,coroutine filesystem,,!boost-fiber-exclude))
$(eval $(call DefineBoostLibrary,filesystem,system,))
$(eval $(call DefineBoostLibrary,graph,regex,))
$(eval $(call DefineBoostLibrary,filesystem,system))
$(eval $(call DefineBoostLibrary,graph,regex))
$(eval $(call DefineBoostLibrary,iostreams,,+zlib +liblzma +libbz2 +zstd))
$(eval $(call DefineBoostLibrary,locale,system,$(ICONV_DEPENDS),BUILD_NLS))
$(eval $(call DefineBoostLibrary,log,system chrono date_time thread filesystem regex,))
$(eval $(call DefineBoostLibrary,math,,))
$(eval $(call DefineBoostLibrary,log,system chrono date_time thread filesystem regex))
$(eval $(call DefineBoostLibrary,math))
#$(eval $(call DefineBoostLibrary,mpi,,)) # OpenMPI does no exist in OpenWRT at this time.
$(eval $(call DefineBoostLibrary,program_options,,))
$(eval $(call DefineBoostLibrary,program_options))
$(eval $(call DefineBoostLibrary,python,,,PACKAGE_python))
$(eval $(call DefineBoostLibrary,python3,,,PACKAGE_python3))
$(eval $(call DefineBoostLibrary,random,system,))
$(eval $(call DefineBoostLibrary,regex,,))
$(eval $(call DefineBoostLibrary,serialization,,))
$(eval $(call DefineBoostLibrary,wserialization,serialization,))
$(eval $(call DefineBoostLibrary,stacktrace,,))
$(eval $(call DefineBoostLibrary,system,,))
$(eval $(call DefineBoostLibrary,thread,system chrono atomic,))
$(eval $(call DefineBoostLibrary,random,system))
$(eval $(call DefineBoostLibrary,regex))
$(eval $(call DefineBoostLibrary,serialization))
$(eval $(call DefineBoostLibrary,wserialization,serialization))
$(eval $(call DefineBoostLibrary,stacktrace))
$(eval $(call DefineBoostLibrary,system))
$(eval $(call DefineBoostLibrary,thread,system chrono atomic))
$(eval $(call DefineBoostLibrary,timer,chrono))
$(eval $(call DefineBoostLibrary,type_erasure,chrono system thread,))
$(eval $(call DefineBoostLibrary,wave,date_time thread filesystem,))
$(eval $(call DefineBoostLibrary,type_erasure,chrono system thread))
$(eval $(call DefineBoostLibrary,wave,date_time thread filesystem))
include $(INCLUDE_DIR)/host-build.mk
@ -513,7 +507,7 @@ endef
define Host/Install
$(INSTALL_DIR) $(STAGING_DIR_HOSTPKG)/bin
$(CP) $(HOST_BUILD_DIR)/tools/build/src/engine/bin.*/b2 $(STAGING_DIR_HOSTPKG)/bin/
$(CP) $(HOST_BUILD_DIR)/tools/build/src/engine/b2 $(STAGING_DIR_HOSTPKG)/bin/
endef
define Package/boost/Default/install


libs/boost/patches/010-uclibc-ng.patch → libs/boost/patches/001-uclibc-asio.patch View File


+ 71
- 0
libs/boost/patches/002-utime-filesystem.patch View File

@ -0,0 +1,71 @@
From 83b989ecee478be083db8dc0cc7a5387615bd3cb Mon Sep 17 00:00:00 2001
From: Andrey Semashev <andrey.semashev@gmail.com>
Date: Wed, 31 Jul 2019 16:28:05 +0300
Subject: [PATCH] Added support for utimensat for better POSIX.1-2008
compliance.
POSIX.1-2008 marks utime as obsolete and replaces it with utimensat.
uClibc-ng has an option for removing utime, including the corresponding
header.
Closes https://github.com/boostorg/filesystem/pull/115.
---
libs/filesystem/src/operations.cpp | 24 ++++++++++++++++++++++--
1 file changed, 22 insertions(+), 2 deletions(-)
diff --git a/src/operations.cpp b/src/operations.cpp
index 9bba1cf7a..038109d35 100644
--- a/libs/filesystem/src/operations.cpp
+++ b/libs/filesystem/src/operations.cpp
@@ -62,7 +62,7 @@
#endif
#ifndef _POSIX_PTHREAD_SEMANTICS
-# define _POSIX_PTHREAD_SEMANTICS // Sun readdir_r()needs this
+# define _POSIX_PTHREAD_SEMANTICS // Sun readdir_r() needs this
#endif
#include <boost/filesystem/operations.hpp>
@@ -119,7 +119,9 @@ using std::wstring;
# include <dirent.h>
# include <unistd.h>
# include <fcntl.h>
-# include <utime.h>
+# if _POSIX_C_SOURCE < 200809L
+# include <utime.h>
+# endif
# include "limits.h"
# else // BOOST_WINDOW_API
@@ -1451,6 +1453,22 @@ namespace detail
system::error_code* ec)
{
# ifdef BOOST_POSIX_API
+# if _POSIX_C_SOURCE >= 200809L
+
+ struct timespec times[2] = {};
+
+ // Keep the last access time unchanged
+ times[0].tv_nsec = UTIME_OMIT;
+
+ times[1].tv_sec = new_time;
+
+ if (BOOST_UNLIKELY(::utimensat(AT_FDCWD, p.c_str(), times, 0) != 0))
+ {
+ error(BOOST_ERRNO, p, ec, "boost::filesystem::last_write_time");
+ return;
+ }
+
+# else // _POSIX_C_SOURCE >= 200809L
struct stat path_stat;
if (error(::stat(p.c_str(), &path_stat)!= 0,
@@ -1462,6 +1480,8 @@ namespace detail
error(::utime(p.c_str(), &buf)!= 0 ? BOOST_ERRNO : 0,
p, ec, "boost::filesystem::last_write_time");
+# endif // _POSIX_C_SOURCE >= 200809L
+
# else
handle_wrapper hw(

+ 0
- 117
libs/boost/patches/100-fix-apply_visitor-on-lvalue-variant.patch View File

@ -1,117 +0,0 @@
From cbdb354a274c8ab51a15dd43eafd02c2b6a576f0 Mon Sep 17 00:00:00 2001
From: Edward Catmur <edward.catmur@mavensecurities.com>
Date: Wed, 17 Apr 2019 15:05:37 +0100
Subject: [PATCH 1/2] Copy variant cvref when determining result type
Ensures that we can e.g. call apply_visitor on a lvalue variant
---
boost/variant/detail/apply_visitor_unary.hpp | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
--- a/boost/variant/detail/apply_visitor_unary.hpp
+++ b/boost/variant/detail/apply_visitor_unary.hpp
@@ -23,6 +23,7 @@
# include <boost/mpl/size.hpp>
# include <boost/utility/declval.hpp>
# include <boost/core/enable_if.hpp>
+# include <boost/type_traits/copy_cv_ref.hpp>
# include <boost/type_traits/remove_reference.hpp>
# include <boost/variant/detail/has_result_type.hpp>
#endif
@@ -85,7 +86,7 @@ namespace detail { namespace variant {
// This class serves only metaprogramming purposes. none of its methods must be called at runtime!
template <class Visitor, class Variant>
struct result_multideduce1 {
- typedef typename Variant::types types;
+ typedef typename remove_reference<Variant>::type::types types;
typedef typename boost::mpl::begin<types>::type begin_it;
typedef typename boost::mpl::advance<
begin_it, boost::mpl::int_<boost::mpl::size<types>::type::value - 1>
@@ -95,14 +96,14 @@ struct result_multideduce1 {
struct deduce_impl {
typedef typename boost::mpl::next<It>::type next_t;
typedef typename boost::mpl::deref<It>::type value_t;
- typedef decltype(true ? boost::declval< Visitor& >()( boost::declval< value_t >() )
+ typedef decltype(true ? boost::declval< Visitor& >()( boost::declval< copy_cv_ref_t< value_t, Variant > >() )
: boost::declval< typename deduce_impl<next_t>::type >()) type;
};
template <class Dummy>
struct deduce_impl<last_it, Dummy> {
typedef typename boost::mpl::deref<last_it>::type value_t;
- typedef decltype(boost::declval< Visitor& >()( boost::declval< value_t >() )) type;
+ typedef decltype(boost::declval< Visitor& >()( boost::declval< copy_cv_ref_t< value_t, Variant > >() )) type;
};
typedef typename deduce_impl<begin_it>::type type;
@@ -132,7 +133,7 @@ inline decltype(auto) apply_visitor(Visi
boost::detail::variant::has_result_type<Visitor>
>::type* = 0)
{
- boost::detail::variant::result_wrapper1<Visitor, typename remove_reference<Visitable>::type> cpp14_vis(::boost::forward<Visitor>(visitor));
+ boost::detail::variant::result_wrapper1<Visitor, Visitable> cpp14_vis(::boost::forward<Visitor>(visitor));
return ::boost::forward<Visitable>(visitable).apply_visitor(cpp14_vis);
}
--- a/libs/variant/test/const_ref_apply_visitor.cpp
+++ b/libs/variant/test/const_ref_apply_visitor.cpp
@@ -217,6 +217,44 @@ void test_cpp14_visitor(const variant_ty
#endif
}
+void test_cpp14_visitor(variant_type& test_var)
+{
+ std::cout << "Testing lvalue visitable for c++14\n";
+
+ BOOST_TEST(boost::apply_visitor([](auto& v) { return lvalue_rvalue_detector()(v); }, test_var) == "lvalue reference");
+}
+
+void test_cpp14_mutable_visitor(variant_type& test_var)
+{
+ std::cout << "Testing lvalue visitable for c++14 with inline mutable lambda\n";
+
+ BOOST_TEST(boost::apply_visitor([](auto& v) mutable -> auto { return lvalue_rvalue_detector()(v); }, test_var) == "lvalue reference");
+}
+
+void test_cpp14_visitor(variant_type& test_var, variant_type& test_var2)
+{
+ std::cout << "Testing lvalue visitable for c++14\n";
+
+ BOOST_TEST(boost::apply_visitor([](auto& v, auto& vv) { return lvalue_rvalue_detector()(v, vv); }, test_var, test_var2)
+ == "lvalue reference, lvalue reference");
+}
+
+void test_cpp14_visitor(variant_type& test_var, variant_type& test_var2, variant_type& test_var3)
+{
+#if !defined(BOOST_VARIANT_DO_NOT_USE_VARIADIC_TEMPLATES) && !defined(BOOST_NO_CXX11_HDR_TUPLE)
+ std::cout << "Testing lvalue visitable for c++14\n";
+
+ auto result = boost::apply_visitor([](auto& v, auto& t, auto& p) { return lvalue_rvalue_detector()(v, t, p); },
+ test_var, test_var2, test_var3);
+ std::cout << "result: " << result << std::endl;
+ BOOST_TEST(result == "lvalue reference, lvalue reference, lvalue reference");
+#else
+ (void)test_var;
+ (void)test_var2;
+ (void)test_var3;
+#endif
+}
+
void test_cpp14_visitor(variant_type&& test_var)
{
std::cout << "Testing rvalue visitable for c++14\n";
@@ -333,8 +371,14 @@ void run_cpp14_mixed_tests()
void run_cpp14_tests()
{
#ifndef BOOST_NO_CXX14_DECLTYPE_AUTO
+ variant_type const c1(10), c2(20), c3(30);
variant_type v1(10), v2(20), v3(30);
+ test_cpp14_visitor(c1);
+ test_cpp14_mutable_visitor(c1);
+ test_cpp14_visitor(c2, c3);
+ test_cpp14_visitor(c1, c2, c3);
+
test_cpp14_visitor(v1);
test_cpp14_mutable_visitor(v1);
test_cpp14_visitor(v2, v3);

libs/boost/patches/uclibc-ng-2.patch → libs/boost/patches/101-uclibc-ng-math.patch View File


Loading…
Cancel
Save