From 4abc13fa555c47cd79f236927d15115474c04dcf Mon Sep 17 00:00:00 2001 From: Zhang Na <44800775+loongson-zn@users.noreply.github.com> Date: Sat, 26 Feb 2022 11:02:32 +0800 Subject: [PATCH 1/3] Add support for LoongArch (#122) --- include/boost/predef/architecture.h | 1 + include/boost/predef/architecture/loongarch.h | 41 +++++++++++++++++++ include/boost/predef/other/endian.h | 1 + 3 files changed, 43 insertions(+) create mode 100644 include/boost/predef/architecture/loongarch.h diff --git a/include/boost/predef/architecture.h b/include/boost/predef/architecture.h index f43f946..b131a89 100644 --- a/include/boost/predef/architecture.h +++ b/include/boost/predef/architecture.h @@ -16,6 +16,7 @@ http://www.boost.org/LICENSE_1_0.txt) #include #include #include +#include #include #include #include diff --git a/include/boost/predef/architecture/loongarch.h b/include/boost/predef/architecture/loongarch.h new file mode 100644 index 0000000..e3e163b --- /dev/null +++ b/include/boost/predef/architecture/loongarch.h @@ -0,0 +1,41 @@ +/* +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 +#include + +/* 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_DECLARE_TEST(BOOST_ARCH_LOONGARCH,BOOST_ARCH_LOONGARCH_NAME) diff --git a/include/boost/predef/other/endian.h b/include/boost/predef/other/endian.h index d8ec63f..435492a 100644 --- a/include/boost/predef/other/endian.h +++ b/include/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__) || \ From 9577047aa8fa77487a8a60d60d4564743a4ff67c Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Sat, 26 Feb 2022 23:34:52 -0600 Subject: [PATCH 2/3] Merge from hash.predef. --- appveyor.yml | 2 +- azure-pipelines.yml | 18 ++++++------------ tools/ci/linux-cxx-install.sh | 27 +++++++++++++++++++++------ 3 files changed, 28 insertions(+), 19 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 1ec83fd..693e8f8 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -24,7 +24,7 @@ environment: matrix: # All the Visual Studio installs available on Appveyor # - { job_name: 'VS 2019', TOOLSET: "msvc", TOOLSET_VERSION: '14.2', APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2019' } - # - { job_name: 'VS 2017', TOOLSET: "msvc", TOOLSET_VERSION: '14.1', APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2017' } + - { job_name: 'VS 2017', TOOLSET: "msvc", TOOLSET_VERSION: '14.1', APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2017' } - { job_name: 'VS 2015', TOOLSET: "msvc", TOOLSET_VERSION: '14.0', APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2015' } - { job_name: 'VS 2013', TOOLSET: "msvc", TOOLSET_VERSION: '12.0', APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2015' } # - { job_name: 'VS 2012', TOOLSET: "msvc", TOOLSET_VERSION: '11.0', APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2015' } diff --git a/azure-pipelines.yml b/azure-pipelines.yml index febe21d..13377a0 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -41,8 +41,8 @@ stages: - job: 'Linux' strategy: matrix: - GCC 11 (GNU): { CXX: g++-11, PACKAGES: g++-11, VM_IMAGE: 'ubuntu-20.04', TOOLSET: gcc, B2_ARGS: 'cxxstd=03,11,14,17,2a cxxstd-dialect=gnu' } - GCC 11 (ISO): { CXX: g++-11, PACKAGES: g++-11, VM_IMAGE: 'ubuntu-20.04', TOOLSET: gcc, B2_ARGS: 'cxxstd=03,11,14,17,2a cxxstd-dialect=iso' } + GCC 11 (GNU): { CXX: g++-11, PACKAGES: g++-11, VM_IMAGE: 'ubuntu-20.04', TOOLSET: gcc, B2_ARGS: 'cxxstd=03,11,14,17,20 cxxstd-dialect=gnu' } + GCC 11 (ISO): { CXX: g++-11, PACKAGES: g++-11, VM_IMAGE: 'ubuntu-20.04', TOOLSET: gcc, B2_ARGS: 'cxxstd=03,11,14,17,20 cxxstd-dialect=iso' } GCC 11: { CXX: g++-11, PACKAGES: g++-11, VM_IMAGE: 'ubuntu-20.04', TOOLSET: gcc } GCC 10: { CXX: g++-10, PACKAGES: g++-10, VM_IMAGE: 'ubuntu-20.04', TOOLSET: gcc } GCC 9: { CXX: g++-9, PACKAGES: g++-9, VM_IMAGE: 'ubuntu-18.04', TOOLSET: gcc } @@ -50,8 +50,8 @@ stages: GCC 7: { CXX: g++-7, PACKAGES: g++-7, VM_IMAGE: 'ubuntu-18.04', TOOLSET: gcc } GCC 6: { CXX: g++-6, PACKAGES: g++-6, VM_IMAGE: 'ubuntu-18.04', TOOLSET: gcc } GCC 5: { CXX: g++-5, PACKAGES: g++-5, VM_IMAGE: 'ubuntu-18.04', TOOLSET: gcc } - # Clang 13: { CXX: clang++-13, PACKAGES: clang-13, LLVM_OS: focal, LLVM_VER: 11, VM_IMAGE: 'ubuntu-20.04', TOOLSET: clang } - Clang 12: { CXX: clang++-12, PACKAGES: clang-12, LLVM_OS: focal, LLVM_VER: 11, VM_IMAGE: 'ubuntu-20.04', TOOLSET: clang } + Clang 13: { CXX: clang++-13, PACKAGES: clang-13, LLVM_OS: focal, LLVM_VER: 13, VM_IMAGE: 'ubuntu-20.04', TOOLSET: clang } + Clang 12: { CXX: clang++-12, PACKAGES: clang-12, LLVM_OS: focal, LLVM_VER: 12, VM_IMAGE: 'ubuntu-20.04', TOOLSET: clang } Clang 11: { CXX: clang++-11, PACKAGES: clang-11, LLVM_OS: focal, LLVM_VER: 11, VM_IMAGE: 'ubuntu-20.04', TOOLSET: clang } Clang 10: { CXX: clang++-10, PACKAGES: clang-10, LLVM_OS: bionic, LLVM_VER: 10, VM_IMAGE: 'ubuntu-18.04', TOOLSET: clang } Clang 9: { CXX: clang++-9, PACKAGES: clang-9, LLVM_OS: bionic, LLVM_VER: 9, VM_IMAGE: 'ubuntu-18.04', TOOLSET: clang } @@ -91,6 +91,8 @@ stages: - job: 'macOS' strategy: matrix: + Xcode 13.2.1: {TOOLSET: clang, CXX: clang++, XCODE_APP: /Applications/Xcode_13.2.1.app, VM_IMAGE: 'macOS-11'} + Xcode 13.1: {TOOLSET: clang, CXX: clang++, XCODE_APP: /Applications/Xcode_13.1.app, VM_IMAGE: 'macOS-11'} Xcode 13.0: {TOOLSET: clang, CXX: clang++, XCODE_APP: /Applications/Xcode_13.0.app, VM_IMAGE: 'macOS-11'} Xcode 12.4: {TOOLSET: clang, CXX: clang++, XCODE_APP: /Applications/Xcode_12.4.app, VM_IMAGE: 'macOS-11'} Xcode 12.3: {TOOLSET: clang, CXX: clang++, XCODE_APP: /Applications/Xcode_12.3.app, VM_IMAGE: 'macOS-10.15'} @@ -103,10 +105,6 @@ stages: Xcode 11.4.1: {TOOLSET: clang, CXX: clang++, XCODE_APP: /Applications/Xcode_11.4.1.app, VM_IMAGE: 'macOS-10.15'} Xcode 11.3.1: {TOOLSET: clang, CXX: clang++, XCODE_APP: /Applications/Xcode_11.3.1.app, VM_IMAGE: 'macOS-10.15'} Xcode 11.2.1: {TOOLSET: clang, CXX: clang++, XCODE_APP: /Applications/Xcode_11.2.1.app, VM_IMAGE: 'macOS-10.15'} - Xcode 10.3: {TOOLSET: clang, CXX: clang++, XCODE_APP: /Applications/Xcode_10.3.app, VM_IMAGE: 'macOS-10.14'} - Xcode 10.2.1: {TOOLSET: clang, CXX: clang++, XCODE_APP: /Applications/Xcode_10.2.1.app, VM_IMAGE: 'macOS-10.14'} - Xcode 10.1: {TOOLSET: clang, CXX: clang++, XCODE_APP: /Applications/Xcode_10.1.app, VM_IMAGE: 'macOS-10.14'} - Xcode 10.0: {TOOLSET: clang, CXX: clang++, XCODE_APP: /Applications/Xcode_10.app, VM_IMAGE: 'macOS-10.14'} pool: vmImage: $(VM_IMAGE) steps: @@ -174,10 +172,6 @@ stages: TOOLSET: msvc TOOLSET_VERSION: 14.3 VM_IMAGE: 'windows-2022' - VS 2017: - TOOLSET: msvc - TOOLSET_VERSION: 14.1 - VM_IMAGE: 'vs2017-win2016' MinGW 8.1.0: TOOLSET: gcc VM_IMAGE: 'windows-2019' diff --git a/tools/ci/linux-cxx-install.sh b/tools/ci/linux-cxx-install.sh index 7557385..3f9fb7c 100755 --- a/tools/ci/linux-cxx-install.sh +++ b/tools/ci/linux-cxx-install.sh @@ -5,26 +5,41 @@ # LLVM_VER: The LLVM toolset version to point the repo at. # PACKAGES: Compiler packages to install. +if command -v sudo ; then + SUDO="sudo -E" +fi +OS_ISSUE=`cat /etc/issue | head -n1 | cut -d " " -f1` +echo ">>>>> OS Issue: ${OS_ISSUE}" + +PACKAGES=${PACKAGES:-build-essential} + set -e echo ">>>>>" +echo ">>>>> APT: UPDATE.." +echo ">>>>>" +${SUDO} apt-get -o Acquire::Retries=3 update +echo ">>>>>" echo ">>>>> APT: REPO.." echo ">>>>>" -sudo -E apt-add-repository -y "ppa:ubuntu-toolchain-r/test" -if test -n "${LLVM_OS}" -a -n "${LLVM_VER}" ; then +${SUDO} apt-get -o Acquire::Retries=3 -y install software-properties-common +if test "${OS_ISSUE}" = "Ubuntu" ; then + ${SUDO} apt-add-repository -y "ppa:ubuntu-toolchain-r/test" +fi +if test -n "${LLVM_OS}" ; then wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - - sudo -E apt-add-repository "deb http://apt.llvm.org/${LLVM_OS}/ llvm-toolchain-${LLVM_OS}-${LLVM_VER} main" + ${SUDO} apt-add-repository "deb http://apt.llvm.org/${LLVM_OS}/ llvm-toolchain-${LLVM_OS}-${LLVM_VER} main" fi echo ">>>>>" echo ">>>>> APT: UPDATE.." echo ">>>>>" -sudo -E apt-get -o Acquire::Retries=3 update +${SUDO} apt-get -o Acquire::Retries=3 update echo ">>>>>" echo ">>>>> APT: INSTALL ${PACKAGES}.." echo ">>>>>" -sudo -E apt-get -o Acquire::Retries=3 -yq --no-install-suggests --no-install-recommends install ${PACKAGES} +${SUDO} apt-get -o Acquire::Retries=3 -yq --no-install-suggests --no-install-recommends install ${PACKAGES} # Use, modification, and distribution are # subject to the Boost Software License, Version 1.0. (See accompanying # file LICENSE.txt) # -# Copyright Rene Rivera 2020. +# Copyright René Ferdinand Rivera Morell 2020-2022. From 499d28e34f78950ede62fdb9b74cbe06eb5fdf96 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Sun, 27 Feb 2022 14:31:25 -0600 Subject: [PATCH 3/3] Update from hash-predef. --- doc/history.adoc | 4 ++++ include/boost/predef/version.h | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/doc/history.adoc b/doc/history.adoc index e664712..07176dc 100644 --- a/doc/history.adoc +++ b/doc/history.adoc @@ -7,6 +7,10 @@ http://www.boost.org/LICENSE_1_0.txt) = History +== 1.14.0 + +* Add detection of LoongArch (from Zhang Na). + == 1.13.1 * Fix spelling of "epoch". diff --git a/include/boost/predef/version.h b/include/boost/predef/version.h index 0b07938..172d22e 100644 --- a/include/boost/predef/version.h +++ b/include/boost/predef/version.h @@ -10,6 +10,6 @@ http://www.boost.org/LICENSE_1_0.txt) #include -#define BOOST_PREDEF_VERSION BOOST_VERSION_NUMBER(1,13,1) +#define BOOST_PREDEF_VERSION BOOST_VERSION_NUMBER(1,14,0) #endif