Compare commits

..

45 Commits

Author SHA1 Message Date
openeuler-ci-bot
083bee3feb
!137 [sync] PR-135: Init support for ppc64le
From: @openeuler-sync-bot 
Reviewed-by: @liqingqing_1229 
Signed-off-by: @liqingqing_1229
2024-06-18 06:08:17 +00:00
hefq343
6e1fabcfe6 Init support for ppc64le
Signed-off-by: hefq343 <fengqing.he@shingroup.cn>
(cherry picked from commit eee40c2b6e)
2024-06-18 11:12:15 +08:00
openeuler-ci-bot
3dc5224fc5
!116 修复riscv64上lockfree测试错误
From: @laokz 
Reviewed-by: @liqingqing_1229 
Signed-off-by: @liqingqing_1229
2023-08-14 08:20:09 +00:00
laokz
28c9b15a36 add -latomic flag to lockfree tests for riscv64
Boost does not implement atomic functions for RISC-V, and depend
that on compiler. For 16-byte atomic ops, the compiler must link
against libatomic.
2023-08-14 15:09:46 +08:00
openeuler-ci-bot
064431c6de
!119 [sync] PR-117: 添加龙芯架构支持
From: @openeuler-sync-bot 
Reviewed-by: @liqingqing_1229 
Signed-off-by: @liqingqing_1229
2023-08-14 01:14:42 +00:00
herengui
d1626d9b6a add loongarch64 support
Signed-off-by: herengui <herengui@kylinsec.com.cn>
(cherry picked from commit 974a103562)
2023-08-14 09:12:03 +08:00
openeuler-ci-bot
805adb2fa9
!111 [sync] PR-109: 打开容器与算法类子库的回归测试
From: @openeuler-sync-bot 
Reviewed-by: @liqingqing_1229 
Signed-off-by: @liqingqing_1229
2022-12-12 12:38:28 +00:00
Liu Zixian
2fd3052694 enable more tests
(cherry picked from commit 649cd39840)
2022-12-12 20:37:12 +08:00
openeuler-ci-bot
1944d7ef95
!107 [sync] PR-106: 打开部分子包的回归测试
From: @openeuler-sync-bot 
Reviewed-by: @liqingqing_1229 
Signed-off-by: @liqingqing_1229
2022-12-12 06:24:21 +00:00
Liu Zixian
a44372cbad enable some regression test
(cherry picked from commit 63d709bbb8)
2022-12-12 14:23:23 +08:00
openeuler-ci-bot
2410599445
!99 [sync] PR-97: 添加sw架构
From: @openeuler-sync-bot 
Reviewed-by: @liqingqing_1229 
Signed-off-by: @liqingqing_1229
2022-10-21 01:06:01 +00:00
wzx
852904f88a Add sw64 architecture
Signed-off-by: wzx <wuzx1226@qq.com>
(cherry picked from commit ba859fadb5)
2022-10-21 09:04:35 +08:00
openeuler-ci-bot
259df3169b
!86 [sync] PR-84: fix security issue
From: @openeuler-sync-bot 
Reviewed-by: @liqingqing_1229 
Signed-off-by: @liqingqing_1229
2022-03-21 06:22:30 +00:00
Liu Zixian
c95f968fd9 filesystem: backport upstream security patches
(cherry picked from commit 70c2a6f02c)
2022-03-21 10:50:17 +08:00
openeuler-ci-bot
6def39517a
!83 [sync] PR-81: fix boost-example
From: @openeuler-sync-bot 
Reviewed-by: @liqingqing_1229 
Signed-off-by: @liqingqing_1229
2022-03-02 13:49:17 +00:00
sdlzx
751c86c1a3 fix boost-example
(cherry picked from commit b23355954b)
2022-03-02 17:29:05 +08:00
openeuler-ci-bot
c18d88b852
!78 Fix build warnings
From: @sdlzx 
Reviewed-by: @liqingqing_1229 
Signed-off-by: @liqingqing_1229
2022-02-17 02:19:57 +00:00
Liu Zixian
7f77186e70 fix build warnings 2022-02-03 21:16:02 +08:00
openeuler-ci-bot
68c24a2bb5
!76 [sync] PR-74: simplify %build
Merge pull request !76 from openeuler-sync-bot/sync-pr74-master-to-openEuler-22.03-LTS-Next
2022-01-30 03:47:52 +00:00
Liu Zixian
d2febf0300 simplify %build
(cherry picked from commit 397010b3ac)
2022-01-30 10:22:14 +08:00
openeuler-ci-bot
974577c509
!71 fix boost-build known issue
Merge pull request !71 from sdlzx/openEuler-22.03-LTS-Next
2022-01-28 06:25:44 +00:00
Liu Zixian
0fd9080c13 fix build known issue 2022-01-28 11:09:41 +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
21 changed files with 3778 additions and 700 deletions

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

@ -0,0 +1,33 @@
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.
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 | 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 7f1ea6ae..79668aa6 100644
--- a/libs/locale/src/icu/collator.cpp
+++ b/libs/locale/src/icu/collator.cpp
@@ -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() + 1u);
icu::Collator *collate = get_collator(level);
- int len = collate->getSortKey(str,&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());

View File

