boost: Update to 1.70.0

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
This commit is contained in:
Michael Tremer 2019-06-24 14:03:24 +01:00
parent 10c7dfd8b1
commit 5194fdec46
13 changed files with 15 additions and 660 deletions

View File

@ -5,10 +5,10 @@
name = boost
ver_major = 1
ver_minor = 60
ver_minor = 70
ver_plevel = 0
version = %{ver_major}.%{ver_minor}.%{ver_plevel}
release = 2
release = 1
groups = System/Libraries
url = http://www.boost.org/
@ -43,23 +43,27 @@ build
# Obtain python3 abiflags.
python3_abiflags = %(python3-config --abiflags)
CFLAGS += -I/usr/include/python%{python3_version}%{python3_abiflags}
CXXFLAGS += -I/usr/include/python%{python3_version}%{python3_abiflags}
# Don't build in parallel on any architecture.
# The C++ compiles consumes too much memory, so
# we cannot run multiple instances at once.
PARALLELISMFLAGS = -j2
configure_options = \
--layout=tagged \
--without-mpi \
--without-graph_parallel \
--layout=system \
--build-dir=serial \
\
cflags="%{CFLAGS}" \
cxxflags="%{CXXFLAGS}" \
linkflags="%{LDFLAGS}" \
variant=release \
threading=single,multi \
threading=multi \
runtime-link=shared \
link=shared,static \
debug-symbols=on \
python=%{python_version} \
python=%{python3_version} \
pch=off
# Get python3 abi flags.
@ -70,13 +74,11 @@ build
mkdir -pv %{DIR_APP}/serial
# Bootstrap build environment.
./bootstrap.sh --with-toolset=gcc --with-icu
./bootstrap.sh --with-toolset=gcc --with-icu \
--with-python=%{python3}
# Enable boost lib for python3.
cat >> ./tools/build/src/user-config.jam << EOF
using python : %{python_version} : %{python2} : %{includedir}/python%{python_version} : : : : ;
using python : %{python3_version} : %{python3} : %{includedir}/python%{python3_version}%{python3_abiflags} : : : : %{python3_abiflags} ;
EOF
# Support for OpenMPI
echo "using mpi ;" >> project-config.jam
end
build

View File

