Compare commits

...

43 Commits

Author SHA1 Message Date
openeuler-ci-bot
0377e3fda9
!114 update the patch for loongarch
From: @zhangwenlong01 
Reviewed-by: @liqingqing_1229 
Signed-off-by: @liqingqing_1229
2023-01-12 11:13:45 +00:00
Wenlong Zhang
70cc97c000 update the patch for loongarch
fix build error: No best alternative for libs/context/build/asm_sources
2023-01-12 15:12:37 +08:00
openeuler-ci-bot
f6c51a7fc5
!113 add boost context support for loongarch64
From: @zhangwenlong01 
Reviewed-by: @liqingqing_1229 
Signed-off-by: @liqingqing_1229
2023-01-11 03:00:52 +00:00
Wenlong Zhang
8b939041d7 add boost context support for loongarch64 2023-01-11 10:02:24 +08:00
openeuler-ci-bot
7c94af7dbd
!109 打开容器与算法类子库的回归测试
From: @sdlzx 
Reviewed-by: @liqingqing_1229 
Signed-off-by: @liqingqing_1229
2022-12-12 12:37:01 +00:00
Liu Zixian
649cd39840 enable more tests 2022-12-12 20:19:18 +08:00
openeuler-ci-bot
4b629ee2c7
!106 打开部分子包的回归测试
From: @sdlzx 
Reviewed-by: @liqingqing_1229 
Signed-off-by: @liqingqing_1229
2022-12-12 06:07:07 +00:00
Liu Zixian
63d709bbb8 enable some regression test 2022-12-12 13:25:38 +08:00
openeuler-ci-bot
538738a2c8
!97 添加sw架构
From: @wuzx065891 
Reviewed-by: @sdlzx, @liqingqing_1229 
Signed-off-by: @liqingqing_1229
2022-10-21 01:03:46 +00:00
wzx
ba859fadb5 Add sw64 architecture
Signed-off-by: wzx <wuzx1226@qq.com>
2022-10-20 09:44:30 +08:00
openeuler-ci-bot
441424d529
!85 [sync] PR-84: fix security issue
From: @openeuler-sync-bot 
Reviewed-by: @liqingqing_1229 
Signed-off-by: @liqingqing_1229
2022-04-18 01:24:19 +00:00
Liu Zixian
cb1e280d47 filesystem: backport upstream security patches
(cherry picked from commit 70c2a6f02c)
2022-03-21 10:50:14 +08:00
openeuler-ci-bot
f49aedd9ef
!82 [sync] PR-81: fix boost-example
From: @openeuler-sync-bot 
Reviewed-by: @liqingqing_1229 
Signed-off-by: @liqingqing_1229
2022-03-02 13:49:26 +00:00
sdlzx
36e494e484 fix boost-example
(cherry picked from commit b23355954b)
2022-03-02 17:29:02 +08:00
openeuler-ci-bot
9c4c32fd4e
!79 [sync] PR-78: Fix build warnings
From: @openeuler-sync-bot 
Reviewed-by: @liqingqing_1229 
Signed-off-by: @liqingqing_1229
2022-02-17 03:08:30 +00:00
Liu Zixian
b3ca97b136 fix build warnings
(cherry picked from commit 7f77186e70)
2022-02-17 10:20:00 +08:00
openeuler-ci-bot
e274247421
!77 [sync] PR-74: simplify %build
Merge pull request !77 from openeuler-sync-bot/sync-pr74-master-to-openEuler-22.03-LTS
2022-01-30 03:47:57 +00:00
Liu Zixian
9a8686d050 simplify %build
(cherry picked from commit 397010b3ac)
2022-01-30 10:22:17 +08:00
openeuler-ci-bot
482b25aef9
!72 [sync] PR-71: fix boost-build known issue
Merge pull request !72 from openeuler-sync-bot/sync-pr71-openEuler-22.03-LTS-Next-to-openEuler-22.03-LTS
2022-01-28 08:14:29 +00:00
Liu Zixian
103f1edb02 fix build known issue
(cherry picked from commit 0fd9080c13)
2022-01-28 14:25:47 +08:00
openeuler-ci-bot
e6ecbd4397
!67 Refactor boost-help
Merge pull request !67 from sdlzx/openEuler-22.03-LTS-Next
2022-01-24 03:34:38 +00:00
Liu Zixian
dca39bd27b Refactor boost-help
Merge HTML documents and code examples into boost-help.
Also simplify install scripts.

Signed-off-by: Liu Zixian <liuzixian4@huawei.com>
2022-01-23 11:13:31 +08:00
openeuler-ci-bot
0b18636593
!65 Don't package internal build tools
Merge pull request !65 from sdlzx/openEuler-22.03-LTS-Next
2022-01-20 14:57:54 +00:00
sdlzx
136c300aa7 Don't package internal build tools 2021-12-31 23:10:03 +08:00
openeuler-ci-bot
a349681956 !64 Remove unused mpi script
Merge pull request !64 from sdlzx/openEuler-22.03-LTS-Next
2021-12-29 00:55:23 +00:00
sdlzx
d4c1af34e5 Remove unused mpi script 2021-12-27 23:11:39 +08:00
openeuler-ci-bot
2d509de201 !62 Update sub-package spec for libraries
Merge pull request !62 from sdlzx/openEuler-22.03-LTS-Next
2021-12-27 00:42:58 +00:00
sdlzx
a69b55ad86 Update package info 2021-12-26 14:58:18 +08:00
openeuler-ci-bot
194a608f26 !60 extract common b2 configs into b2_config and utilize --no-cmake-config
Merge pull request !60 from sdlzx/openEuler-22.03-LTS-Next
2021-12-22 08:56:32 +00:00
sdlzx
e3e238a9e2 extract common b2 configs into b2_config 2021-12-19 23:43:47 +08:00
openeuler-ci-bot
2f71dd7bea !58 simplify spec
Merge pull request !58 from sdlzx/openEuler-22.03-LTS-Next
2021-12-15 01:06:57 +00:00
sdlzx
b4400d6fa5 simplify spec 2021-12-14 23:43:00 +08:00
openeuler-ci-bot
bb9b24433c !54 Update to 1.78.0
Merge pull request !54 from sdlzx/openEuler-22.03-LTS-Next
2021-12-13 01:01:33 +00:00
sdlzx
b33da7ec11 Update to 1.78.0 2021-12-12 11:53:24 +08:00
openeuler-ci-bot
8cda558dc2 !47 [sync] PR-41: Remove dependencies on header-only libraries
From: @openeuler-sync-bot
Reviewed-by: @liqingqing_1229
Signed-off-by: @liqingqing_1229
2021-11-11 01:30:56 +00:00
sdlzx
7175fdc636 Remove dependencies on header-only libraries
(cherry picked from commit 3c2c4bff8e)
2021-11-11 09:30:27 +08:00
openeuler-ci-bot
91c368581c !46 [sync] PR-40: Remove boost.thread linking script and clean up dependencies
From: @openeuler-sync-bot
Reviewed-by: @liqingqing_1229
Signed-off-by: @liqingqing_1229
2021-11-11 01:29:59 +00:00
sdlzx
b90b3c54af Remove boost.thread linking script which is fixed in upstream PR266
(cherry picked from commit 27c6502f39)
2021-11-11 09:29:32 +08:00
openeuler-ci-bot
b098e05564 !45 [sync] PR-39: Correct License
From: @openeuler-sync-bot
Reviewed-by: @liqingqing_1229
Signed-off-by: @liqingqing_1229
2021-11-11 01:28:24 +00:00
sdlzx
d0d041ea50 Correct License
license name should be the same as https://gitee.com/openeuler/openeuler-jenkins/blob/master/src/ac/acl/package_license/config/Licenses.yaml

(cherry picked from commit 07e8fed948)
2021-11-11 09:27:39 +08:00
openeuler-ci-bot
3b95ba6c8d !44 [sync] PR-38: Update to 1.77
From: @openeuler-sync-bot
Reviewed-by: @liqingqing_1229
Signed-off-by: @liqingqing_1229
2021-11-11 01:26:57 +00:00
openeuler-ci-bot
8e41d4288f !44 [sync] PR-38: Update to 1.77
From: @openeuler-sync-bot
Reviewed-by: @liqingqing_1229
Signed-off-by: @liqingqing_1229
2021-11-11 01:26:55 +00:00
sdlzx
62ed33d47e update to 1.77
(cherry picked from commit 3e70aae998)
2021-11-11 09:13:58 +08:00
19 changed files with 3874 additions and 1133 deletions

144
bjam
View File