@ -0,0 +1,179 @@
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>
// 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 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.
//! (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.
+ set_next_size(nnext_size);
+ set_max_size(nmax_size);
}
~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.
- //! \returns nnext_size.
- next_size = start_size = nnext_size;
+ BOOST_USING_STD_MIN();
+ next_size = start_size = min BOOST_PREVENT_MACRO_SUBSTITUTION(nnext_size, max_chunks());
}
size_type get_max_size() const
{ //! \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;
+ BOOST_USING_STD_MIN();
+ max_size = min BOOST_PREVENT_MACRO_SUBSTITUTION(nmax_size, max_chunks());
}
size_type get_requested_size() const
{ //! \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;
+ 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,
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;
+ 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,
// (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();
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;
+ 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,
// 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
+* 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;
+}
--
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") ")")

View File

@ -1,25 +0,0 @@
From f58f3df2bf54fd820bd2c043e5000a7c90144804 Mon Sep 17 00:00:00 2001
From: Liu Zixian <liuzixian4@huawei.com>
Date: Thu, 15 Dec 2022 21:31:43 -0500
Subject: [PATCH] Don't run performance test in CI
---
libs/graph/test/Jamfile.v2 | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/libs/graph/test/Jamfile.v2 b/libs/graph/test/Jamfile.v2
index a0c15ca7b..c882916a7 100644
--- a/libs/graph/test/Jamfile.v2
+++ b/libs/graph/test/Jamfile.v2
@@ -47,7 +47,10 @@ 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 ]
+
+ # Performance benchmark
+ #[ 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 ]

View File