@ -1,150 +0,0 @@
diff --git a/tools/build/v2/doc/bjam.1 b/tools/build/v2/doc/bjam.1
new file mode 100644
index 0000000..8a44af6
--- /dev/null
+++ b/tools/build/v2/doc/bjam.1
@@ -0,0 +1,144 @@
+.TH "bjam" 1 "Sat Nov 19 2011" "Doxygen" \" -*- nroff -*-
+.ad l
+.nh
+.SH NAME
+bjam \- Command-line utility to build Boost-related C++ projects with Boost\&.Build
+.SH "SYNOPSIS"
+.PP
+\fBbjam\fP \fC[-a] [-dx] [-fx] [-jx] [-lx] [-n] [-ox] [-px] [-q] [-sx=y] [-tx] [-v] [--x]\fP
+.PP
+\fIbjam\fP accepts the following options:
+.PP
+\fB-a\fP
+.br
+ Build all targets, even if they are current
+.PP
+\fB-dx\fP
+.br
+ Set the debug level to x (0-9)
+.PP
+\fB-fx\fP
+.br
+ Read x instead of Jambase
+.PP
+\fB-jx\fP
+.br
+ Run up to x shell commands concurrently
+.PP
+\fB-lx\fP
+.br
+ Limit actions to x number of seconds after which they are stopped
+.PP
+\fB-n\fP
+.br
+ Don't actually execute the updating actions
+.PP
+\fB-ox\fP
+.br
+ Write the updating actions to file x
+.PP
+\fB-px\fP
+.br
+ x=0, pipes action stdout and stderr merged into action output
+.PP
+\fB-q\fP
+.br
+ Quit quickly as soon as a target fails
+.PP
+\fB-sx=y\fP
+.br
+ Set variable x=y, overriding environment
+.PP
+\fB-tx\fP
+.br
+ Rebuild x, even if it is up-to-date
+.PP
+\fB-v\fP
+.br
+ Print the version of jam and exit
+.PP
+\fB--x\fP
+.br
+ Option is ignored
+.SH "DESCRIPTION"
+.PP
+This section provides the information necessary to create your own projects using \fIBoost\&.Build\fP The information provided here is relatively high-level, and Chapter 6, Reference as well as the on-line help system must be used to obtain low-level documentation (see --help)
+.PP
+\fIBoost\&.Build\fP actually consists of two parts - \fIBoost\&.Jam\fP, a build engine with its own interpreted language, and \fIBoost\&.Build\fP itself, implemented in \fIBoost\&.Jam's\fP language\&. The chain of events when you type bjam on the command line is as follows:
+.IP "\(bu" 2
+\fIBoost\&.Jam\fP tries to find \fIBoost\&.Build\fP and loads the top-level module\&. The exact process is described in the section called “Initialization”
+.PP
+.PP
+.IP "\(bu" 2
+The top-level module loads user-defined configuration files, \fIuser-config\&.jam\fP and \fIsite-config\&.jam\fP, which define available toolsets
+.PP
+.PP
+.IP "\(bu" 2
+The \fIJamfile\fP in the current directory is read That in turn might cause reading of further Jamfiles\&. As a result, a tree of projects is created, with targets inside projects
+.PP
+.PP
+.IP "\(bu" 2
+Finally, using the build request specified on the command line, \fIBoost\&.Build\fP decides which targets should be built and how\&. That information is passed back to \fIBoost\&.Jam\fP, which takes care of actually running the scheduled build action commands
+.PP
+.PP
+So, to be able to successfully use \fIBoost\&.Build\fP, you need to know only four things:
+.IP "\(bu" 2
+How to configure \fIBoost\&.Build\fP (http://www.boost.org/boost-build2/doc/html/bbv2/overview/configuration.html)
+.IP "\(bu" 2
+How to declare targets in Jamfiles (http://www.boost.org/boost-build2/doc/html/bbv2/overview/targets.html)
+.IP "\(bu" 2
+How the build process works (http://www.boost.org/boost-build2/doc/html/bbv2/overview/build_process.html)
+.PP
+.PP
+Some Basics about the \fIBoost\&.Jam\fP language\&. See the section called “Boost\&.Jam Language” (http://www.boost.org/boost-build2/doc/html/bbv2/overview/jam_language.html)
+.SH "CONCEPTS"
+.PP
+\fIBoost\&.Build\fP has a few unique concepts that are introduced in this section\&. The best way to explain the concepts is by comparison with more classical build tools
+.PP
+When using any flavour of make, you directly specify targets and commands that are used to create them from other target\&. The below example creates a\&.o from a\&.c using a hardcoded compiler invocation command
+.PP
+a\&.o: a\&.c
+.br
+ g++ -o a\&.o -g a\&.c
+.PP
+This is rather low-level description mechanism and it is hard to adjust commands, options, and sets of created targets depending on the used compiler and operating system\&.
+.PP
+To improve portability, most modern build system provide a set of higher-level functions that can be used in build description files\&. Consider this example:
+.PP
+add_program ('a', 'a\&.c')
+.br
+.PP
+This is a function call that creates targets necessary to create executable file from source file a\&.c\&. Depending on configured properties, different commands line may be used\&. However, \fIadd_program\fP is higher-level, but rather thin level All targets are created immediately when build description is parsed, which makes it impossible to perform multi-variant builds\&. Often, change in any build property requires complete reconfiguration of the build tree
+.PP
+In order to support true multivariant builds, Boost\&.Build introduces the concept of metatarget—object that is created when build description is parsed and can be later called with specific build properties to generate actual targets
+.PP
+Consider an example:
+.PP
+exe a : a\&.cpp ;
+.br
+.PP
+When this declaration is parsed, \fIBoost\&.Build\fP creates a metatarget, but does not yet decides what files must be created, or what commands must be used\&. After all build files are parsed, Boost\&.Build considers properties requested on the command line\&. Supposed you have invoked \fIBoost\&.Build\fP with:
+.PP
+\fIbjam\fP toolset=gcc toolset=msvc
+.br
+.PP
+In that case, the metatarget will be called twice, once with toolset=gcc and once with toolset=msvc\&. Both invocations will produce concrete targets, that will have different extensions and use different command lines\&. Another key concept is build property\&. Build property is a variable that affects the build process\&. It can be specified on the command line, and is passed when calling a metatarget
+.PP
+While all build tools have a similar mechanism, \fIBoost\&.Build\fP differs by requiring that all build properties are declared in advance, and providing a large set of properties with portable semantics
+.PP
+The final concept is property propagation\&. Boost\&.Build does not require that every metatarget is called with the same properties\&. Instead, the 'top-level' metatargets are called with the properties specified on the command line Each metatarget can elect to augment or override some properties (in particular, using the requirements mechanism, see the section called “Requirements”: http://www.boost.org/boost-build2/doc/html/bbv2/overview/targets.html#bbv2.overview.targets.requirements) Then, the dependency metatargets are called with modified properties and produce concrete targets that are then used in build process Of course, dependency metatargets maybe in turn modify build properties and have dependencies of their own\&.
+.PP
+For more in-depth treatment of the requirements and concepts, you may refer to SYRCoSE 2009 Boost\&.Build article (http://syrcose.ispras.ru/2009/files/04_paper.pdf)\&.
+.SH "SEE ALSO"
+.PP
+\fBboost-libraries\fP(3)
+.SH "SUPPORT"
+.PP
+Please report any bugs to https://svn.boost.org/trac/boost/
+.SH "COPYRIGHT"
+.PP
+Boost Software License - Version 1\&.0 - August 17th, 2003
+.PP
+See the LICENSE_1_0\&.txt file for more information on that license, or directly on Internet:
+.br
+ http://www.boost.org/LICENSE_1_0.txt

View File

@ -1,22 +0,0 @@
diff --git a/libs/units/example/autoprefixes.cpp b/libs/units/example/autoprefixes.cpp
index 8b2bc43..d04f2fe 100644
--- a/libs/units/example/autoprefixes.cpp
+++ b/libs/units/example/autoprefixes.cpp
@@ -67,7 +67,7 @@ struct thing_base_unit : boost::units::base_unit<thing_base_unit, boost::units::
struct euro_base_unit : boost::units::base_unit<euro_base_unit, boost::units::dimensionless_type, 5>
{
static const char* name() { return("EUR"); }
- static const char* symbol() { return("€"); }
+ static const char* symbol() { return("€"); }
};
int main()
@@ -140,7 +140,7 @@ int main()
quantity<euro_base_unit::unit_type> ce = 2048. * euro_base_unit::unit_type();
cout << name_format << engineering_prefix << ce << endl; // 2.048 kiloEUR
- cout << symbol_format << engineering_prefix << ce << endl; // 2.048 k€
+ cout << symbol_format << engineering_prefix << ce << endl; // 2.048 kâ¬
return 0;

View File

@ -1,98 +0,0 @@
diff -up boost_1_55_0/libs/python/test/exec.cpp\~ boost_1_55_0/libs/python/test/exec.cpp
--- boost_1_55_0/libs/python/test/exec.cpp~ 2010-07-05 00:38:38.000000000 +0200
+++ boost_1_55_0/libs/python/test/exec.cpp 2015-01-09 21:31:12.903218280 +0100
@@ -56,6 +56,20 @@ void eval_test()
BOOST_TEST(value == "ABCDEFG");
}
+struct PyCtx
+{
+ PyCtx() {
+ Py_Initialize();
+ }
+
+ ~PyCtx() {
+ // N.B. certain problems may arise when Py_Finalize is called when
+ // using Boost.Python. However in this test suite it all seems to
+ // work fine.
+ Py_Finalize();
+ }
+};
+
void exec_test()
{
// Register the module with the interpreter
@@ -68,6 +82,8 @@ void exec_test()
) == -1)
throw std::runtime_error("Failed to add embedded_hello to the interpreter's "
"builtin modules");
+
+ PyCtx ctx;
// Retrieve the main module
python::object main = python::import("__main__");
@@ -148,41 +164,43 @@ void check_pyerr(bool pyerr_expected=fal
}
}
+template <class Cb>
+bool
+run_and_handle_exception(Cb cb, bool pyerr_expected = false)
+{
+ PyCtx ctx;
+ if (python::handle_exception(cb)) {
+ check_pyerr(pyerr_expected);
+ return true;
+ } else {
+ return false;
+ }
+}
+
int main(int argc, char **argv)
{
BOOST_TEST(argc == 2 || argc == 3);
std::string script = argv[1];
- // Initialize the interpreter
- Py_Initialize();
- if (python::handle_exception(eval_test)) {
- check_pyerr();
- }
- else if(python::handle_exception(exec_test)) {
- check_pyerr();
- }
- else if (python::handle_exception(boost::bind(exec_file_test, script))) {
+ // N.B. exec_test mustn't be called through run_and_handle_exception
+ // as it needs to handles the python context by itself.
+ if (run_and_handle_exception(eval_test)
+ || python::handle_exception(exec_test))
check_pyerr();
- }
-
- if (python::handle_exception(exec_test_error))
- {
- check_pyerr(/*pyerr_expected*/ true);
- }
else
- {
+ run_and_handle_exception(boost::bind(exec_file_test, script));
+
+ if (!run_and_handle_exception(exec_test_error, true))
BOOST_ERROR("Python exception expected, but not seen.");
- }
if (argc > 2) {
+ PyCtx ctx;
// The main purpose is to test compilation. Since this test generates
// a file and I (rwgk) am uncertain about the side-effects, run it only
// if explicitly requested.
exercise_embedding_html();
}
- // Boost.Python doesn't support Py_Finalize yet.
- // Py_Finalize();
return boost::report_errors();
}
Diff finished. Fri Jan 9 21:31:13 2015

View File

@ -1,48 +0,0 @@
diff -up ./tools/build/src/tools/gcc.jam~ ./tools/build/src/tools/gcc.jam
--- ./tools/build/src/tools/gcc.jam~ 2015-02-09 15:01:04.850331626 +0100
+++ ./tools/build/src/tools/gcc.jam 2015-02-09 15:44:29.122307134 +0100
@@ -366,17 +366,17 @@ generators.override gcc.compile.c++.pch
toolset.flags gcc.compile PCH_FILE <pch>on : <pch-file> ;
# Declare flags and action for compilation.
-toolset.flags gcc.compile OPTIONS <optimization>off : -O0 ;
-toolset.flags gcc.compile OPTIONS <optimization>speed : -O3 ;
-toolset.flags gcc.compile OPTIONS <optimization>space : -Os ;
+toolset.flags gcc.compile OPTIONS <optimization>off : ;
+toolset.flags gcc.compile OPTIONS <optimization>speed : ;
+toolset.flags gcc.compile OPTIONS <optimization>space : ;
-toolset.flags gcc.compile OPTIONS <inlining>off : -fno-inline ;
-toolset.flags gcc.compile OPTIONS <inlining>on : -Wno-inline ;
-toolset.flags gcc.compile OPTIONS <inlining>full : -finline-functions -Wno-inline ;
+toolset.flags gcc.compile OPTIONS <inlining>off : ;
+toolset.flags gcc.compile OPTIONS <inlining>on : ;
+toolset.flags gcc.compile OPTIONS <inlining>full : ;
-toolset.flags gcc.compile OPTIONS <warnings>off : -w ;
-toolset.flags gcc.compile OPTIONS <warnings>on : -Wall ;
-toolset.flags gcc.compile OPTIONS <warnings>all : -Wall -pedantic ;
+toolset.flags gcc.compile OPTIONS <warnings>off : ;
+toolset.flags gcc.compile OPTIONS <warnings>on : ;
+toolset.flags gcc.compile OPTIONS <warnings>all : ;
toolset.flags gcc.compile OPTIONS <warnings-as-errors>on : -Werror ;
toolset.flags gcc.compile OPTIONS <debug-symbols>on : -g ;
@@ -603,7 +603,7 @@ rule compile.fortran ( targets * : sourc
actions compile.c++ bind PCH_FILE
{
- "$(CONFIG_COMMAND)" $(LANG) -ftemplate-depth-$(TEMPLATE_DEPTH) $(OPTIONS) $(USER_OPTIONS) -D$(DEFINES) -I"$(PCH_FILE:D)" -I"$(INCLUDES)" -c -o "$(<:W)" "$(>:W)"
+ "$(CONFIG_COMMAND)" $(LANG) $(OPTIONS) $(USER_OPTIONS) -D$(DEFINES) -I"$(PCH_FILE:D)" -I"$(INCLUDES)" -c -o "$(<:W)" "$(>:W)"
}
actions compile.c bind PCH_FILE
@@ -613,7 +613,7 @@ actions compile.c bind PCH_FILE
actions compile.c++.preprocess bind PCH_FILE
{
- "$(CONFIG_COMMAND)" $(LANG) -ftemplate-depth-$(TEMPLATE_DEPTH) $(OPTIONS) $(USER_OPTIONS) -D$(DEFINES) -I"$(PCH_FILE:D)" -I"$(INCLUDES)" "$(>:W)" -E >"$(<:W)"
+ "$(CONFIG_COMMAND)" $(LANG) $(OPTIONS) $(USER_OPTIONS) -D$(DEFINES) -I"$(PCH_FILE:D)" -I"$(INCLUDES)" "$(>:W)" -E >"$(<:W)"
}
actions compile.c.preprocess bind PCH_FILE

View File

@ -1,31 +0,0 @@
diff -up boost_1_57_0/boost/mpl/print.hpp\~ boost_1_57_0/boost/mpl/print.hpp
--- boost_1_57_0/boost/mpl/print.hpp~ 2014-07-09 23:12:31.000000000 +0200
+++ boost_1_57_0/boost/mpl/print.hpp 2015-01-20 12:44:59.621400948 +0100
@@ -52,16 +52,15 @@ struct print
enum { n = sizeof(T) + -1 };
#elif defined(__MWERKS__)
void f(int);
-#else
- enum {
- n =
-# if defined(__EDG_VERSION__)
- aux::dependent_unsigned<T>::value > -1
-# else
- sizeof(T) > -1
-# endif
- };
-#endif
+#elif defined(__EDG_VERSION__)
+ enum { n = aux::dependent_unsigned<T>::value > -1 };
+#elif defined(BOOST_GCC)
+ enum { n1 };
+ enum { n2 };
+ enum { n = n1 != n2 };
+#else
+ enum { n = sizeof(T) > -1 };
+#endif
};
#if defined(BOOST_MSVC)
Diff finished. Tue Jan 20 12:45:03 2015

View File

@ -1,62 +0,0 @@
--- boost_1_57_0/tools/build/src/tools/python.jam 2013-05-21 06:14:18.000000000 +0200
+++ boost_1_55_0/tools/build/src/tools/python.jam 2014-05-29 19:09:12.115413877 +0200
@@ -94,7 +94,7 @@ feature.feature pythonpath : : free opti
# using python : 2.3 : /usr/local/bin/python ;
#
rule init ( version ? : cmd-or-prefix ? : includes * : libraries ?
- : condition * : extension-suffix ? )
+ : condition * : extension-suffix ? : abi-letters ? )
{
project.push-current $(.project) ;
@@ -107,7 +107,7 @@ rule init ( version ? : cmd-or-prefix ?
}
}
- configure $(version) : $(cmd-or-prefix) : $(includes) : $(libraries) : $(condition) : $(extension-suffix) ;
+ configure $(version) : $(cmd-or-prefix) : $(includes) : $(libraries) : $(condition) : $(extension-suffix) : $(abi-letters) ;
project.pop-current ;
}
@@ -653,7 +653,7 @@ local rule system-library-dependencies (
# Declare a target to represent Python's library.
#
-local rule declare-libpython-target ( version ? : requirements * )
+local rule declare-libpython-target ( version ? : requirements * : abi-letters ? )
{
# Compute the representation of Python version in the name of Python's
# library file.
@@ -677,13 +677,13 @@ local rule declare-libpython-target ( ve
}
# Declare it.
- lib python.lib : : <name>python$(lib-version) $(requirements) ;
+ lib python.lib : : <name>python$(lib-version)$(abi-letters) $(requirements) ;
}
# Implementation of init.
local rule configure ( version ? : cmd-or-prefix ? : includes * : libraries ? :
- condition * : extension-suffix ? )
+ condition * : extension-suffix ? : abi-letters ? )
{
local prefix ;
local exec-prefix ;
@@ -699,6 +699,7 @@ local rule configure ( version ? : cmd-o
extension-suffix ?= _d ;
}
extension-suffix ?= "" ;
+ abi-letters ?= "" ;
# Normalize and dissect any version number.
local major-minor ;
@@ -922,7 +923,7 @@ local rule configure ( version ? : cmd-o
}
else
{
- declare-libpython-target $(version) : $(target-requirements) ;
+ declare-libpython-target $(version) : $(target-requirements) : $(abi-letters) ;
# This is an evil hack. On, Windows, when Python is embedded, nothing
# seems to set up sys.path to include Python's standard library

View File

@ -1,13 +0,0 @@
Index: boost_1_57_0/tools/build/src/tools/python.jam
===================================================================
--- boost_1_57_0/tools/build/src/tools/python.jam (revision 50406)
+++ boost_1_57_0/tools/build/src/tools/python.jam (working copy)
@@ -994,7 +994,7 @@
else
{
alias python_for_extensions
- :
+ : python
: $(target-requirements)
:
: $(usage-requirements)

View File

@ -1,19 +0,0 @@
diff -up boost_1_57_0/boost/spirit/home/classic/core/non_terminal/impl/grammar.ipp\~ boost_1_57_0/boost/spirit/home/classic/core/non_terminal/impl/grammar.ipp
--- boost_1_57_0/boost/spirit/home/classic/core/non_terminal/impl/grammar.ipp~ 2014-10-13 12:21:40.000000000 +0200
+++ boost_1_57_0/boost/spirit/home/classic/core/non_terminal/impl/grammar.ipp 2015-01-20 13:25:50.069710766 +0100
@@ -282,12 +282,12 @@ struct grammar_definition
#if !defined(BOOST_SPIRIT_SINGLE_GRAMMAR_INSTANCE)
typedef impl::grammar_helper_base<GrammarT> helper_base_t;
typedef grammar_helper_list<GrammarT> helper_list_t;
- typedef typename helper_list_t::vector_t::reverse_iterator iterator_t;
helper_list_t& helpers =
grammartract_helper_list::do_(self);
# if defined(BOOST_INTEL_CXX_VERSION)
+ typedef typename helper_list_t::vector_t::reverse_iterator iterator_t;
for (iterator_t i = helpers.rbegin(); i != helpers.rend(); ++i)
(*i)->undefine(self);
# else
Diff finished. Tue Jan 20 13:25:53 2015

View File

@ -1,31 +0,0 @@
diff -up boost_1_58_0/libs/pool/test/Jamfile.v2\~ boost_1_58_0/libs/pool/test/Jamfile.v2
--- boost_1_57_0/libs/pool/test/Jamfile.v2~ 2015-07-17 11:36:16.362519826 +0100
+++ boost_1_57_0/libs/pool/test/Jamfile.v2 2015-07-17 11:37:38.858847388 +0100
@@ -28,17 +28,17 @@
local Werr = <toolset>gcc:<warnings-as-errors>on <toolset>msvc:<warnings-as-errors>on ;
test-suite pool :
- [ run test_simple_seg_storage.cpp : : : $(Werr) <toolset>msvc:<cxxflags>-wd4267 ]
- [ run test_pool_alloc.cpp : : : $(Werr) ]
- [ run pool_msvc_compiler_bug_test.cpp : : : $(Werr) <toolset>msvc:<cxxflags>-wd4512 ]
- [ run test_msvc_mem_leak_detect.cpp : : : $(Werr) ]
- [ run test_bug_3349.cpp : : : $(Werr) ]
- [ run test_bug_4960.cpp : : : $(Werr) ]
- [ run test_bug_1252.cpp : : : $(Werr) ]
- [ run test_bug_2696.cpp : : : $(Werr) ]
- [ run test_bug_5526.cpp : : : $(Werr) ]
+ [ run test_simple_seg_storage.cpp : : : $(Werr) <toolset>msvc:<cxxflags>-wd4267 <library>/boost/system//boost_system ]
+ [ run test_pool_alloc.cpp : : : $(Werr) <library>/boost/system//boost_system ]
+ [ run pool_msvc_compiler_bug_test.cpp : : : $(Werr) <toolset>msvc:<cxxflags>-wd4512 <library>/boost/system//boost_system ]
+ [ run test_msvc_mem_leak_detect.cpp : : : $(Werr) <library>/boost/system//boost_system ]
+ [ run test_bug_3349.cpp : : : $(Werr) <library>/boost/system//boost_system ]
+ [ run test_bug_4960.cpp : : : $(Werr) <library>/boost/system//boost_system ]
+ [ run test_bug_1252.cpp : : : $(Werr) <library>/boost/system//boost_system ]
+ [ run test_bug_2696.cpp : : : $(Werr) <library>/boost/system//boost_system ]
+ [ run test_bug_5526.cpp : : : $(Werr) <library>/boost/system//boost_system ]
[ run test_threading.cpp : : : <threading>multi <library>/boost/thread//boost_thread ]
- [ run ../example/time_pool_alloc.cpp : : : $(Werr) ]
+ [ run ../example/time_pool_alloc.cpp : : : $(Werr) <library>/boost/system//boost_system ]
[ compile test_poisoned_macros.cpp : $(Werr) ]
#

View File

@ -1,120 +0,0 @@
Index: boost/pool/pool.hpp
===================================================================
--- boost/pool/pool.hpp (revision 78317)
+++ boost/pool/pool.hpp (revision 78326)
@@ -27,4 +27,6 @@
#include <boost/pool/poolfwd.hpp>
+// std::numeric_limits
+#include <boost/limits.hpp>
// boost::integer::static_lcm
#include <boost/integer/common_factor_ct.hpp>
@@ -358,4 +360,11 @@
}
+ size_type max_chunks() const
+ { //! Calculated maximum number of memory chunks that can be allocated in a single call by this Pool.
+ size_type partition_size = alloc_size();
+ size_type POD_size = integer::static_lcm<sizeof(size_type), sizeof(void *)>::value + sizeof(size_type);
+ return (std::numeric_limits<size_type>::max() - POD_size) / alloc_size();
+ }
+
static void * & nextof(void * const ptr)
{ //! \returns Pointer dereferenced.
@@ -377,5 +388,7 @@
//! the first time that object needs to allocate system memory.
//! The default is 32. This parameter may not be 0.
- //! \param nmax_size is the maximum number of chunks to allocate in one block.
+ //! \param nmax_size is the maximum number of chunks to allocate in one block.
+ set_next_size(nnext_size);
+ set_max_size(nmax_size);
}
@@ -400,7 +413,7 @@
}
void set_next_size(const size_type nnext_size)
- { //! Set number of chunks to request from the system the next time that object needs to allocate system memory. This value should never be set to 0.
- //! \returns nnext_size.
- next_size = start_size = nnext_size;
+ { //! Set number of chunks to request from the system the next time that object needs to allocate system memory. This value should never be set to 0.
+ BOOST_USING_STD_MIN();
+ next_size = start_size = min BOOST_PREVENT_MACRO_SUBSTITUTION(nnext_size, max_chunks());
}
size_type get_max_size() const
@@ -410,5 +423,6 @@
void set_max_size(const size_type nmax_size)
{ //! Set max_size.
- max_size = nmax_size;
+ BOOST_USING_STD_MIN();
+ max_size = min BOOST_PREVENT_MACRO_SUBSTITUTION(nmax_size, max_chunks());
}
size_type get_requested_size() const
@@ -713,7 +727,7 @@
BOOST_USING_STD_MIN();
if(!max_size)
- next_size <<= 1;
+ set_next_size(next_size << 1);
else if( next_size*partition_size/requested_size < max_size)
- next_size = min BOOST_PREVENT_MACRO_SUBSTITUTION(next_size << 1, max_size*requested_size/ partition_size);
+ set_next_size(min BOOST_PREVENT_MACRO_SUBSTITUTION(next_size << 1, max_size * requested_size / partition_size));
// initialize it,
@@ -753,7 +767,7 @@
BOOST_USING_STD_MIN();
if(!max_size)
- next_size <<= 1;
+ set_next_size(next_size << 1);
else if( next_size*partition_size/requested_size < max_size)
- next_size = min BOOST_PREVENT_MACRO_SUBSTITUTION(next_size << 1, max_size*requested_size/ partition_size);
+ set_next_size(min BOOST_PREVENT_MACRO_SUBSTITUTION(next_size << 1, max_size * requested_size / partition_size));
// initialize it,
@@ -797,4 +811,6 @@
//! \returns Address of chunk n if allocated ok.
//! \returns 0 if not enough memory for n chunks.
+ if (n > max_chunks())
+ return 0;
const size_type partition_size = alloc_size();
@@ -845,7 +861,7 @@
BOOST_USING_STD_MIN();
if(!max_size)
- next_size <<= 1;
+ set_next_size(next_size << 1);
else if( next_size*partition_size/requested_size < max_size)
- next_size = min BOOST_PREVENT_MACRO_SUBSTITUTION(next_size << 1, max_size*requested_size/ partition_size);
+ set_next_size(min BOOST_PREVENT_MACRO_SUBSTITUTION(next_size << 1, max_size * requested_size / partition_size));
// insert it into the list,
Index: libs/pool/test/test_bug_6701.cpp
===================================================================
--- libs/pool/test/test_bug_6701.cpp (revision 78326)
+++ libs/pool/test/test_bug_6701.cpp (revision 78326)
@@ -0,0 +1,27 @@
+/* Copyright (C) 2012 Étienne Dupuis
+*
+* Use, modification and distribution is subject to the
+* Boost Software License, Version 1.0. (See accompanying
+* file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
+*/
+
+// Test of bug #6701 (https://svn.boost.org/trac/boost/ticket/6701)
+
+#include <boost/pool/object_pool.hpp>
+#include <boost/limits.hpp>
+
+int main()
+{
+ boost::pool<> p(1024, std::numeric_limits<size_t>::max() / 768);
+
+ void *x = p.malloc();
+ BOOST_ASSERT(!x);
+
+ BOOST_ASSERT(std::numeric_limits<size_t>::max() / 1024 >= p.get_next_size());
+ BOOST_ASSERT(std::numeric_limits<size_t>::max() / 1024 >= p.get_max_size());
+
+ void *y = p.ordered_malloc(std::numeric_limits<size_t>::max() / 768);
+ BOOST_ASSERT(!y);
+
+ return 0;
+}

View File

@ -1,32 +0,0 @@
commit 2f3b98e640c25fe45ae691a5aa950745380b983e
Author: Jonathan Wakely <jwakely@redhat.com>
Date: Mon Sep 14 15:05:24 2015 +0100
Do not qualify <fenv.h> names that might be macros.
diff --git a/include/boost/test/impl/execution_monitor.ipp b/include/boost/test/impl/execution_monitor.ipp
index 3a9e779..8b319df 100644
--- a/include/boost/test/impl/execution_monitor.ipp
+++ b/include/boost/test/impl/execution_monitor.ipp
@@ -1380,8 +1380,8 @@ enable( unsigned mask )
return ~old_cw & BOOST_FPE_ALL;
#elif defined(__GLIBC__) && defined(__USE_GNU) && !defined(BOOST_CLANG) && !defined(BOOST_NO_FENV_H)
- ::feclearexcept(BOOST_FPE_ALL);
- int res = ::feenableexcept( mask );
+ feclearexcept(BOOST_FPE_ALL);
+ int res = feenableexcept( mask );
return res == -1 ? (unsigned)BOOST_FPE_INV : (unsigned)res;
#else
/* Not Implemented */
@@ -1417,8 +1417,8 @@ disable( unsigned mask )
return ~old_cw & BOOST_FPE_ALL;
#elif defined(__GLIBC__) && defined(__USE_GNU) && !defined(BOOST_CLANG) && !defined(BOOST_NO_FENV_H)
- ::feclearexcept(BOOST_FPE_ALL);
- int res = ::fedisableexcept( mask );
+ feclearexcept(BOOST_FPE_ALL);
+ int res = fedisableexcept( mask );
return res == -1 ? (unsigned)BOOST_FPE_INV : (unsigned)res;
#else
/* Not Implemented */

View File

@ -1,21 +0,0 @@
diff -up tools/build/src/tools/gcc.jam.rpath tools/build/src/tools/gcc.jam
--- tools/build/src/tools/gcc.jam.rpath 2016-05-27 13:30:01.092192721 -0500
+++ tools/build/src/tools/gcc.jam 2016-05-27 13:30:46.686987585 -0500
@@ -952,7 +952,7 @@ rule link ( targets * : sources * : prop
actions link bind LIBRARIES
{
- "$(CONFIG_COMMAND)" -L"$(LINKPATH)" -Wl,$(RPATH_OPTION:E=-R)$(SPACE)-Wl,$(RPATH) -Wl,-rpath-link$(SPACE)-Wl,"$(RPATH_LINK)" -o "$(<)" $(START-GROUP) "$(>)" "$(LIBRARIES)" $(FINDLIBS-ST-PFX) -l$(FINDLIBS-ST) $(FINDLIBS-SA-PFX) -l$(FINDLIBS-SA) $(END-GROUP) $(OPTIONS) $(USER_OPTIONS)
+ "$(CONFIG_COMMAND)" -L"$(LINKPATH)" -o "$(<)" $(START-GROUP) "$(>)" "$(LIBRARIES)" $(FINDLIBS-ST-PFX) -l$(FINDLIBS-ST) $(FINDLIBS-SA-PFX) -l$(FINDLIBS-SA) $(END-GROUP) $(OPTIONS) $(USER_OPTIONS)
}
@@ -1018,7 +1018,7 @@ rule link.dll ( targets * : sources * :
# Differs from 'link' above only by -shared.
actions link.dll bind LIBRARIES
{
- "$(CONFIG_COMMAND)" -L"$(LINKPATH)" -Wl,$(RPATH_OPTION:E=-R)$(SPACE)-Wl,$(RPATH) "$(.IMPLIB-COMMAND)$(<[1])" -o "$(<[-1])" $(HAVE_SONAME)-Wl,$(SONAME_OPTION)$(SPACE)-Wl,$(<[-1]:D=) -shared $(START-GROUP) "$(>)" "$(LIBRARIES)" $(FINDLIBS-ST-PFX) -l$(FINDLIBS-ST) $(FINDLIBS-SA-PFX) -l$(FINDLIBS-SA) $(END-GROUP) $(OPTIONS) $(USER_OPTIONS)
+ "$(CONFIG_COMMAND)" -L"$(LINKPATH)" "$(.IMPLIB-COMMAND)$(<[1])" -o "$(<[-1])" $(HAVE_SONAME)-Wl,$(SONAME_OPTION)$(SPACE)-Wl,$(<[-1]:D=) -shared $(START-GROUP) "$(>)" "$(LIBRARIES)" $(FINDLIBS-ST-PFX) -l$(FINDLIBS-ST) $(FINDLIBS-SA-PFX) -l$(FINDLIBS-SA) $(END-GROUP) $(OPTIONS) $(USER_OPTIONS)
}
rule setup-threading ( targets * : sources * : properties * )