@ -1,144 +0,0 @@
.TH "b2" 1 "Sat Nov 19 2011" "Doxygen" \" -*- nroff -*-
.ad l
.nh
.SH NAME
b2 \- Command-line utility to build Boost-related C++ projects with Boost\&.Build
.SH "SYNOPSIS"
.PP
\fBb2\fP \fC[-a] [-dx] [-fx] [-jx] [-lx] [-n] [-ox] [-px] [-q] [-sx=y] [-tx] [-v] [--x]\fP
.PP
\fIb2\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 b2 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 b2 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
\fIb2\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,33 +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
@@ -22,18 +22,18 @@ import os ;
import testing ;
test-suite pool :
- [ run test_simple_seg_storage.cpp : : : <toolset>msvc:<cxxflags>-wd4267 ]
- [ run test_pool_alloc.cpp ]
- [ run pool_msvc_compiler_bug_test.cpp : : : <toolset>msvc:<cxxflags>-wd4512 ]
- [ run test_msvc_mem_leak_detect.cpp ]
- [ run test_bug_3349.cpp ]
- [ run test_bug_4960.cpp ]
+ [ run test_simple_seg_storage.cpp : : : <toolset>msvc:<cxxflags>-wd4267 <library>/boost/system//boost_system ]
+ [ run test_pool_alloc.cpp <library>/boost/system//boost_system ]
+ [ run pool_msvc_compiler_bug_test.cpp : : : <toolset>msvc:<cxxflags>-wd4512 <library>/boost/system//boost_system ]
+ [ run test_msvc_mem_leak_detect.cpp : : : <library>/boost/system//boost_system ]
+ [ run test_bug_3349.cpp : : : <library>/boost/system//boost_system ]
+ [ run test_bug_4960.cpp : : : <library>/boost/system//boost_system ]
[ run test_bug_1252.cpp : : :
<toolset>clang:<cxxflags>-Wno-c++11-long-long
<toolset>gcc:<cxxflags>-Wno-long-long
- <toolset>pathscale:<cxxflags>-Wno-long-long ]
- [ run test_bug_2696.cpp ]
- [ run test_bug_5526.cpp ]
+ <toolset>pathscale:<cxxflags>-Wno-long-long <library>/boost/system//boost_system ]
+ [ run test_bug_2696.cpp : : : <library>/boost/system//boost_system ]
+ [ run test_bug_5526.cpp : : : <library>/boost/system//boost_system ]
[ run test_threading.cpp : : : <threading>multi <library>/boost/thread//boost_thread ]
[ compile test_poisoned_macros.cpp ]
;
--
2.19.1

View File

@ -1,27 +0,0 @@
diff --git a/tools/build/src/tools/gcc.jam b/tools/build/src/tools/gcc.jam
index ff3209f7b..04520bc01 100644
--- a/tools/build/src/tools/gcc.jam
+++ b/tools/build/src/tools/gcc.jam
@@ -1132,17 +1132,17 @@ actions link.mingw bind LIBRARIES
actions link.dll.mingw bind LIBRARIES
{
- "$(CONFIG_COMMAND)" -L"$(LINKPATH)" "$(.IMPLIB-COMMAND)$(<[1])" -o "$(<[-1])" -shared @"@($(<[-1]:T).rsp:E=$(START-GROUP) "$(>:T)" "$(LIBRARIES:T)" $(FINDLIBS-ST-PFX:T) -l$(FINDLIBS-ST:T) $(FINDLIBS-SA-PFX:T) -l$(FINDLIBS-SA:T) $(END-GROUP))" $(OPTIONS) $(USER_OPTIONS)
+ "$(CONFIG_COMMAND)" -L"$(LINKPATH)" "$(.IMPLIB-COMMAND)$(<[0])" -o "$(<[-1])" -shared @"@($(<[-1]:T).rsp:E=$(START-GROUP) "$(>:T)" "$(LIBRARIES:T)" $(FINDLIBS-ST-PFX:T) -l$(FINDLIBS-ST:T) $(FINDLIBS-SA-PFX:T) -l$(FINDLIBS-SA:T) $(END-GROUP))" $(OPTIONS) $(USER_OPTIONS)
}
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)
}
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)
}
###
--
2.23.0

View File

@ -0,0 +1,355 @@
From aebac1401f9ddabb84c222481301d25beea1988d Mon Sep 17 00:00:00 2001
From: Andrey Semashev <andrey.semashev@gmail.com>
Date: Mon, 14 Jan 2019 21:08:25 +0300
Subject: [PATCH 1/2] Remove linking with Boost.System.
Since Boost.System is header-only now, no need to link with the library.
---
build/Jamfile.v2 | 3 ---
1 file changed, 3 deletions(-)
diff --git a/libs/locale/build/Jamfile.v2 b/libs/locale/build/Jamfile.v2
index 578e722e..43ab0014 100644
--- a/libs/locale/build/Jamfile.v2
+++ b/libs/locale/build/Jamfile.v2
@@ -382,9 +382,6 @@ rule configure-full ( properties * : flags-only )
result += <source>util/gregorian.cpp ;
}
- result += <library>../../system/build//boost_system ;
-
-
if "$(flags-only)" = "flags"
{
return $(flags-result) ;
From b01aab1d28c9b32d107ae39c76c9af988420d476 Mon Sep 17 00:00:00 2001
From: Andrey Semashev <andrey.semashev@gmail.com>
Date: Mon, 14 Jan 2019 21:10:38 +0300
Subject: [PATCH 2/2] Trim trailing spaces.
---
build/Jamfile.v2 | 119 +++++++++++++++++++++++------------------------
1 file changed, 59 insertions(+), 60 deletions(-)
diff --git a/libs/locale/build/Jamfile.v2 b/libs/locale/build/Jamfile.v2
index 43ab0014..97dd68c7 100644
--- a/libs/locale/build/Jamfile.v2
+++ b/libs/locale/build/Jamfile.v2
@@ -1,6 +1,6 @@
# copyright John Maddock 2003, Artyom Beilis 2010
-# Distributed under the Boost Software License, Version 1.0.
-# (See accompanying file LICENSE_1_0.txt or copy at
+# Distributed under the Boost Software License, Version 1.0.
+# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt.
@@ -32,11 +32,11 @@ explicit has_iconv ;
ICONV_PATH = [ modules.peek : ICONV_PATH ] ;
-lib iconv
- :
+lib iconv
+ :
: <search>$(ICONV_PATH)/lib <link>shared <runtime-link>shared
:
- : <include>$(ICONV_PATH)/include
+ : <include>$(ICONV_PATH)/include
;
explicit iconv ;
@@ -45,8 +45,8 @@ obj has_iconv_libc_ext : ../build/has_iconv.cpp iconv ;
exe has_external_iconv : has_iconv_libc_ext iconv ;
explicit has_external_iconv ;
-exe accepts_shared_option : ../build/option.cpp
- : <cxxflags>-shared-libstdc++
+exe accepts_shared_option : ../build/option.cpp
+ : <cxxflags>-shared-libstdc++
<cxxflags>-shared-libgcc
<linkflags>-shared-libstdc++
<linkflags>-shared-libgcc
@@ -71,8 +71,8 @@ if $(ICU_LINK)
else
{
searched-lib icuuc : : <name>icuuc
- <search>$(ICU_PATH)/lib
- <link>shared
+ <search>$(ICU_PATH)/lib
+ <link>shared
<runtime-link>shared ;
searched-lib icuuc : : <toolset>msvc
@@ -120,9 +120,9 @@ else
explicit icuuc icudt icuin ;
- ICU_OPTS = <include>$(ICU_PATH)/include
- <library>icuuc/<link>shared/<runtime-link>shared
- <library>icudt/<link>shared/<runtime-link>shared
+ ICU_OPTS = <include>$(ICU_PATH)/include
+ <library>icuuc/<link>shared/<runtime-link>shared
+ <library>icudt/<link>shared/<runtime-link>shared
<library>icuin/<link>shared/<runtime-link>shared
<dll-path>$(ICU_PATH)/bin
<runtime-link>shared ;
@@ -130,8 +130,8 @@ else
searched-lib icuuc_64 : : <name>icuuc
- <search>$(ICU_PATH)/lib64
- <link>shared
+ <search>$(ICU_PATH)/lib64
+ <link>shared
<runtime-link>shared ;
searched-lib icuuc_64 : : <toolset>msvc
@@ -179,14 +179,14 @@ else
explicit icuuc_64 icudt_64 icuin_64 ;
- ICU64_OPTS = <include>$(ICU_PATH)/include
- <library>icuuc_64/<link>shared/<runtime-link>shared
- <library>icudt_64/<link>shared/<runtime-link>shared
+ ICU64_OPTS = <include>$(ICU_PATH)/include
+ <library>icuuc_64/<link>shared/<runtime-link>shared
+ <library>icudt_64/<link>shared/<runtime-link>shared
<library>icuin_64/<link>shared/<runtime-link>shared
<dll-path>$(ICU_PATH)/bin64
<runtime-link>shared ;
-
-
+
+
}
obj has_icu_obj : ../build/has_icu_test.cpp : $(ICU_OPTS) ;
@@ -206,11 +206,11 @@ rule configure-full ( properties * : flags-only )
local result ;
local flags-result ;
-
+
local found-iconv ;
-
+
if <boost.locale.iconv>on in $(properties)
- || ! <boost.locale.iconv> in $(properties:G)
+ || ! <boost.locale.iconv> in $(properties:G)
&& ! <target-os>solaris in $(properties)
{
# See if iconv is bundled with standard library.
@@ -218,7 +218,7 @@ rule configure-full ( properties * : flags-only )
{
found-iconv = true ;
}
- else
+ else
{
if [ configure.builds has_external_iconv : $(properties) : "iconv (separate)" ]
{
@@ -226,8 +226,8 @@ rule configure-full ( properties * : flags-only )
result += <library>iconv ;
}
}
- }
- if $(found-iconv)
+ }
+ if $(found-iconv)
{
flags-result += <define>BOOST_LOCALE_WITH_ICONV=1 ;
}
@@ -249,7 +249,7 @@ rule configure-full ( properties * : flags-only )
if $(found-icu)
{
- ICU_SOURCES =
+ ICU_SOURCES =
boundary
codecvt
collator
@@ -260,20 +260,20 @@ rule configure-full ( properties * : flags-only )
numeric
time_zone
;
-
- result += <source>icu/$(ICU_SOURCES).cpp
- <library>../../thread/build//boost_thread
+
+ result += <source>icu/$(ICU_SOURCES).cpp
+ <library>../../thread/build//boost_thread
;
}
}
-
- if ! $(found-iconv) && ! $(found-icu) && ! <target-os>windows in $(properties) && ! <target-os>cygwin in $(properties)
+
+ if ! $(found-iconv) && ! $(found-icu) && ! <target-os>windows in $(properties) && ! <target-os>cygwin in $(properties)
{
ECHO "- Boost.Locale needs either iconv or ICU library to be built." ;
result += <build>no ;
}
-
+
if ! <boost.locale.std> in $(properties:G)
{
if <toolset>sun in $(properties)
@@ -283,9 +283,9 @@ rule configure-full ( properties * : flags-only )
else
{
properties += <boost.locale.std>on ;
- }
+ }
}
-
+
if <boost.locale.std>off in $(properties)
{
flags-result += <define>BOOST_LOCALE_NO_STD_BACKEND=1 ;
@@ -301,38 +301,38 @@ rule configure-full ( properties * : flags-only )
;
result += <source>std/$(STD_SOURCES).cpp ;
}
-
+
if ! <boost.locale.winapi> in $(properties:G)
{
- if <target-os>windows in $(properties)
+ if <target-os>windows in $(properties)
|| <target-os>cygwin in $(properties)
{
properties += <boost.locale.winapi>on ;
- }
+ }
else
{
properties += <boost.locale.winapi>off ;
- }
+ }
}
- if <target-os>windows in $(properties)
- && <toolset>gcc in $(properties)
+ if <target-os>windows in $(properties)
+ && <toolset>gcc in $(properties)
&& <link>shared in $(properties)
&& [ configure.builds accepts_shared_option : $(properties) : "g++ -shared-* supported" ]
{
- flags-result += <cxxflags>-shared-libstdc++
+ flags-result += <cxxflags>-shared-libstdc++
<cxxflags>-shared-libgcc
<linkflags>-shared-libstdc++
<linkflags>-shared-libgcc
;
}
-
+
if <boost.locale.winapi>off in $(properties)
{
flags-result += <define>BOOST_LOCALE_NO_WINAPI_BACKEND=1 ;
}
else
{
- WINAPI_SOURCES =
+ WINAPI_SOURCES =
collate
converter
numeric
@@ -340,34 +340,34 @@ rule configure-full ( properties * : flags-only )
;
result += <source>win32/$(WINAPI_SOURCES).cpp ;
}
-
+
if ( ! <boost.locale.winapi>off in $(properties) || ! <boost.locale.std>off in $(properties) )
&& ( <target-os>windows in $(properties) || <target-os>cygwin in $(properties) )
{
result += <source>win32/lcid.cpp ;
}
-
+
if ! <boost.locale.posix> in $(properties:G)
{
- if <target-os>linux in $(properties)
- || <target-os>darwin in $(properties)
+ if <target-os>linux in $(properties)
+ || <target-os>darwin in $(properties)
|| ( <target-os>freebsd in $(properties) && [ configure.builds has_xlocale : $(properties) : "xlocale supported" ] )
{
properties += <boost.locale.posix>on ;
}
else
{
- properties += <boost.locale.posix>off ;
- }
+ properties += <boost.locale.posix>off ;
+ }
}
-
+
if <boost.locale.posix>off in $(properties)
{
- flags-result += <define>BOOST_LOCALE_NO_POSIX_BACKEND=1 ;
+ flags-result += <define>BOOST_LOCALE_NO_POSIX_BACKEND=1 ;
}
else
{
- POSIX_SOURCES =
+ POSIX_SOURCES =
collate
converter
numeric
@@ -381,12 +381,13 @@ rule configure-full ( properties * : flags-only )
{
result += <source>util/gregorian.cpp ;
}
-
- if "$(flags-only)" = "flags"
+
+ if "$(flags-only)" = "flags"
{
return $(flags-result) ;
}
- else {
+ else
+ {
result += $(flags-result) ;
return $(result) ;
}
@@ -396,7 +397,6 @@ rule configure ( properties * )
{
local result = [ configure-full $(properties) : "all" ] ;
return $(result) ;
-
}
rule configure-flags ( properties * )
@@ -404,15 +404,14 @@ rule configure-flags ( properties * )
local result ;
result = [ configure-full $(properties) : "flags" ] ;
return $(result) ;
-
}
alias build_options : : : : <conditional>@configure ;
alias build_flags : : : : <conditional>@configure-flags ;
-lib boost_locale
- :
+lib boost_locale
+ :
encoding/codepage.cpp
shared/date_time.cpp
shared/format.cpp
@@ -425,7 +424,7 @@ lib boost_locale
util/codecvt_converter.cpp
util/default_locale.cpp
util/info.cpp
- util/locale_data.cpp
+ util/locale_data.cpp
:
# Don't link explicitly, not required
<define>BOOST_THREAD_NO_LIB=1

View File

@ -0,0 +1,24 @@
From d96af5c5060f02d35a70f57d971b539258279634 Mon Sep 17 00:00:00 2001
From: sdlzx <hdu_sdlzx@163.com>
Date: Tue, 5 Oct 2021 17:14:02 +0800
Subject: [PATCH] Remove boost.system linkage
---
libs/type_erasure/build/Jamfile.v2 | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libs/type_erasure/build/Jamfile.v2 b/libs/type_erasure/build/Jamfile.v2
index 2408e6bd8..3a77b5e57 100644
--- a/libs/type_erasure/build/Jamfile.v2
+++ b/libs/type_erasure/build/Jamfile.v2
@@ -12,6 +12,6 @@ project /boost/type_erasure
: usage-requirements <link>shared:<define>BOOST_TYPE_ERASURE_DYN_LINK
;
-lib boost_type_erasure : dynamic_binding.cpp /boost//thread /boost//system ;
+lib boost_type_erasure : dynamic_binding.cpp /boost//thread ;
boost-install boost_type_erasure ;
--
2.31.1

View File

@ -0,0 +1,664 @@
From 217e51b9101fb4779c8dc00a562f77c0c9a70afe Mon Sep 17 00:00:00 2001
From: Wenlong Zhang <zhangwenlong@loongson.cn>
Date: Wed, 11 Jan 2023 17:28:18 +0800
Subject: [PATCH] add boost context support for loongarch64 new
---
boost/predef/architecture.h | 1 +
boost/predef/architecture/loongarch.h | 39 ++++++
boost/predef/other/endian.h | 1 +
boostcpp.jam | 5 +-
libs/config/checks/architecture/Jamfile.jam | 1 +
libs/config/checks/architecture/loongarch.cpp | 11 ++
libs/context/CMakeLists.txt | 4 +-
libs/context/build/Jamfile.v2 | 13 ++
libs/context/build/architecture.jam | 4 +
libs/context/doc/architectures.qbk | 1 +
libs/context/doc/context.xml | 27 ++++
.../doc/html/context/architectures.html | 27 ++++
.../src/asm/jump_loongarch64_sysv_elf_gas.S | 121 ++++++++++++++++++
.../src/asm/make_loongarch64_sysv_elf_gas.S | 72 +++++++++++
.../src/asm/ontop_loongarch64_sysv_elf_gas.S | 118 +++++++++++++++++
tools/build/src/engine/jam.h | 4 +
.../tools/features/architecture-feature.jam | 3 +
17 files changed, 448 insertions(+), 4 deletions(-)
create mode 100644 boost/predef/architecture/loongarch.h
create mode 100644 libs/config/checks/architecture/loongarch.cpp
create mode 100644 libs/context/src/asm/jump_loongarch64_sysv_elf_gas.S
create mode 100644 libs/context/src/asm/make_loongarch64_sysv_elf_gas.S
create mode 100644 libs/context/src/asm/ontop_loongarch64_sysv_elf_gas.S
diff --git a/boost/predef/architecture.h b/boost/predef/architecture.h
index 471c263..55d036f 100644
--- a/boost/predef/architecture.h
+++ b/boost/predef/architecture.h
@@ -17,6 +17,7 @@ http://www.boost.org/LICENSE_1_0.txt)
#include <boost/predef/architecture/convex.h>
#include <boost/predef/architecture/e2k.h>
#include <boost/predef/architecture/ia64.h>
+#include <boost/predef/architecture/loongarch.h>
#include <boost/predef/architecture/m68k.h>
#include <boost/predef/architecture/mips.h>
#include <boost/predef/architecture/parisc.h>
diff --git a/boost/predef/architecture/loongarch.h b/boost/predef/architecture/loongarch.h
new file mode 100644
index 0000000..17015d8
--- /dev/null
+++ b/boost/predef/architecture/loongarch.h
@@ -0,0 +1,39 @@
+/*
+Copyright Zhang Na 2022
+Distributed under the Boost Software License, Version 1.0.
+(See accompanying file LICENSE_1_0.txt or copy at
+http://www.boost.org/LICENSE_1_0.txt)
+*/
+
+#ifndef BOOST_PREDEF_ARCHITECTURE_LOONGARCH_H
+#define BOOST_PREDEF_ARCHITECTURE_LOONGARCH_H
+
+#include <boost/predef/version_number.h>
+#include <boost/predef/make.h>
+
+/* tag::reference[]
+= `BOOST_ARCH_LOONGARCH`
+[options="header"]
+|===
+| {predef_symbol} | {predef_version}
+| `+__loongarch__+` | {predef_detection}
+|===
+*/ // end::reference[]
+
+#define BOOST_ARCH_LOONGARCH BOOST_VERSION_NUMBER_NOT_AVAILABLE
+
+#if defined(__loongarch__)
+# undef BOOST_ARCH_LOONGARCH
+# define BOOST_ARCH_LOONGARCH BOOST_VERSION_NUMBER_AVAILABLE
+#endif
+
+#if BOOST_ARCH_LOONGARCH
+# define BOOST_ARCH_LOONGARCH_AVAILABLE
+#endif
+
+#define BOOST_ARCH_LOONGARCH_NAME "LoongArch"
+
+#endif
+
+#include <boost/predef/detail/test.h>
+BOOST_PREDEF_DECLARE_TEST(BOOST_ARCH_LOONGARCH,BOOST_ARCH_LOONGARCH_NAME)
diff --git a/boost/predef/other/endian.h b/boost/predef/other/endian.h
index d8ec63f..b712673 100644
--- a/boost/predef/other/endian.h
+++ b/boost/predef/other/endian.h
@@ -121,6 +121,7 @@ information and acquired knowledge:
defined(__ARMEL__) || \
defined(__THUMBEL__) || \
defined(__AARCH64EL__) || \
+ defined(__loongarch__) || \
defined(_MIPSEL) || \
defined(__MIPSEL) || \
defined(__MIPSEL__) || \
diff --git a/boostcpp.jam b/boostcpp.jam
index f60e85c..c938b72 100644
--- a/boostcpp.jam
+++ b/boostcpp.jam
@@ -634,7 +634,7 @@ rule address-model ( )
return <conditional>@boostcpp.deduce-address-model ;
}
-local deducable-architectures = sw_64 arm mips1 power riscv s390x sparc x86 combined ;
+local deducable-architectures = sw_64 arm loongarch mips1 power riscv s390x sparc x86 combined ;
feature.feature deduced-architecture : $(deducable-architectures) : propagated optional composite hidden ;
for a in $(deducable-architectures)
{
@@ -645,10 +645,11 @@ rule deduce-architecture ( properties * )
{
local result ;
local filtered = [ toolset-properties $(properties) ] ;
- local names = arm sw_64 mips1 power riscv s390x sparc x86 combined ;
+ local names = arm sw_64 loongarch mips1 power riscv s390x sparc x86 combined ;
local idx = [ configure.find-builds "default architecture" : $(filtered)
: /boost/architecture//arm
: /boost/architecture//sw_64
+ : /boost/architecture//loongarch
: /boost/architecture//mips1
: /boost/architecture//power
: /boost/architecture//riscv
diff --git a/libs/config/checks/architecture/Jamfile.jam b/libs/config/checks/architecture/Jamfile.jam
index f86c732..ee260ff 100644
--- a/libs/config/checks/architecture/Jamfile.jam
+++ b/libs/config/checks/architecture/Jamfile.jam
@@ -19,6 +19,7 @@ obj 64 : 64.cpp ;
obj arm : arm.cpp ;
obj sw_64 : sw_64.cpp ;
obj combined : combined.cpp ;
+obj loongarch : loongarch.cpp ;
obj mips1 : mips1.cpp ;
obj power : power.cpp ;
obj riscv : riscv.cpp ;
diff --git a/libs/config/checks/architecture/loongarch.cpp b/libs/config/checks/architecture/loongarch.cpp
new file mode 100644
index 0000000..5be8cb0
--- /dev/null
+++ b/libs/config/checks/architecture/loongarch.cpp
@@ -0,0 +1,11 @@
+// loongarch.cpp
+//
+// Copyright (c) 2012 Steven Watanabe
+//
+// Distributed under the Boost Software License Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#if !defined(__loongarch__)
+#error "Not LoongArch"
+#endif
diff --git a/libs/context/CMakeLists.txt b/libs/context/CMakeLists.txt
index 99c11b2..f301143 100644
--- a/libs/context/CMakeLists.txt
+++ b/libs/context/CMakeLists.txt
@@ -48,7 +48,7 @@ unset(_default_abi)
## Arch-and-model
-set(_all_archs arm arm64 sw_64 mips32 mips64 ppc32 ppc64 riscv64 s390x i386 x86_64 combined)
+set(_all_archs arm arm64 loongarch64 sw_64 mips32 mips64 ppc32 ppc64 riscv64 s390x i386 x86_64 combined)
# Try at start to auto determine arch from CMake.
if(CMAKE_SYSTEM_PROCESSOR IN_LIST _all_archs)
@@ -74,7 +74,7 @@ else()
endif()
endif()
-set(BOOST_CONTEXT_ARCHITECTURE "${_default_arch}" CACHE STRING "Boost.Context architecture (arm, arm64, mips32, sw_64, mips64, ppc32, ppc64, riscv64, s390x, i386, x86_64, combined)")
+set(BOOST_CONTEXT_ARCHITECTURE "${_default_arch}" CACHE STRING "Boost.Context architecture (arm, arm64, loongarch64, mips32, sw_64, mips64, ppc32, ppc64, riscv64, s390x, i386, x86_64, combined)")
set_property(CACHE BOOST_CONTEXT_ARCHITECTURE PROPERTY STRINGS ${_all_archs})
unset(_all_archs)
diff --git a/libs/context/build/Jamfile.v2 b/libs/context/build/Jamfile.v2
index 30e9598..6238510 100644
--- a/libs/context/build/Jamfile.v2
+++ b/libs/context/build/Jamfile.v2
@@ -254,6 +254,19 @@ alias asm_sources
<toolset>darwin
;
+# LOONGARCH64
+# LOONGARCH64/SYSV/ELF
+alias asm_sources
+ : asm/make_loongarch64_sysv_elf_gas.S
+ asm/jump_loongarch64_sysv_elf_gas.S
+ asm/ontop_loongarch64_sysv_elf_gas.S
+ : <abi>sysv
+ <address-model>64
+ <architecture>loongarch
+ <binary-format>elf
+ <toolset>gcc
+ ;
+
# MIPS
# MIPS32/O32/ELF
alias asm_sources
diff --git a/libs/context/build/architecture.jam b/libs/context/build/architecture.jam
index 4c7d211..78820cd 100644
--- a/libs/context/build/architecture.jam
+++ b/libs/context/build/architecture.jam
@@ -59,6 +59,10 @@ rule deduce-architecture ( properties * )
{
return <architecture>sw_64 ;
}
+ else if [ configure.builds /boost/architecture//loongarch : $(properties) : loongarch ]
+ {
+ return <architecture>loongarch ;
+ }
else if [ configure.builds /boost/architecture//mips : $(properties) : mips ]
{
return <architecture>mips ;
diff --git a/libs/context/doc/architectures.qbk b/libs/context/doc/architectures.qbk
index 4be823c..76d6d58 100644
--- a/libs/context/doc/architectures.qbk
+++ b/libs/context/doc/architectures.qbk
@@ -15,6 +15,7 @@ architectures:
[[arm (aarch32)] [AAPCS|ELF] [AAPCS|PE] [-] [AAPCS|MACH-O]]
[[arm (aarch64)] [AAPCS|ELF] [-] [AAPCS|MACH-O] [AAPCS|MACH-O]]
[[i386] [SYSV|ELF] [MS|PE] [SYSV|MACH-O] [-]]
+ [[loongarch64] [SYSV|ELF] [-] [-] [-]]
[[mips] [O32|N64|ELF] [-] [-] [-]]
[[ppc32] [SYSV|ELF|XCOFF] [-] [SYSV|MACH-O] [-]]
[[ppc64] [SYSV|ELF|XCOFF] [-] [SYSV|MACH-O] [-]]
diff --git a/libs/context/doc/context.xml b/libs/context/doc/context.xml
index d83439d..ef920cd 100644
--- a/libs/context/doc/context.xml
+++ b/libs/context/doc/context.xml
@@ -3379,6 +3379,33 @@
</para>
</entry>
</row>
+ <row>
+ <entry>
+ <para>
+ loongarch64
+ </para>
+ </entry>
+ <entry>
+ <para>
+ SYSV|ELF
+ </para>
+ </entry>
+ <entry>
+ <para>
+ -
+ </para>
+ </entry>
+ <entry>
+ <para>
+ -
+ </para>
+ </entry>
+ <entry>
+ <para>
+ -
+ </para>
+ </entry>
+ </row>
<row>
<entry>
<para>
diff --git a/libs/context/doc/html/context/architectures.html b/libs/context/doc/html/context/architectures.html
index 416627d..29bd803 100644
--- a/libs/context/doc/html/context/architectures.html
+++ b/libs/context/doc/html/context/architectures.html
@@ -151,6 +151,33 @@
</td>
</tr>
<tr>
+<td>
+ <p>
+ loongarch64
+ </p>
+ </td>
+<td>
+ <p>
+ SYSV|ELF
+ </p>
+ </td>
+<td>
+ <p>
+ -
+ </p>
+ </td>
+<td>
+ <p>
+ -
+ </p>
+ </td>
+<td>
+ <p>
+ -
+ </p>
+ </td>
+</tr>
+<tr>
<td>
<p>
mips
diff --git a/libs/context/src/asm/jump_loongarch64_sysv_elf_gas.S b/libs/context/src/asm/jump_loongarch64_sysv_elf_gas.S
new file mode 100644
index 0000000..74c081e
--- /dev/null
+++ b/libs/context/src/asm/jump_loongarch64_sysv_elf_gas.S
@@ -0,0 +1,121 @@
+/*******************************************************
+ * *
+ * ------------------------------------------------- *
+ * | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | *
+ * ------------------------------------------------- *
+ * | 0 | 8 | 16 | 24 | *
+ * ------------------------------------------------- *
+ * | FS0 | FS1 | FS2 | FS3 | *
+ * ------------------------------------------------- *
+ * ------------------------------------------------- *
+ * | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | *
+ * ------------------------------------------------- *
+ * | 32 | 40 | 48 | 56 | *
+ * ------------------------------------------------- *
+ * | FS4 | FS5 | FS6 | FS7 | *
+ * ------------------------------------------------- *
+ * ------------------------------------------------- *
+ * | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | *
+ * ------------------------------------------------- *
+ * | 64 | 72 | 80 | 88 | *
+ * ------------------------------------------------- *
+ * | S0 | S1 | S2 | S3 | *
+ * ------------------------------------------------- *
+ * ------------------------------------------------- *
+ * | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | *
+ * ------------------------------------------------- *
+ * | 96 | 100 | 104 | 108 | 112 | 116 | 120 | 124 | *
+ * ------------------------------------------------- *
+ * | S4 | S5 | S6 | S7 | *
+ * ------------------------------------------------- *
+ * ------------------------------------------------- *
+ * | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | *
+ * ------------------------------------------------- *
+ * | 128 | 132 | 136 | 140 | 144 | 148 | 152 | 156 | *
+ * ------------------------------------------------- *
+ * | S8 | FP | RA | PC | *
+ * ------------------------------------------------- *
+ * *
+ * *****************************************************/
+
+.file "jump_loongarch64_sysv_elf_gas.S"
+.text
+.globl jump_fcontext
+.align 2
+.type jump_fcontext,@function
+jump_fcontext:
+ # reserve space on stack
+ addi.d $sp, $sp, -160
+
+ # save fs0 - fs7
+ fst.d $fs0, $sp, 0
+ fst.d $fs1, $sp, 8
+ fst.d $fs2, $sp, 16
+ fst.d $fs3, $sp, 24
+ fst.d $fs4, $sp, 32
+ fst.d $fs5, $sp, 40
+ fst.d $fs6, $sp, 48
+ fst.d $fs7, $sp, 56
+
+ # save s0 - s8, fp, ra
+ st.d $s0, $sp, 64
+ st.d $s1, $sp, 72
+ st.d $s2, $sp, 80
+ st.d $s3, $sp, 88
+ st.d $s4, $sp, 96
+ st.d $s5, $sp, 104
+ st.d $s6, $sp, 112
+ st.d $s7, $sp, 120
+ st.d $s8, $sp, 128
+ st.d $fp, $sp, 136
+ st.d $ra, $sp, 144
+
+ # save RA as PC
+ st.d $ra, $sp, 152
+
+ # store SP (pointing to context-data) in A2
+ move $a2, $sp
+
+ # restore SP (pointing to context-data) from A0
+ move $sp, $a0
+
+ # load fs0 - fs7
+ fld.d $fs0, $sp, 0
+ fld.d $fs1, $sp, 8
+ fld.d $fs2, $sp, 16
+ fld.d $fs3, $sp, 24
+ fld.d $fs4, $sp, 32
+ fld.d $fs5, $sp, 40
+ fld.d $fs6, $sp, 48
+ fld.d $fs7, $sp, 56
+
+ #load s0 - s7
+ ld.d $s0, $sp, 64
+ ld.d $s1, $sp, 72
+ ld.d $s2, $sp, 80
+ ld.d $s3, $sp, 88
+ ld.d $s4, $sp, 96
+ ld.d $s5, $sp, 104
+ ld.d $s6, $sp, 112
+ ld.d $s7, $sp, 120
+ ld.d $s8, $sp, 128
+ ld.d $fp, $sp, 136
+ ld.d $ra, $sp, 144
+
+ # return transfer_t from jump
+ # pass transfer_t as first arg in context function
+ # a0 == FCTX, a1 == DATA
+ move $a0, $a2
+
+ # load PC
+ ld.d $a2, $sp, 152
+
+ # restore stack
+ addi.d $sp, $sp, 160
+
+ # jump to context
+ jr $a2
+.size jump_fcontext, .-jump_fcontext
+
+/* Mark that we don't need executable stack. */
+.section .note.GNU-stack,"",%progbits
diff --git a/libs/context/src/asm/make_loongarch64_sysv_elf_gas.S b/libs/context/src/asm/make_loongarch64_sysv_elf_gas.S
new file mode 100644
index 0000000..5506270
--- /dev/null
+++ b/libs/context/src/asm/make_loongarch64_sysv_elf_gas.S
@@ -0,0 +1,72 @@
+/*******************************************************
+ * *
+ * ------------------------------------------------- *
+ * | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | *
+ * ------------------------------------------------- *
+ * | 0 | 8 | 16 | 24 | *
+ * ------------------------------------------------- *
+ * | FS0 | FS1 | FS2 | FS3 | *
+ * ------------------------------------------------- *
+ * ------------------------------------------------- *
+ * | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | *
+ * ------------------------------------------------- *
+ * | 32 | 40 | 48 | 56 | *
+ * ------------------------------------------------- *
+ * | FS4 | FS5 | FS6 | FS7 | *
+ * ------------------------------------------------- *
+ * ------------------------------------------------- *
+ * | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | *
+ * ------------------------------------------------- *
+ * | 64 | 72 | 80 | 88 | *
+ * ------------------------------------------------- *
+ * | S0 | S1 | S2 | S3 | *
+ * ------------------------------------------------- *
+ * ------------------------------------------------- *
+ * | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | *
+ * ------------------------------------------------- *
+ * | 96 | 100 | 104 | 108 | 112 | 116 | 120 | 124 | *
+ * ------------------------------------------------- *
+ * | S4 | S5 | S6 | S7 | *
+ * ------------------------------------------------- *
+ * ------------------------------------------------- *
+ * | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | *
+ * ------------------------------------------------- *
+ * | 128 | 132 | 136 | 140 | 144 | 148 | 152 | 156 | *
+ * ------------------------------------------------- *
+ * | S8 | FP | RA | PC | *
+ * ------------------------------------------------- *
+ * *
+ * *****************************************************/
+
+.file "make_loongarch64_sysv_elf_gas.S"
+.text
+.globl make_fcontext
+.align 2
+.type make_fcontext,@function
+make_fcontext:
+ # shift address in A0 to lower 16 byte boundary
+ bstrins.d $a0, $zero, 3, 0
+
+ # reserve space for context-data on context-stack
+ addi.d $a0, $a0, -160
+
+ # third arg of make_fcontext() == address of context-function
+ st.d $a2, $a0, 152
+
+ # save address of finish as return-address for context-function
+ # will be entered after context-function returns
+ la.local $a4, finish
+ st.d $a4, $a0, 144
+
+ # return pointer to context-data
+ jr $ra
+
+finish:
+ # exit code is zero
+ li.d $a0, 0
+ # call _exit(0)
+ b %plt(_exit)
+
+.size make_fcontext, .-make_fcontext
+/* Mark that we don't need executable stack. */
+.section .note.GNU-stack,"",%progbits
diff --git a/libs/context/src/asm/ontop_loongarch64_sysv_elf_gas.S b/libs/context/src/asm/ontop_loongarch64_sysv_elf_gas.S
new file mode 100644
index 0000000..c6ea044
--- /dev/null
+++ b/libs/context/src/asm/ontop_loongarch64_sysv_elf_gas.S
@@ -0,0 +1,118 @@
+/*******************************************************
+ * *
+ * ------------------------------------------------- *
+ * | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | *
+ * ------------------------------------------------- *
+ * | 0 | 8 | 16 | 24 | *
+ * ------------------------------------------------- *
+ * | FS0 | FS1 | FS2 | FS3 | *
+ * ------------------------------------------------- *
+ * ------------------------------------------------- *
+ * | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | *
+ * ------------------------------------------------- *
+ * | 32 | 40 | 48 | 56 | *
+ * ------------------------------------------------- *
+ * | FS4 | FS5 | FS6 | FS7 | *
+ * ------------------------------------------------- *
+ * ------------------------------------------------- *
+ * | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | *
+ * ------------------------------------------------- *
+ * | 64 | 72 | 80 | 88 | *
+ * ------------------------------------------------- *
+ * | S0 | S1 | S2 | S3 | *
+ * ------------------------------------------------- *
+ * ------------------------------------------------- *
+ * | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | *
+ * ------------------------------------------------- *
+ * | 96 | 100 | 104 | 108 | 112 | 116 | 120 | 124 | *
+ * ------------------------------------------------- *
+ * | S4 | S5 | S6 | S7 | *
+ * ------------------------------------------------- *
+ * ------------------------------------------------- *
+ * | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | *
+ * ------------------------------------------------- *
+ * | 128 | 132 | 136 | 140 | 144 | 148 | 152 | 156 | *
+ * ------------------------------------------------- *
+ * | S8 | FP | RA | PC | *
+ * ------------------------------------------------- *
+ * *
+ * *****************************************************/
+
+.file "ontop_loongarch64_sysv_elf_gas.S"
+.text
+.globl ontop_fcontext
+.align 2
+.type ontop_fcontext,@function
+ontop_fcontext:
+ # reserve space on stack
+ addi.d $sp, $sp, -160
+
+ # save fs0 - fs7
+ fst.d $fs0, $sp, 0
+ fst.d $fs1, $sp, 8
+ fst.d $fs2, $sp, 16
+ fst.d $fs3, $sp, 24
+ fst.d $fs4, $sp, 32
+ fst.d $fs5, $sp, 40
+ fst.d $fs6, $sp, 48
+ fst.d $fs7, $sp, 56
+
+ # save s0 - s8, fp, ra
+ st.d $s0, $sp, 64
+ st.d $s1, $sp, 72
+ st.d $s2, $sp, 80
+ st.d $s3, $sp, 88
+ st.d $s4, $sp, 96
+ st.d $s5, $sp, 104
+ st.d $s6, $sp, 112
+ st.d $s7, $sp, 120
+ st.d $s8, $sp, 128
+ st.d $fp, $sp, 136
+ st.d $ra, $sp, 144
+
+ # save RA as PC
+ st.d $ra, $sp, 152
+
+ # store SP (pointing to context-data) in A3
+ move $a3, $sp
+
+ # restore SP (pointing to context-data) from A0
+ move $sp, $a0
+
+ # load fs0 - fs11
+ fld.d $fs0, $sp, 0
+ fld.d $fs1, $sp, 8
+ fld.d $fs2, $sp, 16
+ fld.d $fs3, $sp, 24
+ fld.d $fs4, $sp, 32
+ fld.d $fs5, $sp, 40
+ fld.d $fs6, $sp, 48
+ fld.d $fs7, $sp, 56
+
+ #load s0 - s11, fp, ra
+ ld.d $s0, $sp, 64
+ ld.d $s1, $sp, 72
+ ld.d $s2, $sp, 80
+ ld.d $s3, $sp, 88
+ ld.d $s4, $sp, 96
+ ld.d $s5, $sp, 104
+ ld.d $s6, $sp, 112
+ ld.d $s7, $sp, 120
+ ld.d $s8, $sp, 128
+ ld.d $fp, $sp, 136
+ ld.d $ra, $sp, 144
+
+ # return transfer_t from jump
+ # pass transfer_t as first arg in context function
+ # a0 == FCTX, a1 == DATA
+ move $a0, $a3
+
+ # adjust stack
+ addi.d $sp, $sp, 160
+
+ # jump to context
+ jr $a2
+.size ontop_fcontext, .-ontop_fcontext
+
+/* Mark that we don't need executable stack. */
+.section .note.GNU-stack,"",%progbits
diff --git a/tools/build/src/engine/jam.h b/tools/build/src/engine/jam.h
index 59e5f82..76a7869 100644
--- a/tools/build/src/engine/jam.h
+++ b/tools/build/src/engine/jam.h
@@ -446,6 +446,10 @@
#define OSPLAT "OSPLAT=PARISC"
#endif
+#ifdef __loongarch64
+ #define OSPLAT "OSPLAT=LOONGARCH64"
+#endif
+
#ifndef OSPLAT
#define OSPLAT ""
#endif
diff --git a/tools/build/src/tools/features/architecture-feature.jam b/tools/build/src/tools/features/architecture-feature.jam
index e320307..124b4be 100644
--- a/tools/build/src/tools/features/architecture-feature.jam
+++ b/tools/build/src/tools/features/architecture-feature.jam
@@ -45,6 +45,9 @@ feature.feature architecture
# RISC-V
riscv
+ # loongarch
+ loongarch
+
# z Systems (aka s390x)
s390x
:
--
2.33.0

View File

@ -0,0 +1,71 @@
From 62e7321669f66a90e2a90c8f31af34f59ebc5d7a Mon Sep 17 00:00:00 2001
From: Dmitry Arkhipov <grisumbras@gmail.com>
Date: Thu, 9 Dec 2021 08:11:57 +0300
Subject: [PATCH] Don't skip install targets if there's <build>no in ureqs
---
tools/build/src/tools/stage.jam | 4 ++++
tools/build/test/install_build_no.py | 26 ++++++++++++++++++++++++++
tools/build/test/test_all.py | 1 +
3 files changed, 31 insertions(+)
create mode 100755 test/install_build_no.py
diff --git a/tools/build/src/tools/stage.jam b/tools/build/src/tools/stage.jam
index c5f02e3ba4..325129dc81 100644
--- a/tools/build/src/tools/stage.jam
+++ b/tools/build/src/tools/stage.jam
@@ -478,6 +478,10 @@ class install-target-class : basic-target
return [ sequence.unique $(result2) ] ;
}
+ rule skip-from-usage-requirements ( )
+ {
+ }
+
# Returns true iff 'type' is subtype of some element of 'types-to-include'.
#
local rule include-type ( type : types-to-include * )
diff --git a/tools/build/test/install_build_no.py b/tools/build/test/install_build_no.py
new file mode 100755
index 0000000000..0ccf3c5cc6
--- /dev/null
+++ b/tools/build/test/install_build_no.py
@@ -0,0 +1,26 @@
+#!/usr/bin/python
+
+# Copyright 2021 Dmitry Arkhipov (grisumbras@gmail.com)
+# Distributed under the Boost Software License, Version 1.0.
+# (See accompanying file LICENSE.txt or https://www.bfgroup.xyz/b2/LICENSE.txt)
+
+# Check that <build>no in usage-requirements of dependencies does not affect
+# install rule, i.e. a skipped installed target does not affect insallation of
+# other targets.
+
+import BoostBuild
+
+t = BoostBuild.Tester()
+
+t.write("a.cpp", "int main() {}\n")
+
+t.write("jamroot.jam", """
+make x : : maker : <build>no ;
+exe a : a.cpp ;
+install install : x a ;
+""")
+
+t.run_build_system()
+t.expect_addition("install/a.exe")
+
+t.cleanup()
diff --git a/tools/build/test/test_all.py b/tools/build/test/test_all.py
index b7ef5ad701..9ed729d017 100644
--- a/tools/build/test/test_all.py
+++ b/tools/build/test/test_all.py
@@ -250,6 +250,7 @@ def reorder_tests(tests, first_test):
"inherit_toolset",
"inherited_dependency",
"inline",
+ "install_build_no",
"libjpeg",
"liblzma",
"libpng",

View File

@ -0,0 +1,330 @@
From 41d076ace558cfae01e233f9746dc955dcf78dba Mon Sep 17 00:00:00 2001
From: Andrey Semashev <andrey.semashev@gmail.com>
Date: Sun, 30 Jan 2022 23:41:06 +0300
Subject: [PATCH] Added protection for CVE-2022-21658 in remove_all on POSIX
systems.
Another process could replace the directory being processed by remove_all
with a symlink after remove_all called symlink_status but before
it creates a directory iterator. As a result, remove_all would remove
the linked directory contents instead of removing the symlink.
On POSIX systems that support fdopendir and O_NOFOLLOW flag for open(2),
this can be prevented by opening the directory with O_NOFOLLOW before
iterating. This will fail if the directory was replaced with a symlink.
No protection on other systems.
Reported in https://github.com/boostorg/filesystem/issues/224.
---
libs/filesystem/CMakeLists.txt | 4 ++
libs/filesystem/build/Jamfile.v2 | 1 +
libs/filesystem/config/Jamfile.v2 | 2 +
libs/filesystem/config/has_fdopendir_nofollow.cpp | 20 ++++++
boost/filesystem/directory.hpp | 3 +-
libs/filesystem/src/directory.cpp | 53 ++++++++++++++--
libs/filesystem/src/operations.cpp | 86 ++++++++++++++++----------
7 files changed, 131 insertions(+), 38 deletions(-)
create mode 100644 config/has_fdopendir_nofollow.cpp
diff --git a/libs/filesystem/CMakeLists.txt b/libs/filesystem/CMakeLists.txt
index 5a8678309..37ef7e161 100644
--- a/libs/filesystem/CMakeLists.txt
+++ b/libs/filesystem/CMakeLists.txt
@@ -59,6 +59,7 @@ if(NOT BOOST_FILESYSTEM_DISABLE_STATX)
check_cxx_source_compiles("#include <${CMAKE_CURRENT_SOURCE_DIR}/config/has_statx_syscall.cpp>" BOOST_FILESYSTEM_HAS_STATX_SYSCALL)
endif()
endif()
+check_cxx_source_compiles("#include <${CMAKE_CURRENT_SOURCE_DIR}/config/has_fdopendir_nofollow.cpp>" BOOST_FILESYSTEM_HAS_FDOPENDIR_NOFOLLOW)
if(WIN32 AND NOT BOOST_FILESYSTEM_DISABLE_BCRYPT)
set(CMAKE_REQUIRED_LIBRARIES bcrypt)
check_cxx_source_compiles("#include <${CMAKE_CURRENT_SOURCE_DIR}/config/has_bcrypt.cpp>" BOOST_FILESYSTEM_HAS_BCRYPT)
@@ -170,6 +171,9 @@ endif()
if(BOOST_FILESYSTEM_HAS_STATX_SYSCALL)
target_compile_definitions(boost_filesystem PRIVATE BOOST_FILESYSTEM_HAS_STATX_SYSCALL)
endif()
+if(BOOST_FILESYSTEM_HAS_FDOPENDIR_NOFOLLOW)
+ target_compile_definitions(boost_filesystem PRIVATE BOOST_FILESYSTEM_HAS_FDOPENDIR_NOFOLLOW)
+endif()
target_link_libraries(boost_filesystem
PUBLIC
diff --git a/libs/filesystem/build/Jamfile.v2 b/libs/filesystem/build/Jamfile.v2
index 6ab58ddb8..02e3b8971 100644
--- a/libs/filesystem/build/Jamfile.v2
+++ b/libs/filesystem/build/Jamfile.v2
@@ -112,6 +112,7 @@ project boost/filesystem
[ check-target-builds ../config//has_stat_st_birthtim "has stat::st_birthtim" : <define>BOOST_FILESYSTEM_HAS_STAT_ST_BIRTHTIM ]
[ check-target-builds ../config//has_stat_st_birthtimensec "has stat::st_birthtimensec" : <define>BOOST_FILESYSTEM_HAS_STAT_ST_BIRTHTIMENSEC ]
[ check-target-builds ../config//has_stat_st_birthtimespec "has stat::st_birthtimespec" : <define>BOOST_FILESYSTEM_HAS_STAT_ST_BIRTHTIMESPEC ]
+ [ check-target-builds ../config//has_fdopendir_nofollow "has fdopendir(O_NOFOLLOW)" : <define>BOOST_FILESYSTEM_HAS_FDOPENDIR_NOFOLLOW ]
<conditional>@check-statx
<conditional>@select-windows-crypto-api
<conditional>@check-cxx20-atomic-ref
diff --git a/libs/filesystem/config/Jamfile.v2 b/libs/filesystem/config/Jamfile.v2
index 2e9ee4bd6..5ea7dc6c7 100644
--- a/libs/filesystem/config/Jamfile.v2
+++ b/libs/filesystem/config/Jamfile.v2
@@ -27,6 +27,8 @@ obj has_stat_st_birthtimensec : has_stat_st_birthtimensec.cpp : <include>../src
explicit has_stat_st_birthtimensec ;
obj has_stat_st_birthtimespec : has_stat_st_birthtimespec.cpp : <include>../src ;
explicit has_stat_st_birthtimespec ;
+obj has_fdopendir_nofollow : has_fdopendir_nofollow.cpp : <include>../src ;
+explicit has_fdopendir_nofollow ;
lib bcrypt ;
explicit bcrypt ;
diff --git a/libs/filesystem/config/has_fdopendir_nofollow.cpp b/libs/filesystem/config/has_fdopendir_nofollow.cpp
new file mode 100644
index 000000000..009a73084
--- /dev/null
+++ b/libs/filesystem/config/has_fdopendir_nofollow.cpp
@@ -0,0 +1,20 @@
+// Copyright 2022 Andrey Semashev
+
+// Distributed under the Boost Software License, Version 1.0.
+// See http://www.boost.org/LICENSE_1_0.txt
+
+// See library home page at http://www.boost.org/libs/filesystem
+
+#include "platform_config.hpp"
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <dirent.h>
+#include <fcntl.h>
+
+int main()
+{
+ int fd = open(".", O_DIRECTORY | O_RDONLY | O_NOFOLLOW);
+ DIR* dir = fdopendir(fd);
+ return dir != 0;
+}
diff --git a/boost/filesystem/directory.hpp b/boost/filesystem/directory.hpp
index f487633fc..fa1e69be5 100644
--- a/boost/filesystem/directory.hpp
+++ b/boost/filesystem/directory.hpp
@@ -247,7 +247,8 @@ BOOST_SCOPED_ENUM_UT_DECLARE_BEGIN(directory_options, unsigned int)
skip_dangling_symlinks = 1u << 2, // non-standard extension for recursive_directory_iterator: don't follow dangling directory symlinks,
pop_on_error = 1u << 3, // non-standard extension for recursive_directory_iterator: instead of producing an end iterator on errors,
// repeatedly invoke pop() until it succeeds or the iterator becomes equal to end iterator
- _detail_no_push = 1u << 4 // internal use only
+ _detail_no_follow = 1u << 4, // internal use only
+ _detail_no_push = 1u << 5 // internal use only
}
BOOST_SCOPED_ENUM_DECLARE_END(directory_options)
diff --git a/libs/filesystem/src/directory.cpp b/libs/filesystem/src/directory.cpp
index 554277580..8b41ae5e1 100644
--- a/libs/filesystem/src/directory.cpp
+++ b/libs/filesystem/src/directory.cpp
@@ -2,7 +2,7 @@
// Copyright 2002-2009, 2014 Beman Dawes
// Copyright 2001 Dietmar Kuehl
-// Copyright 2019 Andrey Semashev
+// Copyright 2019, 2022 Andrey Semashev
// Distributed under the Boost Software License, Version 1.0.
// See http://www.boost.org/LICENSE_1_0.txt
@@ -33,6 +33,8 @@
#ifdef BOOST_POSIX_API
+#include <sys/types.h>
+#include <sys/stat.h>
#include <dirent.h>
#include <unistd.h>
#include <fcntl.h>
@@ -47,6 +49,14 @@
#define BOOST_FILESYSTEM_USE_READDIR_R
#endif
+// At least Mac OS X 10.6 and older doesn't support O_CLOEXEC
+#ifndef O_CLOEXEC
+#define O_CLOEXEC 0
+#define BOOST_FILESYSTEM_NO_O_CLOEXEC
+#endif
+
+#include "posix_tools.hpp"
+
#else // BOOST_WINDOWS_API
#include <cwchar>
@@ -206,13 +216,46 @@ inline std::size_t path_max()
#endif // BOOST_FILESYSTEM_USE_READDIR_R
-error_code dir_itr_first(void*& handle, void*& buffer, const char* dir, std::string& target, fs::file_status&, fs::file_status&)
+error_code dir_itr_first(void*& handle, void*& buffer, const char* dir, std::string& target, unsigned int opts, fs::file_status&, fs::file_status&)
{
- if ((handle = ::opendir(dir)) == 0)
+#if defined(BOOST_FILESYSTEM_HAS_FDOPENDIR_NOFOLLOW)
+ int flags = O_DIRECTORY | O_RDONLY | O_NDELAY | O_CLOEXEC;
+ if ((opts & static_cast< unsigned int >(directory_options::_detail_no_follow)) != 0u)
+ flags |= O_NOFOLLOW;
+
+ int fd = ::open(dir, flags);
+ if (BOOST_UNLIKELY(fd < 0))
+ {
+ const int err = errno;
+ return error_code(err, system_category());
+ }
+
+#if defined(BOOST_FILESYSTEM_NO_O_CLOEXEC) && defined(FD_CLOEXEC)
+ int res = ::fcntl(fd, F_SETFD, FD_CLOEXEC);
+ if (BOOST_UNLIKELY(res < 0))
+ {
+ const int err = errno;
+ close_fd(fd);
+ return error_code(err, system_category());
+ }
+#endif
+
+ handle = ::fdopendir(fd);
+ if (BOOST_UNLIKELY(!handle))
{
const int err = errno;
+ close_fd(fd);
return error_code(err, system_category());
}
+#else // defined(BOOST_FILESYSTEM_HAS_FDOPENDIR_NOFOLLOW)
+ handle = ::opendir(dir);
+ if (BOOST_UNLIKELY(!handle))
+ {
+ const int err = errno;
+ return error_code(err, system_category());
+ }
+#endif // defined(BOOST_FILESYSTEM_HAS_FDOPENDIR_NOFOLLOW)
+
target.assign("."); // string was static but caused trouble
// when iteration called from dtor, after
// static had already been destroyed
@@ -342,7 +385,7 @@ error_code dir_itr_increment(void*& handle, void*& buffer, std::string& target,
#else // BOOST_WINDOWS_API
-error_code dir_itr_first(void*& handle, fs::path const& dir, std::wstring& target, fs::file_status& sf, fs::file_status& symlink_sf)
+error_code dir_itr_first(void*& handle, fs::path const& dir, std::wstring& target, unsigned int opts, fs::file_status& sf, fs::file_status& symlink_sf)
// Note: an empty root directory has no "." or ".." entries, so this
// causes a ERROR_FILE_NOT_FOUND error which we do not considered an
// error. It is treated as eof instead.
@@ -512,7 +555,7 @@ void directory_iterator_construct(directory_iterator& it, path const& p, unsigne
#if defined(BOOST_POSIX_API)
imp->buffer,
#endif
- p.c_str(), filename, file_stat, symlink_file_stat);
+ p.c_str(), filename, opts, file_stat, symlink_file_stat);
if (result)
{
diff --git a/libs/filesystem/src/operations.cpp b/libs/filesystem/src/operations.cpp
index e14b598b7..bf42105b9 100644
--- a/libs/filesystem/src/operations.cpp
+++ b/libs/filesystem/src/operations.cpp
@@ -945,51 +945,73 @@ inline bool remove_impl(path const& p, error_code* ec)
//! remove_all() implementation
uintmax_t remove_all_impl(path const& p, error_code* ec)
{
- fs::file_type type;
+ for (unsigned int attempt = 0u; attempt < 5u; ++attempt)
{
- error_code local_ec;
- type = fs::detail::symlink_status(p, &local_ec).type();
+ fs::file_type type;
+ {
+ error_code local_ec;
+ type = fs::detail::symlink_status(p, &local_ec).type();
- if (type == fs::file_not_found)
- return 0u;
+ if (type == fs::file_not_found)
+ return 0u;
- if (BOOST_UNLIKELY(type == fs::status_error))
- {
- if (!ec)
- BOOST_FILESYSTEM_THROW(filesystem_error("boost::filesystem::remove_all", p, local_ec));
+ if (BOOST_UNLIKELY(type == fs::status_error))
+ {
+ if (!ec)
+ BOOST_FILESYSTEM_THROW(filesystem_error("boost::filesystem::remove_all", p, local_ec));
- *ec = local_ec;
- return static_cast< uintmax_t >(-1);
+ *ec = local_ec;
+ return static_cast< uintmax_t >(-1);
+ }
}
- }
- uintmax_t count = 0u;
+ uintmax_t count = 0u;
- if (type == fs::directory_file) // but not a directory symlink
- {
- fs::directory_iterator itr;
- fs::detail::directory_iterator_construct(itr, p, static_cast< unsigned int >(directory_options::none), ec);
- if (ec && *ec)
- return static_cast< uintmax_t >(-1);
-
- const fs::directory_iterator end_dit;
- while (itr != end_dit)
+ if (type == fs::directory_file) // but not a directory symlink
{
- count += fs::detail::remove_all_impl(itr->path(), ec);
- if (ec && *ec)
- return static_cast< uintmax_t >(-1);
+ fs::directory_iterator itr;
+ error_code local_ec;
+ fs::detail::directory_iterator_construct(itr, p, static_cast< unsigned int >(directory_options::_detail_no_follow), &local_ec);
+ if (BOOST_UNLIKELY(!!local_ec))
+ {
+#if defined(BOOST_FILESYSTEM_HAS_FDOPENDIR_NOFOLLOW)
+ // If open(2) with O_NOFOLLOW fails with ELOOP, this means that either the path contains a loop
+ // of symbolic links, or the last element of the path is a symbolic link. Given that lstat(2) above
+ // did not fail, most likely it is the latter case. I.e. between the lstat above and this open call
+ // the filesystem was modified so that the path no longer refers to a directory file (as opposed to a symlink).
+ if (local_ec == error_code(ELOOP, system_category()))
+ continue;
+#endif // defined(BOOST_FILESYSTEM_HAS_FDOPENDIR_NOFOLLOW)
- fs::detail::directory_iterator_increment(itr, ec);
- if (ec && *ec)
+ if (!ec)
+ BOOST_FILESYSTEM_THROW(filesystem_error("boost::filesystem::remove_all", p, local_ec));
+
+ *ec = local_ec;
return static_cast< uintmax_t >(-1);
+ }
+
+ const fs::directory_iterator end_dit;
+ while (itr != end_dit)
+ {
+ count += fs::detail::remove_all_impl(itr->path(), ec);
+ if (ec && *ec)
+ return static_cast< uintmax_t >(-1);
+
+ fs::detail::directory_iterator_increment(itr, ec);
+ if (ec && *ec)
+ return static_cast< uintmax_t >(-1);
+ }
}
- }
- count += fs::detail::remove_impl(p, type, ec);
- if (ec && *ec)
- return static_cast< uintmax_t >(-1);
+ count += fs::detail::remove_impl(p, type, ec);
+ if (ec && *ec)
+ return static_cast< uintmax_t >(-1);
- return count;
+ return count;
+ }
+
+ emit_error(ELOOP, p, ec, "boost::filesystem::remove_all: path cannot be opened as a directory");
+ return static_cast< uintmax_t >(-1);
}
#else // defined(BOOST_POSIX_API)

View File

@ -0,0 +1,23 @@
From dbec3baaadf7d899e66aa90843d285e749e88b2d Mon Sep 17 00:00:00 2001
From: Andrey Semashev <andrey.semashev@gmail.com>
Date: Thu, 3 Feb 2022 20:58:42 +0300
Subject: [PATCH] Use O_NONBLOCK instead of O_NDELAY as it is the flag defined
by POSIX.
---
libs/filesystem/src/directory.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libs/filesystem/src/directory.cpp b/libs/filesystem/src/directory.cpp
index 8b41ae5e1..dd2f9413b 100644
--- a/libs/filesystem/src/directory.cpp
+++ b/libs/filesystem/src/directory.cpp
@@ -219,7 +219,7 @@ inline std::size_t path_max()
error_code dir_itr_first(void*& handle, void*& buffer, const char* dir, std::string& target, unsigned int opts, fs::file_status&, fs::file_status&)
{
#if defined(BOOST_FILESYSTEM_HAS_FDOPENDIR_NOFOLLOW)
- int flags = O_DIRECTORY | O_RDONLY | O_NDELAY | O_CLOEXEC;
+ int flags = O_DIRECTORY | O_RDONLY | O_NONBLOCK | O_CLOEXEC;
if ((opts & static_cast< unsigned int >(directory_options::_detail_no_follow)) != 0u)
flags |= O_NOFOLLOW;

View File

@ -0,0 +1,40 @@
From d65e2888de8097f28453b92fdd1770805c0f4063 Mon Sep 17 00:00:00 2001
From: Liu Zixian <liuzixian4@huawei.com>
Date: Mon, 12 Dec 2022 12:36:42 +0800
Subject: [PATCH] Skip performance test
Performance test in CI does not make sense.
On x86-64, this test caused a float point exception,
for the test data is too weak to generate an execution time
larger than the timer precision.
[ 298s] ====== BEGIN OUTPUT ======
[ 298s] Generating graph...10000 vertices, 100000 edges.
[ 298s] Running Dijkstra's with binary heap... 0.003279s wall, 0.000000s user + 0.000000s system = 0.000000s CPU (n/a%)
[ 298s] seconds.
[ 298s] Running Dijkstra's with d-ary heap (d=4)...
[ 298s] EXIT STATUS: 136
[ 298s] ====== END OUTPUT ======
Signed-off-by: Liu Zixian <liuzixian4@huawei.com>
---
libs/graph/test/Jamfile.v2 | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libs/graph/test/Jamfile.v2 b/libs/graph/test/Jamfile.v2
index a0c15ca7b..a6273b659 100644
--- a/libs/graph/test/Jamfile.v2
+++ b/libs/graph/test/Jamfile.v2
@@ -47,7 +47,7 @@ alias graph_test_regular :
[ run undirected_dfs.cpp ]
[ compile dfs_cc.cpp ]
[ compile dijkstra_cc.cpp ]
- [ run dijkstra_heap_performance.cpp /boost/timer//boost_timer : 10000 ]
+ # [ run dijkstra_heap_performance.cpp /boost/timer//boost_timer : 10000 ]
[ run dijkstra_no_color_map_compare.cpp : 10000 ]
[ run disjoint_set_test.cpp ]
[ run dominator_tree_test.cpp ]
--
2.33.0

View File

@ -0,0 +1,36 @@
From 1d176e542576e7e584eccd3e2badca33231768c1 Mon Sep 17 00:00:00 2001
From: Liu Zixian <liuzixian4@huawei.com>
Date: Mon, 12 Dec 2022 20:12:26 +0800
Subject: [PATCH] Avoid gcc bugs
This testcase triggers a gcc optimization bug.
See https://gitee.com/src-openeuler/gcc/issues/I65UF9
Signed-off-by: Liu Zixian <liuzixian4@huawei.com>
---
libs/icl/test/fix_tickets_/fix_tickets.cpp | 2 ++
1 file changed, 2 insertions(+)
diff --git a/libs/icl/test/fix_tickets_/fix_tickets.cpp b/libs/icl/test/fix_tickets_/fix_tickets.cpp
index 0232c3194..fc207e3f0 100644
--- a/libs/icl/test/fix_tickets_/fix_tickets.cpp
+++ b/libs/icl/test/fix_tickets_/fix_tickets.cpp
@@ -74,6 +74,7 @@ BOOST_AUTO_TEST_CASE(ticket_6095_Marvin_Sielenkemper_isEmptyTest)
BOOST_CHECK( icl::is_empty(Interval::open(max, max)));
}
+#ifndef __GNUC__
BOOST_AUTO_TEST_CASE(ticket_6095_Marvin_Sielenkemper_totalRangeTest)
{
typedef int Value;
@@ -90,6 +91,7 @@ BOOST_AUTO_TEST_CASE(ticket_6095_Marvin_Sielenkemper_totalRangeTest)
BOOST_CHECK_EQUAL(intervals.iterative_size(), 3);
}
+#endif
BOOST_AUTO_TEST_CASE(test_ticket_7871)
{
--
2.36.1

View File

@ -1,36 +1,33 @@
From daf4ef50c88c2b9a6bf2c40b537eebc202caad6e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=A9bastien=20Gonzalve?=
<sebastien.gonzalve@aliceadsl.fr>
Date: Sat, 14 Nov 2020 10:39:47 +0100
Subject: [PATCH] Do not try to access element when vector is empty
From 1ff0ead837b32b9415dc840dfef6549e8754b98d Mon Sep 17 00:00:00 2001
From: Alexander Grund <Flamefire@users.noreply.github.com>
Date: Fri, 10 Dec 2021 17:53:01 +0100
Subject: [PATCH] Fix access to first element of empty vector
Trying to access tmp[0] causes a crash on Fedora when assertion on STL
are enabled.
/usr/include/c++/10/bits/stl_vector.h:1045: std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::operator[](std::vector<_Tp, _Alloc>::size_type) [with _Tp = unsigned char; _Alloc = std::allocator<unsigned char>; std::vector<_Tp, _Alloc>::reference = unsigned char&; std::vector<_Tp, _Alloc>::size_type = long unsigned int]: Assertion '__builtin_expect(__n < this->size(), true)' failed.
This patch just passes nullptr as pointer to getSortKey() when tmp size
is 0, preventing dereferencing elements in empty vector.
I guess that &tmp[0] should be optimized as 'no real access' when
disabling assertion, but actually leads to crash when assert are
enabled.
Fix is to never have an empty vector as ICU sort keys include the NULL
terminator, hence we need at least `length + 1` bytes which means the
vector has at least 1 element: The NULL terminator
---
src/icu/collator.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
src/icu/collator.cpp | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/libs/locale/src/icu/collator.cpp b/libs/locale/src/icu/collator.cpp
index 7f1ea6a..dc59e8c 100644
index 7f1ea6ae..79668aa6 100644
--- a/libs/locale/src/icu/collator.cpp
+++ b/libs/locale/src/icu/collator.cpp
@@ -93,7 +93,7 @@ namespace boost {
@@ -91,9 +91,9 @@ namespace boost {
{
icu::UnicodeString str=cvt_.icu(b,e);
std::vector<uint8_t> tmp;
tmp.resize(str.length());
- tmp.resize(str.length());
+ tmp.resize(str.length() + 1u);
icu::Collator *collate = get_collator(level);
- int len = collate->getSortKey(str,&tmp[0],tmp.size());
+ int len = collate->getSortKey(str,tmp.empty()?nullptr:&tmp[0],tmp.size());
+ const int len = collate->getSortKey(str,&tmp[0],tmp.size());
if(len > int(tmp.size())) {
tmp.resize(len);
collate->getSortKey(str,&tmp[0],tmp.size());
--
2.26.2

View File

@ -1,47 +1,68 @@
Index: boost/pool/pool.hpp
===================================================================
--- boost/pool/pool.hpp (revision 78317)
+++ boost/pool/pool.hpp (revision 78326)
@@ -27,4 +27,6 @@
From acb849a8a16499907c554a3c00da201486388459 Mon Sep 17 00:00:00 2001
From: Orgad Shaneh <orgads@gmail.com>
Date: Thu, 4 Nov 2021 03:39:23 +0200
Subject: [PATCH] fix integer overflows in pool::ordered_malloc (#42)
Fixes trac #6701 (https://svn.boost.org/trac10/ticket/6701).
Originally-by: Jonathan Wakely <jwakely.boost@kayari.org>
---
boost/pool/pool.hpp | 31 ++++++++++++++++++++++---------
libs/pool/test/Jamfile.v2 | 1 +
libs/pool/test/suppressions.txt | 7 +++++++
libs/pool/test/test_bug_6701.cpp | 27 +++++++++++++++++++++++++++
4 files changed, 57 insertions(+), 9 deletions(-)
create mode 100644 libs/pool/test/suppressions.txt
create mode 100644 libs/pool/test/test_bug_6701.cpp
diff --git a/boost/pool/pool.hpp b/boost/pool/pool.hpp
index c47b11faf..12728a7ae 100644
--- a/boost/pool/pool.hpp
+++ b/boost/pool/pool.hpp
@@ -26,6 +26,8 @@
#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 @@
// boost::simple_segregated_storage
@@ -355,6 +357,12 @@ class pool: protected simple_segregated_storage < typename UserAllocator::size_t
return s;
}
+ 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 @@
//! (Provided and used for the sake of code readability :)
@@ -375,6 +383,8 @@ class pool: protected simple_segregated_storage < typename UserAllocator::size_t
//! 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.
//! \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 @@
~pool()
@@ -398,8 +408,8 @@ class pool: protected simple_segregated_storage < typename UserAllocator::size_t
}
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.
{ //! 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 @@
{ //! \returns max_size.
@@ -407,7 +417,8 @@ class pool: protected simple_segregated_storage < typename UserAllocator::size_t
}
void set_max_size(const size_type nmax_size)
{ //! Set max_size.
- max_size = nmax_size;
@ -49,7 +70,9 @@ Index: boost/pool/pool.hpp
+ max_size = min BOOST_PREVENT_MACRO_SUBSTITUTION(nmax_size, max_chunks());
}
size_type get_requested_size() const
@@ -713,7 +727,7 @@
{ //! \returns the requested size passed into the constructor.
@@ -708,9 +719,9 @@ void * pool<UserAllocator>::malloc_need_resize()
BOOST_USING_STD_MIN();
if(!max_size)
- next_size <<= 1;
@ -59,7 +82,9 @@ Index: boost/pool/pool.hpp
+ set_next_size(min BOOST_PREVENT_MACRO_SUBSTITUTION(next_size << 1, max_size * requested_size / partition_size));
// initialize it,
@@ -753,7 +767,7 @@
store().add_block(node.begin(), node.element_size(), partition_size);
@@ -748,9 +759,9 @@ void * pool<UserAllocator>::ordered_malloc_need_resize()
BOOST_USING_STD_MIN();
if(!max_size)
- next_size <<= 1;
@ -69,14 +94,18 @@ Index: boost/pool/pool.hpp
+ set_next_size(min BOOST_PREVENT_MACRO_SUBSTITUTION(next_size << 1, max_size * requested_size / partition_size));
// initialize it,
@@ -797,4 +811,6 @@
// (we can use "add_block" here because we know that
@@ -792,6 +803,8 @@ void * pool<UserAllocator>::ordered_malloc(const size_type n)
{ //! Gets address of a chunk n, allocating new memory if not already available.
//! \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 @@
const size_type total_req_size = n * requested_size;
@@ -840,9 +853,9 @@ void * pool<UserAllocator>::ordered_malloc(const size_type n)
BOOST_USING_STD_MIN();
if(!max_size)
- next_size <<= 1;
@ -86,14 +115,41 @@ Index: boost/pool/pool.hpp
+ 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)
// handle border case.
diff --git a/libs/pool/test/Jamfile.v2 b/libs/pool/test/Jamfile.v2
index 9e96abcbd..133879a93 100644
--- a/libs/pool/test/Jamfile.v2
+++ b/libs/pool/test/Jamfile.v2
@@ -34,6 +34,7 @@ test-suite pool :
<toolset>pathscale:<cxxflags>-Wno-long-long ]
[ run test_bug_2696.cpp ]
[ run test_bug_5526.cpp ]
+ [ run test_bug_6701.cpp ]
[ run test_threading.cpp : : : <threading>multi <library>/boost/thread//boost_thread ]
[ compile test_poisoned_macros.cpp ]
;
diff --git a/libs/pool/test/suppressions.txt b/libs/pool/test/suppressions.txt
new file mode 100644
index 000000000..e30fb813c
--- /dev/null
+++ b/libs/pool/test/suppressions.txt
@@ -0,0 +1,7 @@
+{
+ no_fishy_value
+ Memcheck:FishyValue
+ __builtin_vec_new(size)
+ fun:_ZnamRKSt9nothrow_t
+ ...
+}
diff --git a/libs/pool/test/test_bug_6701.cpp b/libs/pool/test/test_bug_6701.cpp
new file mode 100644
index 000000000..e484d3c7e
--- /dev/null
+++ b/libs/pool/test/test_bug_6701.cpp
@@ -0,0 +1,27 @@
+/* Copyright (C) 2012 Étienne Dupuis
+*
+* Use, modification and distribution is subject to the
+*
+* 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)
+*/
@ -109,7 +165,7 @@ Index: libs/pool/test/test_bug_6701.cpp
+
+ 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());
+
@ -118,3 +174,6 @@ Index: libs/pool/test/test_bug_6701.cpp
+
+ return 0;
+}
--
2.33.1

View File

@ -0,0 +1,24 @@
From 1dc6d74f2d673b7b82dd02ff8cdaf04b60fb5ff8 Mon Sep 17 00:00:00 2001
From: Denis Arnaud <denis.arnaud_github@m4x.org>
Date: Sun, 15 Aug 2021 17:05:31 +0200
Subject: [PATCH] Update call_method.hpp
Was missing from https://github.com/boostorg/python/pull/320
I've tested it on one of my projects with (that patch on) Boost.Python/Boost 1.76.0 and it works well. Without that patch, there is a deprecation error.
---
boost/python/call_method.hpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/boost/python/call_method.hpp b/boost/python/call_method.hpp
index 424077eab4..2f360791d7 100644
--- a/boost/python/call_method.hpp
+++ b/boost/python/call_method.hpp
@@ -59,7 +59,7 @@ call_method(PyObject* self, char const* name
)
{
PyObject* const result =
- PyEval_CallMethod(
+ PyObject_CallMethod(
self
, const_cast<char*>(name)
, const_cast<char*>("(" BOOST_PP_REPEAT_1ST(N, BOOST_PYTHON_FIXED, "O") ")")

1090
boost.spec

File diff suppressed because it is too large Load Diff

1940
boost_1_78_0-sw.patch Executable file

File diff suppressed because it is too large Load Diff

View File

@ -1,21 +0,0 @@
changequote(`[', `]')dnl
/* GNU ld script
Boost.Thread header files pull in enough of Boost.System that
symbols from the latter library are referenced by a compiled object
that includes Boost.Thread headers. libboost_system-mt.so is among
libboost_thread-mt.so's DT_NEEDED, but program linker requires that
missing symbols are satisfied by direct dependency, not by a
transitive one. Hence this linker script, which brings in the
Boost.System DSO. */
INPUT(libboost_thread.so.VERSION)
INPUT(libboost_system.so.VERSION)
ifdef([HAS_ATOMIC_FLAG_LOCKFREE],[],
[
/* If the given architecture doesn't have lock-free implementation of
boost::atomic_flag, the dependency on Boost.Atomic may leak from
the header files to client binaries. */
INPUT(libboost_atomic.so.VERSION)
])dnl

View File

@ -1,33 +0,0 @@
From 91107fe78a290a7d25a042fec09ea89f14f480d9 Mon Sep 17 00:00:00 2001
From: xuhuijie <xuhuijie2@huawei.com>
Date: Wed, 16 Jun 2021 15:47:22 +0800
Subject: [PATCH] regex: fix dead loop in parse_repea
There is a bug in parse_repeat(), after deal with comment the
contin value will be always true. So we enter a dead loop. To deal with this,
we assign contin to false each time we enter the loop.
Testcase: boost::regex(std::string("1?+(?#)1"))
Signed-off-by: Xu Huijie <xuhuijie2@huawei.com>
---
boost/regex/v4/basic_regex_parser.hpp | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/boost/regex/v4/basic_regex_parser.hpp b/boost/regex/v4/basic_regex_parser.hpp
index 6c7065f05..de22f7000 100644
--- a/boost/regex/v4/basic_regex_parser.hpp
+++ b/boost/regex/v4/basic_regex_parser.hpp
@@ -1080,9 +1080,10 @@ bool basic_regex_parser<charT, traits>::parse_repeat(std::size_t low, std::size_
// Check for illegal following quantifier, we have to do this here, because
// the extra states we insert below circumvents our usual error checking :-(
//
- bool contin = false;
+ bool contin;
do
{
+ contin = false;
if ((this->flags() & (regbase::main_option_type | regbase::mod_x | regbase::no_perl_ex)) == regbase::mod_x)
{
// whitespace skip:
--
2.23.0