@ -1,27 +0,0 @@
From 50973dc10ea16931245ea61a00b2ce9041acc5ba Mon Sep 17 00:00:00 2001
From: Stephan Bergmann <sbergman@redhat.com>
Date: Wed, 4 Jan 2023 17:33:31 +0100
Subject: [PATCH] Avoid boost::phoenix::placeholders::uarg1..10 ODR violations
Those variables, defined in an include file, had external linkage, causing ODR
violations. Make them const to implicitly give them internal linkage.
---
boost/phoenix/stl/tuple.hpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/boost/phoenix/stl/tuple.hpp b/boost/phoenix/stl/tuple.hpp
index a83014a..7f61a40 100644
--- a/boost/phoenix/stl/tuple.hpp
+++ b/boost/phoenix/stl/tuple.hpp
@@ -110,7 +110,7 @@ namespace boost { namespace phoenix {
namespace placeholders {
#define BOOST_PP_LOCAL_LIMITS (1, BOOST_PHOENIX_ARG_LIMIT)
#define BOOST_PP_LOCAL_MACRO(N) \
- auto uarg##N = \
+ auto const uarg##N = \
boost::phoenix::get_<(N)-1>(boost::phoenix::placeholders::arg1);
#include BOOST_PP_LOCAL_ITERATE()
}
--
2.27.0

View File

@ -1,30 +0,0 @@
From 4239d93dad32a11e4c3829050f8070d456266133 Mon Sep 17 00:00:00 2001
From: jzmaddock <john@johnmaddock.co.uk>
Date: Wed, 1 Jun 2022 19:35:36 +0100
Subject: [PATCH] Update multiprecision_float_test.cpp to not overflow type
double. Previously the max value for uint1024_t could just squeeze into a
double because truncation occurred during the conversion, now that cpp_int
performs correctly rounded conversions, overflow occurs, and the computation
fails. Changed the problem distribution to use a multiprecision weight type,
rather than double.
---
libs/random/test/multiprecision_float_test.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libs/random/test/multiprecision_float_test.cpp b/libs/random/test/multiprecision_float_test.cpp
index bc2a936..2b53483 100644
--- a/libs/random/test/multiprecision_float_test.cpp
+++ b/libs/random/test/multiprecision_float_test.cpp
@@ -77,7 +77,7 @@ typedef boost::mpl::list <
boost::random::lognormal_distribution<big_float>,
boost::random::normal_distribution<big_float>,
#ifndef BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS
- boost::random::piecewise_constant_distribution<big_float>,
+ boost::random::piecewise_constant_distribution<big_float, big_float>,
boost::random::piecewise_linear_distribution<big_float>,
#endif
boost::random::student_t_distribution<big_float>,
--
2.33.0

View File

@ -1,34 +0,0 @@
From 7561690135c67ecf88c2133bad7680ebd2665c36 Mon Sep 17 00:00:00 2001
From: jzmaddock <john@johnmaddock.co.uk>
Date: Wed, 1 Jun 2022 19:32:55 +0100
Subject: [PATCH] Update multiprecision_int_test.cpp to not accidentality
overflow type double. Multiprecision now performs correct rounding when
converting to double - previously the max value for uint1024_t would just fit
in a double if it was truncated. But now that it's correctly rounded it
overflows and breaks the calculation.
---
libs/random/test/multiprecision_int_test.cpp | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/libs/random/test/multiprecision_int_test.cpp b/libs/random/test/multiprecision_int_test.cpp
index 41ec229..a861cca 100644
--- a/libs/random/test/multiprecision_int_test.cpp
+++ b/libs/random/test/multiprecision_int_test.cpp
@@ -215,8 +215,11 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(discrete_distributions, distribution_type, other_d
distribution_type d2;
ss >> d2;
BOOST_CHECK(d == d2);
-
- boost::random::independent_bits_engine<boost::random::mt19937, std::numeric_limits<boost::multiprecision::uint1024_t>::digits, boost::multiprecision::uint1024_t > big_random;
+ //
+ // The number of digits in the independent_bits_engine must be low enough that we don't overflow
+ // when converting to a double (see other_distributions declared above).
+ //
+ boost::random::independent_bits_engine<boost::random::mt19937, std::numeric_limits<boost::multiprecision::uint1024_t>::digits - 2, boost::multiprecision::uint1024_t > big_random;
for(unsigned i = 0; i < 200; ++i)
{
result_type r = d(big_random);
--
2.33.0

View File

@ -1,37 +0,0 @@
From c3ada7a1b2b54f4b27585f72308a76984f8489b4 Mon Sep 17 00:00:00 2001
From: jzmaddock <john@johnmaddock.co.uk>
Date: Tue, 16 Mar 2021 10:47:16 +0000
Subject: [PATCH] Add missing #includes.
---
test/multiprecision_float_test.cpp | 1 +
test/multiprecision_int_test.cpp | 1 +
2 files changed, 2 insertions(+)
diff --git a/libs/random/test/multiprecision_float_test.cpp b/libs/random/test/multiprecision_float_test.cpp
index 904c59d..bc2a936 100644
--- a/libs/random/test/multiprecision_float_test.cpp
+++ b/libs/random/test/multiprecision_float_test.cpp
@@ -20,6 +20,7 @@
#include <boost/multiprecision/debug_adaptor.hpp>
#include <boost/scoped_ptr.hpp>
#include <boost/random.hpp>
+#include <boost/mpl/list.hpp>
#include <sstream>
diff --git a/libs/random/test/multiprecision_int_test.cpp b/libs/random/test/multiprecision_int_test.cpp
index 577e52a..41ec229 100644
--- a/libs/random/test/multiprecision_int_test.cpp
+++ b/libs/random/test/multiprecision_int_test.cpp
@@ -32,6 +32,7 @@
#include <boost/random/uniform_int.hpp>
#include <boost/random/uniform_smallint.hpp>
#include <boost/random/discrete_distribution.hpp>
+#include <boost/mpl/list.hpp>
#include <sstream>
typedef boost::mpl::list <
--
2.33.0

View File

@ -1,31 +0,0 @@
Index: boost_1_80_0/tools/boost_install/boost-install.jam
===================================================================
--- boost_1_80_0.orig/tools/boost_install/boost-install.jam
+++ boost_1_80_0/tools/boost_install/boost-install.jam
@@ -753,25 +753,6 @@ rule generate-cmake-config- ( target : s
"get_filename_component(_BOOST_CMAKEDIR \"${CMAKE_CURRENT_LIST_DIR}/../\" REALPATH)"
: true ;
- if [ path.is-rooted $(cmakedir) ]
- {
- local cmakedir-native = [ path-native-fwd $(cmakedir) ] ;
-
- print.text
-
- ""
- "# If the computed and the original directories are symlink-equivalent, use original"
- "if(EXISTS \"$(cmakedir-native)\")"
- " get_filename_component(_BOOST_CMAKEDIR_ORIGINAL \"$(cmakedir-native)\" REALPATH)"
- " if(_BOOST_CMAKEDIR STREQUAL _BOOST_CMAKEDIR_ORIGINAL)"
- " set(_BOOST_CMAKEDIR \"$(cmakedir-native)\")"
- " endif()"
- " unset(_BOOST_CMAKEDIR_ORIGINAL)"
- "endif()"
- ""
- : true ;
- }
-
get-dir "_BOOST_INCLUDEDIR" : $(includedir) ;
if $(library-type) = INTERFACE

View File

@ -1,25 +1,37 @@
%global version_enc 1_83_0
%global version_enc 1_78_0
Name: boost
Version: 1.83.0
Release: 4
Version: 1.78.0
Release: 18
Summary: The free peer-reviewed portable C++ source libraries
License: BSL-1.0
License: Boost Software License 1.0
URL: http://www.boost.org
Source0: https://boostorg.jfrog.io/ui/native/main/release/%{version}/source/%{name}_%{version_enc}.tar.gz
# These following patches have been merged into boost develop branch
# Remove them at the next release
# https://github.com/boostorg/graph/pull/318
Patch1: boost-1.81-graph-Dont-run-performance-test-in-CI.patch
# https://github.com/boostorg/random/pull/83
Patch2: boost-1.81-random-Update-multiprecision_float_test.cpp-to-not-overflow.patch
Patch3: boost-1.81-random-Update-multiprecision_int_test.cpp-to-not-accidental.patch
Patch4: boost-1.81-random-test-Add-missing-includes.patch
# https://github.com/boostorg/phoenix/pull/116
Patch5: boost-1.81-phoenix-Update-avoid-placeholders-uarg1.10-ODR-violates.patch
Patch6: dynamic_linking.patch
Patch7: boost-remove-cmakedir.patch
# https://github.com/boostorg/pool/pull/42
Patch0: boost-1.78-pool-fix-integer-overflows-in-pool-ordered_malloc.patch
# https://github.com/boostorg/locale/pull/72
Patch1: boost-1.78-locale-Fix-access-to-first-element-of-empty-vector.patch
# https://github.com/boostorg/locale/pull/38
Patch2: boost-1.77-locale-remove-linking-with-boost-system.patch
# https://github.com/boostorg/type_erasure/pull/19
Patch3: boost-1.77-type_erasure-remove-boost-system-linkage.patch
# https://github.com/bfgroup/b2/pull/113
Patch4: boost-1.78-build-Don-t-skip-install-targets-if-there-s-build-no-in-ureqs.patch
# https://github.com/boostorg/filesystem/commit/41d076ace558cfae01e233f9746dc955dcf78dba
Patch5: boost-1.78-filesystem-Added-protection-for-CVE-2022-21658.patch
# https://github.com/boostorg/filesystem/commit/dbec3baaadf7d899e66aa90843d285e749e88b2d
Patch6: boost-1.78-filesystem-Use-O_NONBLOCK-instead-of-O_NDELAY.patch
# These patches have not been merged yet.
# https://github.com/boostorg/python/pull/373
Patch9000: boost-1.78-python-Update-call_method-hpp.patch
Patch9001: boost_1_78_0-sw.patch
Patch9002: boost-1.78-graph-Skip-performance-test.patch
Patch9003: boost-1.78-icl-Avoid-gcc-bugs.patch
Patch9004: boost-1.78-add-boost-context-support-for-loongarch64.patch
Requires: %{name}-atomic%{?_isa} = %{version}-%{release}
Requires: %{name}-chrono%{?_isa} = %{version}-%{release}
Requires: %{name}-container%{?_isa} = %{version}-%{release}
@ -47,7 +59,6 @@ Requires: %{name}-test%{?_isa} = %{version}-%{release}
Requires: %{name}-thread%{?_isa} = %{version}-%{release}
Requires: %{name}-timer%{?_isa} = %{version}-%{release}
Requires: %{name}-type_erasure%{?_isa} = %{version}-%{release}
Requires: %{name}-url%{?_isa} = %{version}-%{release}
Requires: %{name}-wave%{?_isa} = %{version}-%{release}
BuildRequires: gcc-c++
@ -57,14 +68,15 @@ BuildRequires: python3-devel python3-unversioned-command
BuildRequires: openssl-devel
# optional libraries for iostreams
BuildRequires: bzip2-devel libzstd-devel xz-devel zlib-devel
%ifnarch loongarch64 riscv64
# optional library for multiprecision
BuildRequires: libquadmath-devel libquadmath-static
%endif
# optional library for python3
BuildRequires: python3-numpy
# optional library for regex
BuildRequires: libicu-devel
%ifarch riscv64
BuildRequires: libatomic
%endif
Obsoletes: boost-signals < 1.69.0
@ -243,230 +255,23 @@ Requires: boost-chrono%{?_isa} = %{version}-%{release}
%description type_erasure
Runtime polymorphism based on concepts.
%package url
Summary: Run-time component for boost url.
%description url
A library for parsing, modifying, and printing URLs using only C++11.
%package wave
Summary: Run-time component for boost wave.
Requires: boost-chrono%{?_isa} = %{version}-%{release}
Requires: boost-filesystem%{?_isa} = %{version}-%{release}
Requires: boost-thread%{?_isa} = %{version}-%{release}
%package test-devel
Summary: Development headers for Boost.test
%description test-devel
Development header files and libraries for Boost.test
%package stacktrace-devel
Summary: Development headers for Boost.stacktrace
%description stacktrace-devel
Development header files and libraries for Boost.stacktrace
%package serialization-devel
Summary: Development headers for Boost.serialization
%description serialization-devel
Development header files and libraries for Boost.serialization
%package python3-devel
Summary: Development headers for Boost.python3
%description python3-devel
Development header files and libraries for Boost.python3
%package math-devel
Summary: Development headers for Boost.math
%description math-devel
Development header files and libraries for Boost.math
%package log-devel
Summary: Development headers for Boost.log
%description log-devel
Development header files and libraries for Boost.log
%package wave-devel
Summary: Development headers for Boost.wave
%description wave-devel
Development header files and libraries for Boost.wave
%package url-devel
Summary: Development headers for Boost.url
%description url-devel
Development header files and libraries for Boost.url
%package type_erasure-devel
Summary: Development headers for Boost.type_erasure
%description type_erasure-devel
Development header files and libraries for Boost.type_erasure
%package timer-devel
Summary: Development headers for Boost.timer
%description timer-devel
Development header files and libraries for Boost.timer
%package thread-devel
Summary: Development headers for Boost.thread
%description thread-devel
Development header files and libraries for Boost.thread
%package system-devel
Summary: Development headers for Boost.system
%description system-devel
Development header files and libraries for Boost.system
%package regex-devel
Summary: Development headers for Boost.regex
%description regex-devel
Development header files and libraries for Boost.regex
%package random-devel
Summary: Development headers for Boost.random
%description random-devel
Development header files and libraries for Boost.random
%package program-options-devel
Summary: Development headers for Boost.program-options
%description program-options-devel
Development header files and libraries for Boost.program-options
%package nowide-devel
Summary: Development headers for Boost.nowide
%description nowide-devel
Development header files and libraries for Boost.nowide
%package locale-devel
Summary: Development headers for Boost.locale
%description locale-devel
Development header files and libraries for Boost.locale
%package json-devel
Summary: Development headers for Boost.json
%description json-devel
Development header files and libraries for Boost.json
%package iostreams-devel
Summary: Development headers for Boost.iostreams
%description iostreams-devel
Development header files and libraries for Boost.iostreams
%package graph-devel
Summary: Development headers for Boost.graph
%description graph-devel
Development header files and libraries for Boost.graph
%package filesystem-devel
Summary: Development headers for Boost.filesystem
%description filesystem-devel
Development header files and libraries for Boost.filesystem
%package fiber-devel
Summary: Development headers for Boost.fiber
%description fiber-devel
Development header files and libraries for Boost.fiber
%package date-time-devel
Summary: Development headers for Boost.date-time
%description date-time-devel
Development header files and libraries for Boost.date-time
%package coroutine-devel
Summary: Development headers for Boost.coroutine
%description coroutine-devel
Development header files and libraries for Boost.coroutine
%package contract-devel
Summary: Development headers for Boost.contract
%description contract-devel
Development header files and libraries for Boost.contract
%package context-devel
Summary: Development headers for Boost.context
%description context-devel
Development header files and libraries for Boost.context
%package container-devel
Summary: Development headers for Boost.container
%description container-devel
Development header files and libraries for Boost.container
%package chrono-devel
Summary: Development headers for Boost.chrono
%description chrono-devel
Development header files and libraries for Boost.chrono
%package atomic-devel
Summary: Development headers for Boost.atomic
%description atomic-devel
Development header files and libraries for Boost.atomic
%description wave
An implementation of the mandated C99/C++ preprocessor functionality.
%package devel
Summary: The Boost C++ headers, shared and static development libraries
Requires: boost%{?_isa} = %{version}-%{release}
Requires: libicu-devel%{?_isa}
Requires: libquadmath-devel%{?_isa}
Provides: boost-static
Obsoletes: boost-static < %{version}
Requires: %{name}-test-devel%{?_isa} = %{version}-%{release}
Requires: %{name}-stacktrace-devel%{?_isa} = %{version}-%{release}
Requires: %{name}-serialization-devel%{?_isa} = %{version}-%{release}
Requires: %{name}-python3-devel%{?_isa} = %{version}-%{release}
Requires: %{name}-math-devel%{?_isa} = %{version}-%{release}
Requires: %{name}-log-devel%{?_isa} = %{version}-%{release}
Requires: %{name}-wave-devel%{?_isa} = %{version}-%{release}
Requires: %{name}-url-devel%{?_isa} = %{version}-%{release}
Requires: %{name}-type_erasure-devel%{?_isa} = %{version}-%{release}
Requires: %{name}-timer-devel%{?_isa} = %{version}-%{release}
Requires: %{name}-thread-devel%{?_isa} = %{version}-%{release}
Requires: %{name}-system-devel%{?_isa} = %{version}-%{release}
Requires: %{name}-regex-devel%{?_isa} = %{version}-%{release}
Requires: %{name}-random-devel%{?_isa} = %{version}-%{release}
Requires: %{name}-program-options-devel%{?_isa} = %{version}-%{release}
Requires: %{name}-nowide-devel%{?_isa} = %{version}-%{release}
Requires: %{name}-locale-devel%{?_isa} = %{version}-%{release}
Requires: %{name}-json-devel%{?_isa} = %{version}-%{release}
Requires: %{name}-iostreams-devel%{?_isa} = %{version}-%{release}
Requires: %{name}-graph-devel%{?_isa} = %{version}-%{release}
Requires: %{name}-filesystem-devel%{?_isa} = %{version}-%{release}
Requires: %{name}-fiber-devel%{?_isa} = %{version}-%{release}
Requires: %{name}-date-time-devel%{?_isa} = %{version}-%{release}
Requires: %{name}-coroutine-devel%{?_isa} = %{version}-%{release}
Requires: %{name}-contract-devel%{?_isa} = %{version}-%{release}
Requires: %{name}-context-devel%{?_isa} = %{version}-%{release}
Requires: %{name}-container-devel%{?_isa} = %{version}-%{release}
Requires: %{name}-chrono-devel%{?_isa} = %{version}-%{release}
Requires: %{name}-atomic-devel%{?_isa} = %{version}-%{release}
%description devel
Headers shared object symbolic links for the Boost C++ libraries and static
Boost C++ libraries distributed with boost.
@ -485,24 +290,28 @@ as that on the Boost web page (http://www.boost.org/doc/libs/%{version_enc}).
%autosetup -p1 -n %{name}_%{version_enc}
%build
./bootstrap.sh --with-toolset=%{__cc}
# cmake config is enabled
%define opt_build -d+2 -q %{?_smp_mflags}
./bootstrap.sh
%define opt_build -d+2 -q %{?_smp_mflags} --no-cmake-config
%define opt_feature release debug-symbols=on pch=off
%define opt_libs --without-mpi --without-graph_parallel
%define b2_options %{opt_build} %{opt_feature} %{opt_libs}
%define boost_macros define=BOOST_NO_AUTO_PTR define=BOOST_STATECHART_USE_NATIVE_RTTI
./b2 %{b2_options} cxxflags="$RPM_OPT_FLAGS" %{boost_macros}
# Remove exception library, but only if the symbols are not
# actually used. For now, the only symbol that is linked is
# should never be used as it's only available on Windows. So,
# verify that here.
%check
(cd status
../b2 %{?_smp_mflags} --check-libs-only
)
cd status
../b2 %{?_smp_mflags} --check-libs-only
../b2 %{?_smp_mflags} %{opt_feature} cxxflags="$RPM_OPT_FLAGS" %{boost_macros} \
--include-tests=algorithm,graph,intrusive,dynamic_bitset,property_map,crc,lexical_cast,range \
--exclude-tests=mpi,graph_parallel
%ifarch riscv64
LINKFLAGS='linkflags="-Wl,-latomic"'
%else
LINKFLAGS=
%endif
../b2 %{?_smp_mflags} %{opt_feature} cxxflags="$RPM_OPT_FLAGS" $LINKFLAGS %{boost_macros} \
--include-tests=bimap,circular_buffer,container,heap,icl,lockfree,logic,multi_array,multi_index,poly_collection,property_tree,ptr_container,sort \
--exclude-tests=container_hash
%install
./b2 %{b2_options} \
@ -511,14 +320,9 @@ as that on the Boost web page (http://www.boost.org/doc/libs/%{version_enc}).
install
mkdir boost-doc boost-example
cp -r index.html boost.png rst.css boost.css doc more boost-doc
find libs -name doc -exec cp {} boost-doc --parents -r \;
find libs doc more -regex '.*\.\(html?\|css\|png\|gif\)' -exec cp {} boost-doc --parents \;
cp index.html boost.png rst.css boost.css boost-doc
find libs -name example -exec cp {} boost-example --parents -r \;
rm %{buildroot}/%{_libdir}/libboost_exception.a
# not used or duplicated in boost-extra flavour
rm -r %{buildroot}/%{_libdir}/cmake/boost_exception-*
%files
%license LICENSE_1_0.txt
@ -633,7 +437,6 @@ rm -r %{buildroot}/%{_libdir}/cmake/boost_exception-*
%license LICENSE_1_0.txt
%{_libdir}/libboost_prg_exec_monitor.so.%{version}
%{_libdir}/libboost_unit_test_framework.so.%{version}
%{_libdir}/libboost_test_exec_monitor.so.%{version}
%files thread
%license LICENSE_1_0.txt
@ -647,10 +450,6 @@ rm -r %{buildroot}/%{_libdir}/cmake/boost_exception-*
%license LICENSE_1_0.txt
%{_libdir}/libboost_type_erasure.so.%{version}
%files url
%license LICENSE_1_0.txt
%{_libdir}/libboost_url.so.%{version}
%files wave
%license LICENSE_1_0.txt
%{_libdir}/libboost_wave.so.%{version}
@ -661,271 +460,28 @@ rm -r %{buildroot}/%{_libdir}/cmake/boost_exception-*
%files devel
%license LICENSE_1_0.txt
%dir %{_libdir}/cmake/Boost-%{version}
%{_libdir}/cmake/Boost-%{version}/*
%{_libdir}/cmake/*.cmake
# I think it's necessary to include Headers into this package
%dir %{_libdir}/cmake/boost_headers-%{version}
%{_libdir}/cmake/boost_headers-%{version}/*
%{_includedir}/%{name}
%{_libdir}/*.so
%{_libdir}/*.a
%files test-devel
%license LICENSE_1_0.txt
%dir %{_libdir}/cmake/boost_prg_exec_monitor-%{version}
%dir %{_libdir}/cmake/boost_test_exec_monitor-%{version}
%dir %{_libdir}/cmake/boost_unit_test_framework-%{version}
%{_libdir}/cmake/boost_prg_exec_monitor-%{version}/*
%{_libdir}/cmake/boost_test_exec_monitor-%{version}/*
%{_libdir}/cmake/boost_unit_test_framework-%{version}/*
%{_libdir}/libboost_prg_exec_monitor.so.%{version}
%{_libdir}/libboost_unit_test_framework.so.%{version}
%{_libdir}/libboost_test_exec_monitor.so.%{version}
%files stacktrace-devel
%license LICENSE_1_0.txt
%dir %{_libdir}/cmake/boost_stacktrace_addr2line-%{version}
%dir %{_libdir}/cmake/boost_stacktrace_basic-%{version}
%dir %{_libdir}/cmake/boost_stacktrace_noop-%{version}
%{_libdir}/cmake/boost_stacktrace_addr2line-%{version}/*
%{_libdir}/cmake/boost_stacktrace_basic-%{version}/*
%{_libdir}/cmake/boost_stacktrace_noop-%{version}/*
%{_libdir}/libboost_stacktrace_addr2line.so.%{version}
%{_libdir}/libboost_stacktrace_basic.so.%{version}
%{_libdir}/libboost_stacktrace_noop.so.%{version}
%files serialization-devel
%license LICENSE_1_0.txt
%dir %{_libdir}/cmake/boost_serialization-%{version}
%dir %{_libdir}/cmake/boost_wserialization-%{version}
%{_libdir}/cmake/boost_serialization-%{version}/*
%{_libdir}/cmake/boost_wserialization-%{version}/*
%{_libdir}/libboost_serialization.so.%{version}
%{_libdir}/libboost_wserialization.so.%{version}
%files python3-devel
%license LICENSE_1_0.txt
%dir %{_libdir}/cmake/boost_python-%{version}
%dir %{_libdir}/cmake/boost_numpy-%{version}
%{_libdir}/cmake/boost_python-%{version}/*
%{_libdir}/cmake/boost_numpy-%{version}/*
%{_libdir}/libboost_python%{python3_version_nodots}.so.%{version}
%{_libdir}/libboost_numpy%{python3_version_nodots}.so.%{version}
%files math-devel
%license LICENSE_1_0.txt
%dir %{_libdir}/cmake/boost_math_c99-%{version}
%dir %{_libdir}/cmake/boost_math_tr1-%{version}
%{_libdir}/cmake/boost_math_c99-%{version}/*
%{_libdir}/cmake/boost_math_c99f-%{version}/*
%{_libdir}/cmake/boost_math_c99l-%{version}/*
%{_libdir}/cmake/boost_math_tr1-%{version}/*
%{_libdir}/cmake/boost_math_tr1l-%{version}/*
%{_libdir}/cmake/boost_math_tr1f-%{version}/*
%{_libdir}/libboost_math_c99.so.%{version}
%{_libdir}/libboost_math_c99f.so.%{version}
%ifnarch ppc64le
%{_libdir}/libboost_math_c99l.so.%{version}
%endif
%{_libdir}/libboost_math_tr1.so.%{version}
%{_libdir}/libboost_math_tr1f.so.%{version}
%ifnarch ppc64le
%{_libdir}/libboost_math_tr1l.so.%{version}
%endif
%files log-devel
%license LICENSE_1_0.txt
%dir %{_libdir}/cmake/boost_log-%{version}
%dir %{_libdir}/cmake/boost_log_setup-%{version}
%{_libdir}/cmake/boost_log-%{version}/*
%{_libdir}/cmake/boost_log_setup-%{version}/*
%{_libdir}/libboost_log.so.%{version}
%{_libdir}/libboost_log_setup.so.%{version}
%files wave-devel
%license LICENSE_1_0.txt
%dir %{_libdir}/cmake/boost_wave-%{version}
%{_libdir}/cmake/boost_wave-%{version}/*
%{_libdir}/libboost_wave.so.%{version}
%files url-devel
%license LICENSE_1_0.txt
%dir %{_libdir}/cmake/boost_url-%{version}
%{_libdir}/cmake/boost_url-%{version}/*
%{_libdir}/libboost_url.so.%{version}
%files type_erasure-devel
%license LICENSE_1_0.txt
%dir %{_libdir}/cmake/boost_type_erasure-%{version}
%{_libdir}/cmake/boost_type_erasure-%{version}/*
%{_libdir}/libboost_type_erasure.so.%{version}
%files timer-devel
%license LICENSE_1_0.txt
%dir %{_libdir}/cmake/boost_timer-%{version}
%{_libdir}/cmake/boost_timer-%{version}/*
%{_libdir}/libboost_timer.so.%{version}
%files thread-devel
%license LICENSE_1_0.txt
%dir %{_libdir}/cmake/boost_thread-%{version}
%{_libdir}/cmake/boost_thread-%{version}/*
%{_libdir}/libboost_thread.so.%{version}
%files system-devel
%license LICENSE_1_0.txt
%dir %{_libdir}/cmake/boost_system-%{version}
%{_libdir}/cmake/boost_system-%{version}/*
%{_libdir}/libboost_system.so.%{version}
%files regex-devel
%license LICENSE_1_0.txt
%dir %{_libdir}/cmake/boost_regex-%{version}
%{_libdir}/cmake/boost_regex-%{version}/*
%{_libdir}/libboost_regex.so.%{version}
%files random-devel
%license LICENSE_1_0.txt
%dir %{_libdir}/cmake/boost_random-%{version}
%{_libdir}/cmake/boost_random-%{version}/*
%{_libdir}/libboost_random.so.%{version}
%files program-options-devel
%license LICENSE_1_0.txt
%dir %{_libdir}/cmake/boost_program_options-%{version}
%{_libdir}/cmake/boost_program_options-%{version}/*
%{_libdir}/libboost_program_options.so.%{version}
%files nowide-devel
%license LICENSE_1_0.txt
%dir %{_libdir}/cmake/boost_nowide-%{version}
%{_libdir}/cmake/boost_nowide-%{version}/*
%{_libdir}/libboost_nowide.so.%{version}
%files locale-devel
%license LICENSE_1_0.txt
%dir %{_libdir}/cmake/boost_locale-%{version}
%{_libdir}/cmake/boost_locale-%{version}/*
%{_libdir}/libboost_locale.so.%{version}
%files json-devel
%license LICENSE_1_0.txt
%dir %{_libdir}/cmake/boost_json-%{version}
%{_libdir}/cmake/boost_json-%{version}/*
%{_libdir}/libboost_json.so.%{version}
%files iostreams-devel
%license LICENSE_1_0.txt
%dir %{_libdir}/cmake/boost_iostreams-%{version}
%{_libdir}/cmake/boost_iostreams-%{version}/*
%{_libdir}/libboost_iostreams.so.%{version}
%files graph-devel
%license LICENSE_1_0.txt
%dir %{_libdir}/cmake/boost_graph-%{version}
%{_libdir}/cmake/boost_graph-%{version}/*
%{_libdir}/libboost_graph.so.%{version}
%files filesystem-devel
%license LICENSE_1_0.txt
%dir %{_libdir}/cmake/boost_filesystem-%{version}
%{_libdir}/cmake/boost_filesystem-%{version}/*
%{_libdir}/libboost_filesystem.so.%{version}
%files fiber-devel
%license LICENSE_1_0.txt
%dir %{_libdir}/cmake/boost_fiber-%{version}
%{_libdir}/cmake/boost_fiber-%{version}/*
%{_libdir}/libboost_fiber.so.%{version}
%files date-time-devel
%license LICENSE_1_0.txt
%dir %{_libdir}/cmake/boost_date_time-%{version}
%{_libdir}/cmake/boost_date_time-%{version}/*
%{_libdir}/libboost_date_time.so.%{version}
%files coroutine-devel
%license LICENSE_1_0.txt
%dir %{_libdir}/cmake/boost_coroutine-%{version}
%{_libdir}/cmake/boost_coroutine-%{version}/*
%{_libdir}/libboost_coroutine.so.%{version}
%files contract-devel
%license LICENSE_1_0.txt
%dir %{_libdir}/cmake/boost_contract-%{version}
%{_libdir}/cmake/boost_contract-%{version}/*
%{_libdir}/libboost_contract.so.%{version}
%files context-devel
%license LICENSE_1_0.txt
%dir %{_libdir}/cmake/boost_context-%{version}
%{_libdir}/cmake/boost_context-%{version}/*
%{_libdir}/libboost_context.so.%{version}
%files container-devel
%license LICENSE_1_0.txt
%dir %{_libdir}/cmake/boost_container-%{version}
%{_libdir}/cmake/boost_container-%{version}/*
%{_libdir}/libboost_container.so.%{version}
%files chrono-devel
%license LICENSE_1_0.txt
%dir %{_libdir}/cmake/boost_chrono-%{version}
%{_libdir}/cmake/boost_chrono-%{version}/*
%{_libdir}/libboost_chrono.so.%{version}
%files atomic-devel
%license LICENSE_1_0.txt
%dir %{_libdir}/cmake/boost_atomic-%{version}
%{_libdir}/cmake/boost_atomic-%{version}/*
%{_libdir}/libboost_atomic.so.%{version}
%changelog
* Sun Apr 28 2024 yinsist <jianhui.oerv@isrc.iscas.ac.cn> - 1.83.0-4
- Disable libquadmath dependency for RISC-V as gcc does not currently support RISC-V's libquadmath
* Thu Mar 14 2024 jammyjellyfish <jammyjellyfish255@outlook.com> - 1.83.0-3
- Support specify CC
* Sat Mar 2 2024 Wenlong Zhang <zhangwenlong@loongson.cn> - 1.83.0-2
- No libquadmath-devel libquadmath-static on loongarch64
* Thu Jan 25 2024 chenhaixiang <chenhaixiang3@huawei.com> - 1.83.0-1
- Update to 1.83.0
* Mon Nov 27 2023 jiahua.yu <jiahua.yu@shingroup.cn> - 1.81.0-3
* Tue Jun 18 2024 hefq343 <fengqing.he@shingroup.cn> - 1.78.0-18
- Init support for ppc64le
* Mon Sep 04 2023 Darssin <2020303249@mail.nwpu.edu.cn> - 1.81.0-2
- Avoid boost::phoenix::placeholders::uarg1..10 ODR violations
* Mon Aug 14 2023 laokz <zhangkai@iscas.ac.cn> - 1.78.0-17
- add -latomic flag to lockfree tests for riscv64
* Mon Dec 19 2022 Liu Zixian <liuzixian4@huawei.com> - 1.81.0-1
- Update to 1.81.0
* Thu Aug 10 2023 herengui <herengui@kylinsec.com.cn> - 1.78.0-16
- add loongarch64 patch
* Thu Dec 08 2022 Liu Zixian <liuzixian4@huawei.com> - 1.80.0-5
- statechart: avoid undefined behavior
* Mon Dec 12 2022 Liu Zixian <liuzixian4@huawei.com> - 1.78.0-15
- enable more regression tests to covers commonly used container libraries
* Fri Dec 02 2022 Liu Zixian <liuzixian4@huawei.com> - 1.80.0-4
- Skip gcc value init check
* Mon Dec 12 2022 Liu Zixian <liuzixian4@huawei.com> - 1.78.0-14
- backport master build commands and enable some regression test
* Sat Nov 26 2022 Liu Zixian <liuzixian4@huawei.com> - 1.80.0-3
- Fix libquadmath dependency
* Sat Nov 26 2022 Liu Zixian <liuzixian4@huawei.com> - 1.80.0-2
- Backport outcome regression test bugfix
* Wed Aug 24 2022 Liu Zixian <liuzixian4@huawei.com> - 1.80.0-1
- update to 1.80.0
* Tue Jun 07 2022 liukuo <liukuo@kylinos.cn> - 1.79.0-3
- License compliance rectification
* Fri May 27 2022 Liu Zixian <liuzixian4@huawei.com> - 1.79.0-2
- enable %check
* Sat Apr 16 2022 Liu Zixian <liuzixian4@huawei.com> - 1.79.0-1
- update to 1.79.0
* Wed Oct 19 2022 wuzx<wuzx1226@qq.com> - 1.78.0-13
- add sw64 patch
* Sun Mar 20 2022 Liu Zixian <liuzixian4@huawei.com> - 1.78.0-12
- backport upstream filesystem patches to fix a possible security issue

1940
boost_1_78_0-sw.patch Executable file

File diff suppressed because it is too large Load Diff

View File

@ -1,13 +0,0 @@
Index: boost_1_80_0/libs/test/build/Jamfile.v2
===================================================================
--- boost_1_80_0.orig/libs/test/build/Jamfile.v2
+++ boost_1_80_0/libs/test/build/Jamfile.v2
@@ -95,7 +95,7 @@ lib boost_test_exec_monitor
: # sources
$(TEST_EXEC_MON_SOURCES).cpp
: # requirements
- <link>static
+ # <link>static
: # default build
: # usage-requirements
<link>shared:<define>BOOST_TEST_DYN_LINK=1