diff --git a/0011-add-loongarch64-support-for-boost-1.81.patch b/0011-add-loongarch64-support-for-boost-1.81.patch new file mode 100644 index 0000000000000000000000000000000000000000..2f2cf7b6c82f8d3a632c29fdea684112ecd50c03 --- /dev/null +++ b/0011-add-loongarch64-support-for-boost-1.81.patch @@ -0,0 +1,85 @@ +From c14b7c6d206fb579fa169f5d288ce1c49d391e49 Mon Sep 17 00:00:00 2001 +From: Wenlong Zhang +Date: Wed, 29 Nov 2023 07:45:19 +0000 +Subject: [PATCH] add loongarch64 support for boost 1.81 + +--- + boostcpp.jam | 5 +++-- + libs/config/checks/architecture/Jamfile.jam | 1 + + libs/config/checks/architecture/loongarch.cpp | 11 +++++++++++ + tools/build/src/engine/jam.h | 4 ++++ + 4 files changed, 19 insertions(+), 2 deletions(-) + create mode 100644 libs/config/checks/architecture/loongarch.cpp + +diff --git a/boostcpp.jam b/boostcpp.jam +index 082536e2a..7565dae80 100644 +--- a/boostcpp.jam ++++ b/boostcpp.jam +@@ -634,7 +634,7 @@ rule address-model ( ) + return @boostcpp.deduce-address-model ; + } + +-local deducable-architectures = arm mips1 power riscv s390x sparc x86 combined ; ++local deducable-architectures = 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,9 +645,10 @@ rule deduce-architecture ( properties * ) + { + local result ; + local filtered = [ toolset-properties $(properties) ] ; +- local names = arm mips1 power riscv s390x sparc x86 combined ; ++ local names = arm loongarch mips1 power riscv s390x sparc x86 combined ; + local idx = [ configure.find-builds "default architecture" : $(filtered) + : /boost/architecture//arm ++ : /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 c3779d917..ea41afb4a 100644 +--- a/libs/config/checks/architecture/Jamfile.jam ++++ b/libs/config/checks/architecture/Jamfile.jam +@@ -18,6 +18,7 @@ obj 64 : 64.cpp ; + + obj arm : arm.cpp ; + obj combined : combined.cpp ; ++obj loongarch : loongarch.cpp ; + obj mips : mips.cpp ; + alias mips1 : mips ; # Backwards compatibility + obj power : power.cpp ; +diff --git a/libs/config/checks/architecture/loongarch.cpp b/libs/config/checks/architecture/loongarch.cpp +new file mode 100644 +index 000000000..5be8cb09b +--- /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/tools/build/src/engine/jam.h b/tools/build/src/engine/jam.h +index b6f291865..27772284e 100644 +--- a/tools/build/src/engine/jam.h ++++ b/tools/build/src/engine/jam.h +@@ -437,6 +437,10 @@ + #define OSPLAT "OSPLAT=PARISC" + #endif + ++#ifdef __loongarch64 ++ #define OSPLAT "OSPLAT=LOONGARCH64" ++#endif ++ + #ifndef OSPLAT + #define OSPLAT "" + #endif +-- +2.41.0 + diff --git a/boost.spec b/boost.spec index 53a1ed8a7904a45b238c03ba14268f8ef4b20df5..9c4cbb63c8fe3ded6b0982de5ab606840e0473ef 100644 --- a/boost.spec +++ b/boost.spec @@ -1,4 +1,4 @@ -%define anolis_release 5 +%define anolis_release 6 %global boost_docdir __tmp_docdir %global boost_examplesdir __tmp_examplesdir @@ -60,6 +60,7 @@ Patch0009: 0009-boost-1.72.0-mpi-python-build.patch # https://github.com/boostorg/phoenix/issues/111 # https://github.com/boostorg/phoenix/pull/112 Patch0010: 0010-stl-tuple-change-uarg-N-to-internal-linkage.patch +Patch0011: 0011-add-loongarch64-support-for-boost-1.81.patch BuildRequires: gcc-c++ python3 m4 lua-posix bison zlib-devel libicu-devel BuildRequires: libstdc++-devel bzip2-devel xz-devel libzstd-devel @@ -1249,6 +1250,9 @@ fi %doc %{boost_docdir}/* %changelog +* Wed Nov 29 7 2023 Wenlong Zhang - 1.81.0-6 +- add loongarch64 support for boost 1.81 + * Mon Nov 13 7 2023 Wenlong Zhang - 1.81.0-5 - Remove useless patches for loongarch