From 9170c51c986e6253759aaeeec4b7957265ae5286 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Mon, 11 Mar 2024 08:31:17 -0500 Subject: [PATCH 01/16] Make the library modular usable. --- build.jam | 89 ++++ build/Jamfile.v2 | 67 +-- build/Jamfile.v2.orig | 966 ++++++++++++++++++++++++++++++++++++++++++ test/Jamfile.v2 | 5 +- 4 files changed, 1065 insertions(+), 62 deletions(-) create mode 100644 build.jam create mode 100644 build/Jamfile.v2.orig diff --git a/build.jam b/build.jam new file mode 100644 index 00000000..998504c2 --- /dev/null +++ b/build.jam @@ -0,0 +1,89 @@ +# Copyright René Ferdinand Rivera Morell 2023 +# 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) + +import-search /boost/predef/tools/check ; + +import project ; +import feature ; +import os ; +import predef ; + +project /boost/context + : common-requirements + /boost/assert//boost_assert + /boost/config//boost_config + /boost/core//boost_core + /boost/mp11//boost_mp11 + /boost/pool//boost_pool + /boost/predef//boost_predef + /boost/smart_ptr//boost_smart_ptr + include + : requirements + # Auto-detect toolset default address-model and architecture. + [ predef.address-model ] + [ predef.architecture ] + ; + +feature.feature segmented-stacks : on : optional propagated composite ; +feature.compose on : BOOST_USE_SEGMENTED_STACKS ; + +feature.feature htm : tsx : optional propagated composite ; +feature.compose tsx : BOOST_USE_TSX ; + +feature.feature valgrind : on : optional propagated composite ; +feature.compose on : BOOST_USE_VALGRIND ; + +local rule default_binary_format ( ) +{ + local tmp = elf ; + if [ os.name ] = "NT" { tmp = pe ; } + else if [ os.name ] = "CYGWIN" { tmp = pe ; } + else if [ os.name ] = "AIX" { tmp = xcoff ; } + else if [ os.name ] = "MACOSX" { tmp = mach-o ; } + return $(tmp) ; +} + +feature.feature binary-format + : elf + mach-o + pe + xcoff + : propagated + ; +feature.set-default binary-format : [ default_binary_format ] ; + +local rule default_abi ( ) +{ + local tmp = sysv ; + if [ os.name ] = "NT" { tmp = ms ; } + else if [ os.name ] = "CYGWIN" { tmp = ms ; } + else if [ os.platform ] = "ARM" { tmp = aapcs ; } + else if [ os.platform ] = "MIPS32" { tmp = o32 ; } + else if [ os.platform ] = "MIPS64" { tmp = n64 ; } + return $(tmp) ; +} + +feature.feature abi + : aapcs + eabi + ms + n32 + n64 + o32 + o64 + sysv + x32 + : propagated + ; +feature.set-default abi : [ default_abi ] ; + +explicit + [ alias boost_context : build//boost_context ] + [ alias all : boost_context test ] + ; + +call-if : boost-library context + : install boost_context + ; diff --git a/build/Jamfile.v2 b/build/Jamfile.v2 index c07847ab..122d15fa 100644 --- a/build/Jamfile.v2 +++ b/build/Jamfile.v2 @@ -6,24 +6,17 @@ # (See accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) +import-search /boost/config/checks ; + import common ; -import feature ; import indirect ; import modules ; import os ; import toolset ; - import ../../config/checks/config : requires ; - -feature.feature segmented-stacks : on : optional propagated composite ; -feature.compose on : BOOST_USE_SEGMENTED_STACKS ; - -feature.feature htm : tsx : optional propagated composite ; -feature.compose tsx : BOOST_USE_TSX ; - -feature.feature valgrind : on : optional propagated composite ; -feature.compose on : BOOST_USE_VALGRIND ; +import config : requires ; +import feature ; -project boost/context +project : requirements windows:_WIN32_WINNT=0x0601 linux,gcc,on:-fsplit-stack @@ -54,53 +47,6 @@ project boost/context ; -local rule default_binary_format ( ) -{ - local tmp = elf ; - if [ os.name ] = "NT" { tmp = pe ; } - else if [ os.name ] = "CYGWIN" { tmp = pe ; } - else if [ os.name ] = "AIX" { tmp = xcoff ; } - else if [ os.name ] = "MACOSX" { tmp = mach-o ; } - return $(tmp) ; -} - -feature.feature binary-format - : elf - mach-o - pe - xcoff - : propagated - ; -feature.set-default binary-format : [ default_binary_format ] ; - - -local rule default_abi ( ) -{ - local tmp = sysv ; - if [ os.name ] = "NT" { tmp = ms ; } - else if [ os.name ] = "CYGWIN" { tmp = ms ; } - else if [ os.platform ] = "ARM" { tmp = aapcs ; } - else if [ os.platform ] = "ARM64" { tmp = aapcs ; } - else if [ os.platform ] = "MIPS32" { tmp = o32 ; } - else if [ os.platform ] = "MIPS64" { tmp = n64 ; } - return $(tmp) ; -} - -feature.feature abi - : aapcs - eabi - ms - n32 - n64 - o32 - o64 - sysv - x32 - : propagated - ; -feature.set-default abi : [ default_abi ] ; - - feature.feature context-impl : fcontext ucontext @@ -112,6 +58,7 @@ feature.set-default context-impl : fcontext ; feature.compose ucontext : BOOST_USE_UCONTEXT ; feature.compose winfib : BOOST_USE_WINFIB ; + # ARM # ARM/AAPCS/ELF alias asm_sources @@ -962,5 +909,3 @@ lib boost_context : impl_sources stack_traits_sources ; - -boost-install boost_context ; diff --git a/build/Jamfile.v2.orig b/build/Jamfile.v2.orig new file mode 100644 index 00000000..c07847ab --- /dev/null +++ b/build/Jamfile.v2.orig @@ -0,0 +1,966 @@ + +# Boost.Context Library Build Jamfile + +# Copyright Oliver Kowalke 2009. +# 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) + +import common ; +import feature ; +import indirect ; +import modules ; +import os ; +import toolset ; + import ../../config/checks/config : requires ; + +feature.feature segmented-stacks : on : optional propagated composite ; +feature.compose on : BOOST_USE_SEGMENTED_STACKS ; + +feature.feature htm : tsx : optional propagated composite ; +feature.compose tsx : BOOST_USE_TSX ; + +feature.feature valgrind : on : optional propagated composite ; +feature.compose on : BOOST_USE_VALGRIND ; + +project boost/context + : requirements + windows:_WIN32_WINNT=0x0601 + linux,gcc,on:-fsplit-stack + linux,gcc,on:-DBOOST_USE_SEGMENTED_STACKS + gcc,on:"-static-libgcc" + clang,on:-fsplit-stack + clang,on:-DBOOST_USE_SEGMENTED_STACKS + clang,on:"-static-libgcc" + intel,shared:BOOST_CONTEXT_EXPORT=EXPORT + intel,static:BOOST_CONTEXT_EXPORT= + msvc,shared:BOOST_CONTEXT_EXPORT=EXPORT + msvc,static:BOOST_CONTEXT_EXPORT= + clang-win,shared:BOOST_CONTEXT_EXPORT=EXPORT + clang-win,static:BOOST_CONTEXT_EXPORT= + embarcadero,32,shared:BOOST_CONTEXT_EXPORT=EXPORT + embarcadero,32,static:BOOST_CONTEXT_EXPORT= + borland,shared:BOOST_CONTEXT_EXPORT=EXPORT + borland,static:BOOST_CONTEXT_EXPORT= + shared:BOOST_CONTEXT_DYN_LINK=1 + BOOST_CONTEXT_SOURCE + multi + msvc,32:/safeseh + : usage-requirements + shared:BOOST_CONTEXT_DYN_LINK=1 + speed:BOOST_DISABLE_ASSERTS + release:BOOST_DISABLE_ASSERTS + : source-location ../src + ; + + +local rule default_binary_format ( ) +{ + local tmp = elf ; + if [ os.name ] = "NT" { tmp = pe ; } + else if [ os.name ] = "CYGWIN" { tmp = pe ; } + else if [ os.name ] = "AIX" { tmp = xcoff ; } + else if [ os.name ] = "MACOSX" { tmp = mach-o ; } + return $(tmp) ; +} + +feature.feature binary-format + : elf + mach-o + pe + xcoff + : propagated + ; +feature.set-default binary-format : [ default_binary_format ] ; + + +local rule default_abi ( ) +{ + local tmp = sysv ; + if [ os.name ] = "NT" { tmp = ms ; } + else if [ os.name ] = "CYGWIN" { tmp = ms ; } + else if [ os.platform ] = "ARM" { tmp = aapcs ; } + else if [ os.platform ] = "ARM64" { tmp = aapcs ; } + else if [ os.platform ] = "MIPS32" { tmp = o32 ; } + else if [ os.platform ] = "MIPS64" { tmp = n64 ; } + return $(tmp) ; +} + +feature.feature abi + : aapcs + eabi + ms + n32 + n64 + o32 + o64 + sysv + x32 + : propagated + ; +feature.set-default abi : [ default_abi ] ; + + +feature.feature context-impl + : fcontext + ucontext + winfib + : propagated + composite + ; +feature.set-default context-impl : fcontext ; +feature.compose ucontext : BOOST_USE_UCONTEXT ; +feature.compose winfib : BOOST_USE_WINFIB ; + +# ARM +# ARM/AAPCS/ELF +alias asm_sources + : asm/make_arm_aapcs_elf_gas.S + asm/jump_arm_aapcs_elf_gas.S + asm/ontop_arm_aapcs_elf_gas.S + : aapcs + 32 + arm + elf + clang + ; + +alias asm_sources + : asm/make_arm_aapcs_elf_gas.S + asm/jump_arm_aapcs_elf_gas.S + asm/ontop_arm_aapcs_elf_gas.S + : aapcs + 32 + arm + elf + gcc + ; + +alias asm_sources + : asm/make_arm_aapcs_elf_gas.S + asm/jump_arm_aapcs_elf_gas.S + asm/ontop_arm_aapcs_elf_gas.S + : aapcs + 32 + arm + elf + qcc + ; + +# ARM/AAPCS/MACH-O +alias asm_sources + : asm/make_arm_aapcs_macho_gas.S + asm/jump_arm_aapcs_macho_gas.S + asm/ontop_arm_aapcs_macho_gas.S + : aapcs + 32 + arm + mach-o + clang + ; + +alias asm_sources + : asm/make_arm_aapcs_macho_gas.S + asm/jump_arm_aapcs_macho_gas.S + asm/ontop_arm_aapcs_macho_gas.S + : aapcs + 32 + arm + mach-o + darwin + ; + +# ARM/AAPCS/PE +alias asm_sources + : asm/make_arm_aapcs_pe_armasm.asm + asm/jump_arm_aapcs_pe_armasm.asm + asm/ontop_arm_aapcs_pe_armasm.asm + untested.cpp + : aapcs + 32 + arm + pe + msvc + ; + +# ARM64 +# ARM64/AAPCS/ELF +alias asm_sources + : asm/make_arm64_aapcs_elf_gas.S + asm/jump_arm64_aapcs_elf_gas.S + asm/ontop_arm64_aapcs_elf_gas.S + : aapcs + 64 + arm + elf + clang + ; + +alias asm_sources + : asm/make_arm64_aapcs_elf_gas.S + asm/jump_arm64_aapcs_elf_gas.S + asm/ontop_arm64_aapcs_elf_gas.S + : aapcs + 64 + arm + elf + gcc + ; + +# ARM64/AAPCS/MACH-O +alias asm_sources + : asm/make_arm64_aapcs_macho_gas.S + asm/jump_arm64_aapcs_macho_gas.S + asm/ontop_arm64_aapcs_macho_gas.S + : aapcs + 64 + arm + mach-o + clang + ; + +alias asm_sources + : asm/make_arm64_aapcs_macho_gas.S + asm/jump_arm64_aapcs_macho_gas.S + asm/ontop_arm64_aapcs_macho_gas.S + : aapcs + 64 + arm + mach-o + darwin + ; + +# ARM64/AAPCS/PE +alias asm_sources + : asm/make_arm64_aapcs_pe_armasm.asm + asm/jump_arm64_aapcs_pe_armasm.asm + asm/ontop_arm64_aapcs_pe_armasm.asm + : aapcs + 64 + arm + pe + msvc + ; + +# 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 + : sysv + 64 + loongarch + elf + gcc + ; + +# MIPS +# MIPS32/O32/ELF +alias asm_sources + : asm/make_mips32_o32_elf_gas.S + asm/jump_mips32_o32_elf_gas.S + asm/ontop_mips32_o32_elf_gas.S + : o32 + 32 + mips + elf + clang + ; + +alias asm_sources + : asm/make_mips32_o32_elf_gas.S + asm/jump_mips32_o32_elf_gas.S + asm/ontop_mips32_o32_elf_gas.S + : o32 + 32 + mips + elf + gcc + ; + +# MIPS64/N64/ELF +alias asm_sources + : asm/make_mips64_n64_elf_gas.S + asm/jump_mips64_n64_elf_gas.S + asm/ontop_mips64_n64_elf_gas.S + : n64 + 64 + mips + elf + clang + ; + +alias asm_sources + : asm/make_mips64_n64_elf_gas.S + asm/jump_mips64_n64_elf_gas.S + asm/ontop_mips64_n64_elf_gas.S + : n64 + 64 + mips + elf + gcc + ; + +# POWERPC_32 +# POWERPC_32/SYSV/ELF +alias asm_sources + : asm/make_ppc32_sysv_elf_gas.S + asm/jump_ppc32_sysv_elf_gas.S + asm/ontop_ppc32_sysv_elf_gas.S + asm/tail_ontop_ppc32_sysv.cpp + : sysv + 32 + power + elf + clang + ; + +alias asm_sources + : asm/make_ppc32_sysv_elf_gas.S + asm/jump_ppc32_sysv_elf_gas.S + asm/ontop_ppc32_sysv_elf_gas.S + asm/tail_ontop_ppc32_sysv.cpp + : sysv + 32 + power + elf + gcc + ; + +# POWERPC_32/SYSV/MACH-O +alias asm_sources + : asm/make_ppc32_sysv_macho_gas.S + asm/jump_ppc32_sysv_macho_gas.S + asm/ontop_ppc32_sysv_macho_gas.S + asm/tail_ontop_ppc32_sysv.cpp + : sysv + 32 + power + mach-o + clang + ; + +alias asm_sources + : asm/make_ppc32_sysv_macho_gas.S + asm/jump_ppc32_sysv_macho_gas.S + asm/ontop_ppc32_sysv_macho_gas.S + asm/tail_ontop_ppc32_sysv.cpp + : sysv + 32 + power + mach-o + gcc + ; + +alias asm_sources + : asm/make_ppc32_sysv_macho_gas.S + asm/jump_ppc32_sysv_macho_gas.S + asm/ontop_ppc32_sysv_macho_gas.S + asm/tail_ontop_ppc32_sysv.cpp + : sysv + 32 + power + mach-o + darwin + ; + +#POWERPC_32/SYSV/XCOFF +alias asm_sources + : asm/make_ppc32_sysv_xcoff_gas.S + asm/jump_ppc32_sysv_xcoff_gas.S + asm/ontop_ppc32_sysv_xcoff_gas.S + : sysv + 32 + power + xcoff + clang + ; + +alias asm_sources + : asm/make_ppc32_sysv_xcoff_gas.S + asm/jump_ppc32_sysv_xcoff_gas.S + asm/ontop_ppc32_sysv_xcoff_gas.S + : sysv + 32 + power + xcoff + gcc + ; + +# POWERPC_64 +# POWERPC_64/SYSV/ELF +alias asm_sources + : asm/make_ppc64_sysv_elf_gas.S + asm/jump_ppc64_sysv_elf_gas.S + asm/ontop_ppc64_sysv_elf_gas.S + : sysv + 64 + power + elf + clang + ; + +alias asm_sources + : asm/make_ppc64_sysv_elf_gas.S + asm/jump_ppc64_sysv_elf_gas.S + asm/ontop_ppc64_sysv_elf_gas.S + : sysv + 64 + power + elf + gcc + ; + +# POWERPC_64/SYSV/MACH-O +alias asm_sources + : asm/make_ppc64_sysv_macho_gas.S + asm/jump_ppc64_sysv_macho_gas.S + asm/ontop_ppc64_sysv_macho_gas.S + untested.cpp + : sysv + 64 + power + mach-o + clang + ; + +alias asm_sources + : asm/make_ppc64_sysv_macho_gas.S + asm/jump_ppc64_sysv_macho_gas.S + asm/ontop_ppc64_sysv_macho_gas.S + untested.cpp + : sysv + 64 + power + mach-o + gcc + ; + +alias asm_sources + : asm/make_ppc64_sysv_macho_gas.S + asm/jump_ppc64_sysv_macho_gas.S + asm/ontop_ppc64_sysv_macho_gas.S + untested.cpp + : sysv + 64 + power + mach-o + darwin + ; + +# POWERPC_64/SYSV/XCOFF +alias asm_sources + : asm/make_ppc64_sysv_xcoff_gas.S + asm/jump_ppc64_sysv_xcoff_gas.S + asm/ontop_ppc64_sysv_xcoff_gas.S + : sysv + 64 + power + xcoff + clang + ; + +alias asm_sources + : asm/make_ppc64_sysv_xcoff_gas.S + asm/jump_ppc64_sysv_xcoff_gas.S + asm/ontop_ppc64_sysv_xcoff_gas.S + : sysv + 64 + power + xcoff + gcc + ; + +# POWERPC universal +# POWERPC_32_64/SYSV/MACH-O +alias asm_sources + : asm/make_ppc32_ppc64_sysv_macho_gas.S + asm/jump_ppc32_ppc64_sysv_macho_gas.S + asm/ontop_ppc32_ppc64_sysv_macho_gas.S + : sysv + 32_64 + power + mach-o + ; + +# RISCV64 +# RISCV64/SYSV/ELF +alias asm_sources + : asm/make_riscv64_sysv_elf_gas.S + asm/jump_riscv64_sysv_elf_gas.S + asm/ontop_riscv64_sysv_elf_gas.S + : sysv + 64 + riscv + elf + clang + ; + +alias asm_sources + : asm/make_riscv64_sysv_elf_gas.S + asm/jump_riscv64_sysv_elf_gas.S + asm/ontop_riscv64_sysv_elf_gas.S + : sysv + 64 + riscv + elf + gcc + ; + +# S390X +# S390X/SYSV/ELF +alias asm_sources + : asm/make_s390x_sysv_elf_gas.S + asm/jump_s390x_sysv_elf_gas.S + asm/ontop_s390x_sysv_elf_gas.S + : sysv + 64 + s390x + elf + gcc + ; + +alias asm_sources + : asm/make_s390x_sysv_elf_gas.S + asm/jump_s390x_sysv_elf_gas.S + asm/ontop_s390x_sysv_elf_gas.S + : sysv + 64 + s390x + elf + clang + ; + +# X86 +# X86/SYSV/ELF +alias asm_sources + : asm/make_i386_sysv_elf_gas.S + asm/jump_i386_sysv_elf_gas.S + asm/ontop_i386_sysv_elf_gas.S + : sysv + 32 + x86 + elf + clang + ; + +alias asm_sources + : asm/make_i386_sysv_elf_gas.S + asm/jump_i386_sysv_elf_gas.S + asm/ontop_i386_sysv_elf_gas.S + : sysv + 32 + x86 + elf + gcc + ; + +alias asm_sources + : asm/make_i386_sysv_elf_gas.S + asm/jump_i386_sysv_elf_gas.S + asm/ontop_i386_sysv_elf_gas.S + : sysv + 32 + x86 + elf + intel + ; + +# X86/SYSV/MACH-O +alias asm_sources + : asm/make_i386_sysv_macho_gas.S + asm/jump_i386_sysv_macho_gas.S + asm/ontop_i386_sysv_macho_gas.S + : sysv + 32 + x86 + mach-o + clang + ; + +alias asm_sources + : asm/make_i386_sysv_macho_gas.S + asm/jump_i386_sysv_macho_gas.S + asm/ontop_i386_sysv_macho_gas.S + : sysv + 32 + x86 + mach-o + darwin + ; + +# X86/MS/PE +alias asm_sources + : asm/make_i386_ms_pe_gas.asm + asm/jump_i386_ms_pe_gas.asm + asm/ontop_i386_ms_pe_gas.asm + dummy.cpp + : ms + 32 + x86 + pe + clang + ; + +alias asm_sources + : asm/make_i386_ms_pe_masm.asm + asm/jump_i386_ms_pe_masm.asm + asm/ontop_i386_ms_pe_masm.asm + dummy.cpp + : ms + 32 + x86 + pe + clang-win + ; + +alias asm_sources + : asm/make_i386_ms_pe_gas.asm + asm/jump_i386_ms_pe_gas.asm + asm/ontop_i386_ms_pe_gas.asm + dummy.cpp + : ms + 32 + x86 + pe + gcc + ; + +alias asm_sources + : asm/make_i386_ms_pe_masm.asm + asm/jump_i386_ms_pe_masm.asm + asm/ontop_i386_ms_pe_masm.asm + dummy.cpp + : ms + 32 + x86 + pe + intel + ; + +alias asm_sources + : asm/make_i386_ms_pe_masm.asm + asm/jump_i386_ms_pe_masm.asm + asm/ontop_i386_ms_pe_masm.asm + dummy.cpp + : ms + 32 + x86 + pe + msvc + ; + +# Embarcadero on Windows for 32-bits, bcc32x, uses tasm32, +# which is masm compatible +# This is configured in the embarcadero toolset as using +# 'tasm32 /ml' + +alias asm_sources + : asm/make_i386_ms_pe_masm.asm + asm/jump_i386_ms_pe_masm.asm + asm/ontop_i386_ms_pe_masm.asm + dummy.cpp + : ms + 32 + x86 + pe + embarcadero + ; + +# Borland on Windows for 32-bits, bcc32c, uses tasm32, +# which is masm compatible +# This is configured in the borland toolset as using +# 'tasm32 /ml' + +alias asm_sources + : asm/make_i386_ms_pe_masm.asm + asm/jump_i386_ms_pe_masm.asm + asm/ontop_i386_ms_pe_masm.asm + dummy.cpp + : ms + 32 + x86 + pe + borland + ; + +# X86_64 +# X86_64/SYSV/ELF +alias asm_sources + : asm/make_x86_64_sysv_elf_gas.S + asm/jump_x86_64_sysv_elf_gas.S + asm/ontop_x86_64_sysv_elf_gas.S + : sysv + 64 + x86 + elf + clang + ; + +alias asm_sources + : asm/make_x86_64_sysv_elf_gas.S + asm/jump_x86_64_sysv_elf_gas.S + asm/ontop_x86_64_sysv_elf_gas.S + : sysv + 64 + x86 + elf + gcc + ; + +alias asm_sources + : asm/make_x86_64_sysv_elf_gas.S + asm/jump_x86_64_sysv_elf_gas.S + asm/ontop_x86_64_sysv_elf_gas.S + : sysv + 64 + x86 + elf + intel + ; + +# X86_64/SYSV/MACH-O +alias asm_sources + : asm/make_x86_64_sysv_macho_gas.S + asm/jump_x86_64_sysv_macho_gas.S + asm/ontop_x86_64_sysv_macho_gas.S + : sysv + 64 + x86 + mach-o + clang + ; + +alias asm_sources + : asm/make_x86_64_sysv_macho_gas.S + asm/jump_x86_64_sysv_macho_gas.S + asm/ontop_x86_64_sysv_macho_gas.S + : sysv + 64 + x86 + mach-o + gcc + ; + +alias asm_sources + : asm/make_x86_64_sysv_macho_gas.S + asm/jump_x86_64_sysv_macho_gas.S + asm/ontop_x86_64_sysv_macho_gas.S + : sysv + 64 + x86 + mach-o + darwin + ; + +alias asm_sources + : asm/make_x86_64_sysv_macho_gas.S + asm/jump_x86_64_sysv_macho_gas.S + asm/ontop_x86_64_sysv_macho_gas.S + : sysv + 64 + x86 + mach-o + intel + ; + +# X86_64/MS/PE +alias asm_sources + : asm/make_x86_64_ms_pe_gas.asm + asm/jump_x86_64_ms_pe_gas.asm + asm/ontop_x86_64_ms_pe_gas.asm + dummy.cpp + : ms + 64 + x86 + pe + clang + ; + +alias asm_sources + : asm/make_x86_64_ms_pe_masm.asm + asm/jump_x86_64_ms_pe_masm.asm + asm/ontop_x86_64_ms_pe_masm.asm + dummy.cpp + : ms + 64 + x86 + pe + clang-win + ; + +alias asm_sources + : asm/make_x86_64_ms_pe_gas.asm + asm/jump_x86_64_ms_pe_gas.asm + asm/ontop_x86_64_ms_pe_gas.asm + dummy.cpp + : ms + 64 + x86 + pe + gcc + ; + +alias asm_sources + : asm/make_x86_64_ms_pe_masm.asm + asm/jump_x86_64_ms_pe_masm.asm + asm/ontop_x86_64_ms_pe_masm.asm + dummy.cpp + : ms + 64 + x86 + pe + intel + ; + +alias asm_sources + : asm/make_x86_64_ms_pe_masm.asm + asm/jump_x86_64_ms_pe_masm.asm + asm/ontop_x86_64_ms_pe_masm.asm + dummy.cpp + : ms + 64 + x86 + pe + msvc + ; + +# Embarcadero on Windows, bcc64, uses the sysv-elf format for 64-bits +# This is configured in the embarcadero toolset as using bcc64 with the +# command line option '-x assembler-with-cpp'. + +alias asm_sources + : asm/make_x86_64_sysv_elf_gas.S + asm/jump_x86_64_sysv_elf_gas.S + asm/ontop_x86_64_sysv_elf_gas.S + : ms + 64 + x86 + pe + embarcadero + ; + +# X86_64/SYSV/X32 +alias asm_sources + : asm/make_x86_64_sysv_elf_gas.S + asm/jump_x86_64_sysv_elf_gas.S + asm/ontop_x86_64_sysv_elf_gas.S + : x32 + 32 + x86 + elf + clang + ; + +alias asm_sources + : asm/make_x86_64_sysv_elf_gas.S + asm/jump_x86_64_sysv_elf_gas.S + asm/ontop_x86_64_sysv_elf_gas.S + : x32 + 32 + x86 + elf + gcc + ; + +alias asm_sources + : asm/make_x86_64_sysv_elf_gas.S + asm/jump_x86_64_sysv_elf_gas.S + asm/ontop_x86_64_sysv_elf_gas.S + : x32 + 32 + x86 + elf + intel + ; + +#X86 universal +alias asm_sources + : asm/make_i386_x86_64_sysv_macho_gas.S + asm/jump_i386_x86_64_sysv_macho_gas.S + asm/ontop_i386_x86_64_sysv_macho_gas.S + : sysv + 32_64 + x86 + mach-o + ; + +# COMBINED +alias asm_sources + : asm/make_combined_sysv_macho_gas.S + asm/jump_combined_sysv_macho_gas.S + asm/ontop_combined_sysv_macho_gas.S + : sysv + arm+x86 + mach-o + ; + +explicit asm_sources ; + + +# fcontext_t +alias impl_sources + : asm_sources + : fcontext + ; + +# ucontext_t +alias impl_sources + : continuation.cpp + fiber.cpp + : ucontext + [ requires cxx11_auto_declarations + cxx11_constexpr + cxx11_defaulted_functions + cxx11_final + cxx11_hdr_thread + cxx11_hdr_tuple + cxx11_lambdas + cxx11_noexcept + cxx11_nullptr + cxx11_rvalue_references + cxx11_template_aliases + cxx11_thread_local + cxx11_variadic_templates ] + ; + +# WinFiber +alias impl_sources + : continuation.cpp + fiber.cpp + : winfib + [ requires cxx11_auto_declarations + cxx11_constexpr + cxx11_defaulted_functions + cxx11_final + cxx11_hdr_thread + cxx11_hdr_tuple + cxx11_lambdas + cxx11_noexcept + cxx11_nullptr + cxx11_rvalue_references + cxx11_template_aliases + cxx11_thread_local + cxx11_variadic_templates ] + ; + +explicit impl_sources ; + +alias stack_traits_sources + : windows/stack_traits.cpp + : windows + ; + +alias stack_traits_sources + : posix/stack_traits.cpp + ; + +explicit stack_traits_sources ; + +lib boost_context + : impl_sources + stack_traits_sources + ; + +boost-install boost_context ; diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index 54019a20..6be2c47b 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -12,12 +12,15 @@ import modules ; import os ; import testing ; import toolset ; -import ../../config/checks/config : requires ; +import config : requires ; using flags ; project boost/context/test : requirements + /boost/array//boost_array + /boost/lexical_cast//boost_lexical_cast /boost/context//boost_context + /boost/variant//boost_variant linux,gcc,on:-fsplit-stack linux,gcc,on:-DBOOST_USE_SEGMENTED_STACKS clang,on:-fsplit-stack From d81d611fa22e83e7a71ced2e3e354a3d776a9bd4 Mon Sep 17 00:00:00 2001 From: Oliver Kowalke Date: Sun, 10 Mar 2024 20:07:00 +0100 Subject: [PATCH 02/16] support gcc for ARM64 on mac OS X - #255 --- build/Jamfile.v2 | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/build/Jamfile.v2 b/build/Jamfile.v2 index 122d15fa..23991b7e 100644 --- a/build/Jamfile.v2 +++ b/build/Jamfile.v2 @@ -177,6 +177,17 @@ alias asm_sources darwin ; +alias asm_sources + : asm/make_arm64_aapcs_macho_gas.S + asm/jump_arm64_aapcs_macho_gas.S + asm/ontop_arm64_aapcs_macho_gas.S + : aapcs + 64 + arm + mach-o + gcc + ; + # ARM64/AAPCS/PE alias asm_sources : asm/make_arm64_aapcs_pe_armasm.asm From d2109fdc2ef1b3475a118e621f627c46a67850e3 Mon Sep 17 00:00:00 2001 From: Claudio Jeker Date: Tue, 13 Feb 2024 11:04:27 +0100 Subject: [PATCH 03/16] Implement the fcontext asm for sparc64 This implements the required asm functions for sparc64_sysv_elf and was tested on an OpenBSD/sparc64 system. Jump_fcontext uses an extra C call frame to store the frame-pointer and return address. Because of this the code is simply a save (to new reg window), then forcing a window flush and finally switch stack and restore from there. Since jump_fcontext() uses a register window and stack frame, make_fcontext() reserves two call frames on the stack (one for jump_fcontext() and the other for the callback function). OpenBSD/sparc64 uses stackghost which prevents userland from overriding the return-address on the stack. Because of this make_fcontext() uses an extra trampoline to implement the _exit(0) call if the callback returns. All tests pass with this on OpenBSD/sparc64 (also the tests for fiber, coroutine and coroutine2). --- build/Jamfile.v2 | 24 ++++++++++ src/asm/jump_sparc64_sysv_elf_gas.S | 51 +++++++++++++++++++++ src/asm/make_sparc64_sysv_elf_gas.S | 68 ++++++++++++++++++++++++++++ src/asm/ontop_sparc64_sysv_elf_gas.S | 50 ++++++++++++++++++++ 4 files changed, 193 insertions(+) create mode 100644 src/asm/jump_sparc64_sysv_elf_gas.S create mode 100644 src/asm/make_sparc64_sysv_elf_gas.S create mode 100644 src/asm/ontop_sparc64_sysv_elf_gas.S diff --git a/build/Jamfile.v2 b/build/Jamfile.v2 index 23991b7e..6d4da5a0 100644 --- a/build/Jamfile.v2 +++ b/build/Jamfile.v2 @@ -466,6 +466,30 @@ alias asm_sources gcc ; +# SPARC64 +# SPARC64/SYSV/ELF +alias asm_sources + : asm/make_sparc64_sysv_elf_gas.S + asm/jump_sparc64_sysv_elf_gas.S + asm/ontop_sparc64_sysv_elf_gas.S + : sysv + 64 + sparc + elf + clang + ; + +alias asm_sources + : asm/make_sparc64_sysv_elf_gas.S + asm/jump_sparc64_sysv_elf_gas.S + asm/ontop_sparc64_sysv_elf_gas.S + : sysv + 64 + sparc + elf + gcc + ; + # S390X # S390X/SYSV/ELF alias asm_sources diff --git a/src/asm/jump_sparc64_sysv_elf_gas.S b/src/asm/jump_sparc64_sysv_elf_gas.S new file mode 100644 index 00000000..61101fb1 --- /dev/null +++ b/src/asm/jump_sparc64_sysv_elf_gas.S @@ -0,0 +1,51 @@ +/* + Copyright Claudio Jeker 2024 + 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) +*/ + +/* + * typedef void* fcontext_t; + * + * struct transfer_t { + * fcontext_t fctx; + * void * data; + * }; + * + * transfer_t jump_fcontext(fcontext_t const to, void *vp); + */ +#define CC64FSZ 176 +#define BIAS 2047 +#define SP 128 +#define I7 136 + +.file "jump_sparc64_sysv_elf_gas.S" +.text +.align 4 +.global jump_fcontext +.type jump_fcontext, %function +jump_fcontext: + # prepare stack + save %sp, -CC64FSZ, %sp + + # store framepointer and return address in slots reserved + # for arguments + stx %fp, [%sp + BIAS + SP] + stx %i7, [%sp + BIAS + I7] + mov %sp, %o0 + # force flush register windows to stack and with that save context + flushw + # get SP (pointing to new context-data) from %i0 param + mov %i0, %sp + # load framepointer and return address from context + ldx [%sp + BIAS + SP], %fp + ldx [%sp + BIAS + I7], %i7 + + ret + restore %o0, %g0, %o0 + # restore old %sp (pointing to old context-data) in %o0 + # *data stored in %o1 was not modified +.size jump_fcontext,.-jump_fcontext +# Mark that we don't need executable stack. +.section .note.GNU-stack,"",%progbits diff --git a/src/asm/make_sparc64_sysv_elf_gas.S b/src/asm/make_sparc64_sysv_elf_gas.S new file mode 100644 index 00000000..3e7ee809 --- /dev/null +++ b/src/asm/make_sparc64_sysv_elf_gas.S @@ -0,0 +1,68 @@ +/* + Copyright Claudio Jeker 2024 + 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) +*/ + +/* + * fcontext_t *make_fcontext(void *sp, size_t size, void (*fn)(transfer_t)); + */ +#define CC64FSZ 176 +#define BIAS 2047 +#define FP 112 +#define SP 128 +#define I7 136 + +.file "make_sparc64_sysv_elf_gas.S" +.text +.align 4 +.global make_fcontext +.type make_fcontext, %function +make_fcontext: + save %sp, -CC64FSZ, %sp + + # shift address in %i0 (allocated stack) to lower 16 byte boundary + and %i0, -0xf, %i0 + + # reserve space for two frames on the stack + # the first frame is for the call the second one holds the data + # for jump_fcontext + sub %i0, 2 * CC64FSZ, %i0 + + # third argument of make_fcontext() is the context-function to call + # store it in the first stack frame, also clear %fp there to indicate + # the end of the stack. + stx %i2, [%i0 + CC64FSZ + I7] + stx %g0, [%i0 + CC64FSZ + FP] + + # On OpenBSD stackghost prevents overriding the return address on + # a stack frame. So this code uses an extra trampoline to load + # to call the context-function and then do the _exit(0) dance. + # Extract the full address of the trampoline via pc relative addressing +1: + rd %pc, %l0 + add %l0, (trampoline - 1b - 8), %l0 + stx %l0, [%i0 + I7] + + # Save framepointer to first stack frame but first substract the BIAS + add %i0, CC64FSZ - BIAS, %l0 + stx %l0, [%i0 + SP] + + # Return context-data which is also includes the BIAS + ret + restore %i0, -BIAS, %o0 + +trampoline: + ldx [%sp + BIAS + I7], %l0 + + # no need to setup transfer_t, already in %o0 and %o1 + jmpl %l0, %o7 + nop + + call _exit + clr %o0 + unimp +.size make_fcontext,.-make_fcontext +# Mark that we don't need executable stack. +.section .note.GNU-stack,"",%progbits diff --git a/src/asm/ontop_sparc64_sysv_elf_gas.S b/src/asm/ontop_sparc64_sysv_elf_gas.S new file mode 100644 index 00000000..2fcdb891 --- /dev/null +++ b/src/asm/ontop_sparc64_sysv_elf_gas.S @@ -0,0 +1,50 @@ +/* + Copyright Claudio Jeker 2024 + 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) +*/ + +/* + * transfer_t ontop_fcontext(fcontext_t const to, void *vp, transfer_t (*fn)(transfer_t)); + */ +#define CC64FSZ 176 +#define BIAS 2047 +#define SP 128 +#define I7 136 + +.file "ontop_sparc64_sysv_elf_gas.S" +.text +.align 4 +.global ontop_fcontext +.type ontop_fcontext, %function +ontop_fcontext: + # prepare stack + save %sp, -CC64FSZ, %sp + + # store framepointer and return address in slots reserved + # for arguments + stx %fp, [%sp + BIAS + SP] + stx %i7, [%sp + BIAS + I7] + mov %sp, %o0 + # force flush register windows to stack and with that save context + flushw + # get SP (pointing to new context-data) from %i0 param + mov %i0, %sp + # load framepointer and return address from context + ldx [%sp + BIAS + SP], %fp + ldx [%sp + BIAS + I7], %i7 + + # ontop_fcontext requires to directly call a function on top of the + # current frame so restore register window before doing the jump + # to the context function which then is in %o2. Do not clobber + # %o7 in the jump so that (*fn)() returns to that address. + restore %o0, %g0, %o0 + # restore old %sp (pointing to old context-data) in %o0 + # *data stored in %o1 was not modified + + jmpl %o2, %g0 + nop +.size jump_fcontext,.-jump_fcontext +# Mark that we don't need executable stack. +.section .note.GNU-stack,"",%progbits From 625bcb96ab828a1212693b241266871d9fd6bf05 Mon Sep 17 00:00:00 2001 From: Oliver Kowalke Date: Sun, 10 Mar 2024 20:20:54 +0100 Subject: [PATCH 04/16] update documentation --- doc/architectures.qbk | 2 +- doc/stack.qbk | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/architectures.qbk b/doc/architectures.qbk index 8cd33eae..b17e1f22 100644 --- a/doc/architectures.qbk +++ b/doc/architectures.qbk @@ -21,7 +21,7 @@ architectures: [[ppc64] [SYSV|ELF|XCOFF] [-] [SYSV|MACH-O] [-]] [[riscv64] [SYSV|ELF] [-] [SYSV] [-]] [[s390x] [SYSV|ELF] [-] [-] [-]] - [[sparc] [-] [-] [-] [-]] + [[sparc64] [SYSV|ELF] [-] [-] [-]] [[x86_64] [SYSV,X32|ELF] [MS|PE] [SYSV|MACH-O] [-]] ] diff --git a/doc/stack.qbk b/doc/stack.qbk index 4445a807..171a7969 100644 --- a/doc/stack.qbk +++ b/doc/stack.qbk @@ -291,7 +291,7 @@ a stack.]] [variablelist [[Returns:] [Returns a default stack size, which may be platform specific. If the stack is unbounded then the present implementation returns the maximum of -`64 kB` and `minimum_size()`.]] +`128 kB` and `minimum_size()`.]] [[Throws:] [Nothing.]] ] From 79bfdc584b2a4c67c8b21a3b09d9600097672e9d Mon Sep 17 00:00:00 2001 From: Claudio Jeker Date: Tue, 13 Feb 2024 10:57:26 +0100 Subject: [PATCH 05/16] Add the BOOST_CONTEXT_USE_MAP_STACK logic to test_fcontext.cpp Without this test_fcontext.cpp fails on OpenBSD with a not-on-stack OS error. --- test/test_fcontext.cpp | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/test/test_fcontext.cpp b/test/test_fcontext.cpp index 51732426..6bbd9ed6 100644 --- a/test/test_fcontext.cpp +++ b/test/test_fcontext.cpp @@ -23,6 +23,12 @@ #include #include +#if defined(BOOST_CONTEXT_USE_MAP_STACK) +extern "C" { +#include +} +#endif + #define BOOST_CHECK(x) BOOST_TEST(x) #define BOOST_CHECK_EQUAL(a, b) BOOST_TEST_EQ(a, b) @@ -44,8 +50,17 @@ class simple_stack_allocator BOOST_ASSERT( minimum_stacksize() <= size); BOOST_ASSERT( maximum_stacksize() >= size); - void * limit = malloc( size); - if ( ! limit) throw std::bad_alloc(); +#if defined(BOOST_CONTEXT_USE_MAP_STACK) + void * limit = ::mmap( 0, size, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANON | MAP_STACK, -1, 0); + if ( limit == MAP_FAILED) { + throw std::bad_alloc(); + } +#else + void * limit = std::malloc( size); + if ( ! limit) { + throw std::bad_alloc(); + } +#endif return static_cast< char * >( limit) + size; } @@ -57,7 +72,11 @@ class simple_stack_allocator BOOST_ASSERT( maximum_stacksize() >= size); void * limit = static_cast< char * >( vp) - size; +#if defined(BOOST_CONTEXT_USE_MAP_STACK) + ::munmap( vp, size); +#else free( limit); +#endif } }; From 2c1409c17a6b1039bb14feef83c4afaa20631ed5 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Fri, 29 Mar 2024 21:15:58 -0500 Subject: [PATCH 06/16] Switch to library requirements instead of source. As source puts extra source in install targets. --- build.jam | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/build.jam b/build.jam index 998504c2..b48e790d 100644 --- a/build.jam +++ b/build.jam @@ -12,13 +12,13 @@ import predef ; project /boost/context : common-requirements - /boost/assert//boost_assert - /boost/config//boost_config - /boost/core//boost_core - /boost/mp11//boost_mp11 - /boost/pool//boost_pool - /boost/predef//boost_predef - /boost/smart_ptr//boost_smart_ptr + /boost/assert//boost_assert + /boost/config//boost_config + /boost/core//boost_core + /boost/mp11//boost_mp11 + /boost/pool//boost_pool + /boost/predef//boost_predef + /boost/smart_ptr//boost_smart_ptr include : requirements # Auto-detect toolset default address-model and architecture. From 877d450537d163274d3b7bc09d9427ee1a9c6a2b Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Fri, 26 Apr 2024 23:06:09 -0500 Subject: [PATCH 07/16] Remove accidentally added conflict file. --- build/Jamfile.v2.orig | 966 ------------------------------------------ 1 file changed, 966 deletions(-) delete mode 100644 build/Jamfile.v2.orig diff --git a/build/Jamfile.v2.orig b/build/Jamfile.v2.orig deleted file mode 100644 index c07847ab..00000000 --- a/build/Jamfile.v2.orig +++ /dev/null @@ -1,966 +0,0 @@ - -# Boost.Context Library Build Jamfile - -# Copyright Oliver Kowalke 2009. -# 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) - -import common ; -import feature ; -import indirect ; -import modules ; -import os ; -import toolset ; - import ../../config/checks/config : requires ; - -feature.feature segmented-stacks : on : optional propagated composite ; -feature.compose on : BOOST_USE_SEGMENTED_STACKS ; - -feature.feature htm : tsx : optional propagated composite ; -feature.compose tsx : BOOST_USE_TSX ; - -feature.feature valgrind : on : optional propagated composite ; -feature.compose on : BOOST_USE_VALGRIND ; - -project boost/context - : requirements - windows:_WIN32_WINNT=0x0601 - linux,gcc,on:-fsplit-stack - linux,gcc,on:-DBOOST_USE_SEGMENTED_STACKS - gcc,on:"-static-libgcc" - clang,on:-fsplit-stack - clang,on:-DBOOST_USE_SEGMENTED_STACKS - clang,on:"-static-libgcc" - intel,shared:BOOST_CONTEXT_EXPORT=EXPORT - intel,static:BOOST_CONTEXT_EXPORT= - msvc,shared:BOOST_CONTEXT_EXPORT=EXPORT - msvc,static:BOOST_CONTEXT_EXPORT= - clang-win,shared:BOOST_CONTEXT_EXPORT=EXPORT - clang-win,static:BOOST_CONTEXT_EXPORT= - embarcadero,32,shared:BOOST_CONTEXT_EXPORT=EXPORT - embarcadero,32,static:BOOST_CONTEXT_EXPORT= - borland,shared:BOOST_CONTEXT_EXPORT=EXPORT - borland,static:BOOST_CONTEXT_EXPORT= - shared:BOOST_CONTEXT_DYN_LINK=1 - BOOST_CONTEXT_SOURCE - multi - msvc,32:/safeseh - : usage-requirements - shared:BOOST_CONTEXT_DYN_LINK=1 - speed:BOOST_DISABLE_ASSERTS - release:BOOST_DISABLE_ASSERTS - : source-location ../src - ; - - -local rule default_binary_format ( ) -{ - local tmp = elf ; - if [ os.name ] = "NT" { tmp = pe ; } - else if [ os.name ] = "CYGWIN" { tmp = pe ; } - else if [ os.name ] = "AIX" { tmp = xcoff ; } - else if [ os.name ] = "MACOSX" { tmp = mach-o ; } - return $(tmp) ; -} - -feature.feature binary-format - : elf - mach-o - pe - xcoff - : propagated - ; -feature.set-default binary-format : [ default_binary_format ] ; - - -local rule default_abi ( ) -{ - local tmp = sysv ; - if [ os.name ] = "NT" { tmp = ms ; } - else if [ os.name ] = "CYGWIN" { tmp = ms ; } - else if [ os.platform ] = "ARM" { tmp = aapcs ; } - else if [ os.platform ] = "ARM64" { tmp = aapcs ; } - else if [ os.platform ] = "MIPS32" { tmp = o32 ; } - else if [ os.platform ] = "MIPS64" { tmp = n64 ; } - return $(tmp) ; -} - -feature.feature abi - : aapcs - eabi - ms - n32 - n64 - o32 - o64 - sysv - x32 - : propagated - ; -feature.set-default abi : [ default_abi ] ; - - -feature.feature context-impl - : fcontext - ucontext - winfib - : propagated - composite - ; -feature.set-default context-impl : fcontext ; -feature.compose ucontext : BOOST_USE_UCONTEXT ; -feature.compose winfib : BOOST_USE_WINFIB ; - -# ARM -# ARM/AAPCS/ELF -alias asm_sources - : asm/make_arm_aapcs_elf_gas.S - asm/jump_arm_aapcs_elf_gas.S - asm/ontop_arm_aapcs_elf_gas.S - : aapcs - 32 - arm - elf - clang - ; - -alias asm_sources - : asm/make_arm_aapcs_elf_gas.S - asm/jump_arm_aapcs_elf_gas.S - asm/ontop_arm_aapcs_elf_gas.S - : aapcs - 32 - arm - elf - gcc - ; - -alias asm_sources - : asm/make_arm_aapcs_elf_gas.S - asm/jump_arm_aapcs_elf_gas.S - asm/ontop_arm_aapcs_elf_gas.S - : aapcs - 32 - arm - elf - qcc - ; - -# ARM/AAPCS/MACH-O -alias asm_sources - : asm/make_arm_aapcs_macho_gas.S - asm/jump_arm_aapcs_macho_gas.S - asm/ontop_arm_aapcs_macho_gas.S - : aapcs - 32 - arm - mach-o - clang - ; - -alias asm_sources - : asm/make_arm_aapcs_macho_gas.S - asm/jump_arm_aapcs_macho_gas.S - asm/ontop_arm_aapcs_macho_gas.S - : aapcs - 32 - arm - mach-o - darwin - ; - -# ARM/AAPCS/PE -alias asm_sources - : asm/make_arm_aapcs_pe_armasm.asm - asm/jump_arm_aapcs_pe_armasm.asm - asm/ontop_arm_aapcs_pe_armasm.asm - untested.cpp - : aapcs - 32 - arm - pe - msvc - ; - -# ARM64 -# ARM64/AAPCS/ELF -alias asm_sources - : asm/make_arm64_aapcs_elf_gas.S - asm/jump_arm64_aapcs_elf_gas.S - asm/ontop_arm64_aapcs_elf_gas.S - : aapcs - 64 - arm - elf - clang - ; - -alias asm_sources - : asm/make_arm64_aapcs_elf_gas.S - asm/jump_arm64_aapcs_elf_gas.S - asm/ontop_arm64_aapcs_elf_gas.S - : aapcs - 64 - arm - elf - gcc - ; - -# ARM64/AAPCS/MACH-O -alias asm_sources - : asm/make_arm64_aapcs_macho_gas.S - asm/jump_arm64_aapcs_macho_gas.S - asm/ontop_arm64_aapcs_macho_gas.S - : aapcs - 64 - arm - mach-o - clang - ; - -alias asm_sources - : asm/make_arm64_aapcs_macho_gas.S - asm/jump_arm64_aapcs_macho_gas.S - asm/ontop_arm64_aapcs_macho_gas.S - : aapcs - 64 - arm - mach-o - darwin - ; - -# ARM64/AAPCS/PE -alias asm_sources - : asm/make_arm64_aapcs_pe_armasm.asm - asm/jump_arm64_aapcs_pe_armasm.asm - asm/ontop_arm64_aapcs_pe_armasm.asm - : aapcs - 64 - arm - pe - msvc - ; - -# 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 - : sysv - 64 - loongarch - elf - gcc - ; - -# MIPS -# MIPS32/O32/ELF -alias asm_sources - : asm/make_mips32_o32_elf_gas.S - asm/jump_mips32_o32_elf_gas.S - asm/ontop_mips32_o32_elf_gas.S - : o32 - 32 - mips - elf - clang - ; - -alias asm_sources - : asm/make_mips32_o32_elf_gas.S - asm/jump_mips32_o32_elf_gas.S - asm/ontop_mips32_o32_elf_gas.S - : o32 - 32 - mips - elf - gcc - ; - -# MIPS64/N64/ELF -alias asm_sources - : asm/make_mips64_n64_elf_gas.S - asm/jump_mips64_n64_elf_gas.S - asm/ontop_mips64_n64_elf_gas.S - : n64 - 64 - mips - elf - clang - ; - -alias asm_sources - : asm/make_mips64_n64_elf_gas.S - asm/jump_mips64_n64_elf_gas.S - asm/ontop_mips64_n64_elf_gas.S - : n64 - 64 - mips - elf - gcc - ; - -# POWERPC_32 -# POWERPC_32/SYSV/ELF -alias asm_sources - : asm/make_ppc32_sysv_elf_gas.S - asm/jump_ppc32_sysv_elf_gas.S - asm/ontop_ppc32_sysv_elf_gas.S - asm/tail_ontop_ppc32_sysv.cpp - : sysv - 32 - power - elf - clang - ; - -alias asm_sources - : asm/make_ppc32_sysv_elf_gas.S - asm/jump_ppc32_sysv_elf_gas.S - asm/ontop_ppc32_sysv_elf_gas.S - asm/tail_ontop_ppc32_sysv.cpp - : sysv - 32 - power - elf - gcc - ; - -# POWERPC_32/SYSV/MACH-O -alias asm_sources - : asm/make_ppc32_sysv_macho_gas.S - asm/jump_ppc32_sysv_macho_gas.S - asm/ontop_ppc32_sysv_macho_gas.S - asm/tail_ontop_ppc32_sysv.cpp - : sysv - 32 - power - mach-o - clang - ; - -alias asm_sources - : asm/make_ppc32_sysv_macho_gas.S - asm/jump_ppc32_sysv_macho_gas.S - asm/ontop_ppc32_sysv_macho_gas.S - asm/tail_ontop_ppc32_sysv.cpp - : sysv - 32 - power - mach-o - gcc - ; - -alias asm_sources - : asm/make_ppc32_sysv_macho_gas.S - asm/jump_ppc32_sysv_macho_gas.S - asm/ontop_ppc32_sysv_macho_gas.S - asm/tail_ontop_ppc32_sysv.cpp - : sysv - 32 - power - mach-o - darwin - ; - -#POWERPC_32/SYSV/XCOFF -alias asm_sources - : asm/make_ppc32_sysv_xcoff_gas.S - asm/jump_ppc32_sysv_xcoff_gas.S - asm/ontop_ppc32_sysv_xcoff_gas.S - : sysv - 32 - power - xcoff - clang - ; - -alias asm_sources - : asm/make_ppc32_sysv_xcoff_gas.S - asm/jump_ppc32_sysv_xcoff_gas.S - asm/ontop_ppc32_sysv_xcoff_gas.S - : sysv - 32 - power - xcoff - gcc - ; - -# POWERPC_64 -# POWERPC_64/SYSV/ELF -alias asm_sources - : asm/make_ppc64_sysv_elf_gas.S - asm/jump_ppc64_sysv_elf_gas.S - asm/ontop_ppc64_sysv_elf_gas.S - : sysv - 64 - power - elf - clang - ; - -alias asm_sources - : asm/make_ppc64_sysv_elf_gas.S - asm/jump_ppc64_sysv_elf_gas.S - asm/ontop_ppc64_sysv_elf_gas.S - : sysv - 64 - power - elf - gcc - ; - -# POWERPC_64/SYSV/MACH-O -alias asm_sources - : asm/make_ppc64_sysv_macho_gas.S - asm/jump_ppc64_sysv_macho_gas.S - asm/ontop_ppc64_sysv_macho_gas.S - untested.cpp - : sysv - 64 - power - mach-o - clang - ; - -alias asm_sources - : asm/make_ppc64_sysv_macho_gas.S - asm/jump_ppc64_sysv_macho_gas.S - asm/ontop_ppc64_sysv_macho_gas.S - untested.cpp - : sysv - 64 - power - mach-o - gcc - ; - -alias asm_sources - : asm/make_ppc64_sysv_macho_gas.S - asm/jump_ppc64_sysv_macho_gas.S - asm/ontop_ppc64_sysv_macho_gas.S - untested.cpp - : sysv - 64 - power - mach-o - darwin - ; - -# POWERPC_64/SYSV/XCOFF -alias asm_sources - : asm/make_ppc64_sysv_xcoff_gas.S - asm/jump_ppc64_sysv_xcoff_gas.S - asm/ontop_ppc64_sysv_xcoff_gas.S - : sysv - 64 - power - xcoff - clang - ; - -alias asm_sources - : asm/make_ppc64_sysv_xcoff_gas.S - asm/jump_ppc64_sysv_xcoff_gas.S - asm/ontop_ppc64_sysv_xcoff_gas.S - : sysv - 64 - power - xcoff - gcc - ; - -# POWERPC universal -# POWERPC_32_64/SYSV/MACH-O -alias asm_sources - : asm/make_ppc32_ppc64_sysv_macho_gas.S - asm/jump_ppc32_ppc64_sysv_macho_gas.S - asm/ontop_ppc32_ppc64_sysv_macho_gas.S - : sysv - 32_64 - power - mach-o - ; - -# RISCV64 -# RISCV64/SYSV/ELF -alias asm_sources - : asm/make_riscv64_sysv_elf_gas.S - asm/jump_riscv64_sysv_elf_gas.S - asm/ontop_riscv64_sysv_elf_gas.S - : sysv - 64 - riscv - elf - clang - ; - -alias asm_sources - : asm/make_riscv64_sysv_elf_gas.S - asm/jump_riscv64_sysv_elf_gas.S - asm/ontop_riscv64_sysv_elf_gas.S - : sysv - 64 - riscv - elf - gcc - ; - -# S390X -# S390X/SYSV/ELF -alias asm_sources - : asm/make_s390x_sysv_elf_gas.S - asm/jump_s390x_sysv_elf_gas.S - asm/ontop_s390x_sysv_elf_gas.S - : sysv - 64 - s390x - elf - gcc - ; - -alias asm_sources - : asm/make_s390x_sysv_elf_gas.S - asm/jump_s390x_sysv_elf_gas.S - asm/ontop_s390x_sysv_elf_gas.S - : sysv - 64 - s390x - elf - clang - ; - -# X86 -# X86/SYSV/ELF -alias asm_sources - : asm/make_i386_sysv_elf_gas.S - asm/jump_i386_sysv_elf_gas.S - asm/ontop_i386_sysv_elf_gas.S - : sysv - 32 - x86 - elf - clang - ; - -alias asm_sources - : asm/make_i386_sysv_elf_gas.S - asm/jump_i386_sysv_elf_gas.S - asm/ontop_i386_sysv_elf_gas.S - : sysv - 32 - x86 - elf - gcc - ; - -alias asm_sources - : asm/make_i386_sysv_elf_gas.S - asm/jump_i386_sysv_elf_gas.S - asm/ontop_i386_sysv_elf_gas.S - : sysv - 32 - x86 - elf - intel - ; - -# X86/SYSV/MACH-O -alias asm_sources - : asm/make_i386_sysv_macho_gas.S - asm/jump_i386_sysv_macho_gas.S - asm/ontop_i386_sysv_macho_gas.S - : sysv - 32 - x86 - mach-o - clang - ; - -alias asm_sources - : asm/make_i386_sysv_macho_gas.S - asm/jump_i386_sysv_macho_gas.S - asm/ontop_i386_sysv_macho_gas.S - : sysv - 32 - x86 - mach-o - darwin - ; - -# X86/MS/PE -alias asm_sources - : asm/make_i386_ms_pe_gas.asm - asm/jump_i386_ms_pe_gas.asm - asm/ontop_i386_ms_pe_gas.asm - dummy.cpp - : ms - 32 - x86 - pe - clang - ; - -alias asm_sources - : asm/make_i386_ms_pe_masm.asm - asm/jump_i386_ms_pe_masm.asm - asm/ontop_i386_ms_pe_masm.asm - dummy.cpp - : ms - 32 - x86 - pe - clang-win - ; - -alias asm_sources - : asm/make_i386_ms_pe_gas.asm - asm/jump_i386_ms_pe_gas.asm - asm/ontop_i386_ms_pe_gas.asm - dummy.cpp - : ms - 32 - x86 - pe - gcc - ; - -alias asm_sources - : asm/make_i386_ms_pe_masm.asm - asm/jump_i386_ms_pe_masm.asm - asm/ontop_i386_ms_pe_masm.asm - dummy.cpp - : ms - 32 - x86 - pe - intel - ; - -alias asm_sources - : asm/make_i386_ms_pe_masm.asm - asm/jump_i386_ms_pe_masm.asm - asm/ontop_i386_ms_pe_masm.asm - dummy.cpp - : ms - 32 - x86 - pe - msvc - ; - -# Embarcadero on Windows for 32-bits, bcc32x, uses tasm32, -# which is masm compatible -# This is configured in the embarcadero toolset as using -# 'tasm32 /ml' - -alias asm_sources - : asm/make_i386_ms_pe_masm.asm - asm/jump_i386_ms_pe_masm.asm - asm/ontop_i386_ms_pe_masm.asm - dummy.cpp - : ms - 32 - x86 - pe - embarcadero - ; - -# Borland on Windows for 32-bits, bcc32c, uses tasm32, -# which is masm compatible -# This is configured in the borland toolset as using -# 'tasm32 /ml' - -alias asm_sources - : asm/make_i386_ms_pe_masm.asm - asm/jump_i386_ms_pe_masm.asm - asm/ontop_i386_ms_pe_masm.asm - dummy.cpp - : ms - 32 - x86 - pe - borland - ; - -# X86_64 -# X86_64/SYSV/ELF -alias asm_sources - : asm/make_x86_64_sysv_elf_gas.S - asm/jump_x86_64_sysv_elf_gas.S - asm/ontop_x86_64_sysv_elf_gas.S - : sysv - 64 - x86 - elf - clang - ; - -alias asm_sources - : asm/make_x86_64_sysv_elf_gas.S - asm/jump_x86_64_sysv_elf_gas.S - asm/ontop_x86_64_sysv_elf_gas.S - : sysv - 64 - x86 - elf - gcc - ; - -alias asm_sources - : asm/make_x86_64_sysv_elf_gas.S - asm/jump_x86_64_sysv_elf_gas.S - asm/ontop_x86_64_sysv_elf_gas.S - : sysv - 64 - x86 - elf - intel - ; - -# X86_64/SYSV/MACH-O -alias asm_sources - : asm/make_x86_64_sysv_macho_gas.S - asm/jump_x86_64_sysv_macho_gas.S - asm/ontop_x86_64_sysv_macho_gas.S - : sysv - 64 - x86 - mach-o - clang - ; - -alias asm_sources - : asm/make_x86_64_sysv_macho_gas.S - asm/jump_x86_64_sysv_macho_gas.S - asm/ontop_x86_64_sysv_macho_gas.S - : sysv - 64 - x86 - mach-o - gcc - ; - -alias asm_sources - : asm/make_x86_64_sysv_macho_gas.S - asm/jump_x86_64_sysv_macho_gas.S - asm/ontop_x86_64_sysv_macho_gas.S - : sysv - 64 - x86 - mach-o - darwin - ; - -alias asm_sources - : asm/make_x86_64_sysv_macho_gas.S - asm/jump_x86_64_sysv_macho_gas.S - asm/ontop_x86_64_sysv_macho_gas.S - : sysv - 64 - x86 - mach-o - intel - ; - -# X86_64/MS/PE -alias asm_sources - : asm/make_x86_64_ms_pe_gas.asm - asm/jump_x86_64_ms_pe_gas.asm - asm/ontop_x86_64_ms_pe_gas.asm - dummy.cpp - : ms - 64 - x86 - pe - clang - ; - -alias asm_sources - : asm/make_x86_64_ms_pe_masm.asm - asm/jump_x86_64_ms_pe_masm.asm - asm/ontop_x86_64_ms_pe_masm.asm - dummy.cpp - : ms - 64 - x86 - pe - clang-win - ; - -alias asm_sources - : asm/make_x86_64_ms_pe_gas.asm - asm/jump_x86_64_ms_pe_gas.asm - asm/ontop_x86_64_ms_pe_gas.asm - dummy.cpp - : ms - 64 - x86 - pe - gcc - ; - -alias asm_sources - : asm/make_x86_64_ms_pe_masm.asm - asm/jump_x86_64_ms_pe_masm.asm - asm/ontop_x86_64_ms_pe_masm.asm - dummy.cpp - : ms - 64 - x86 - pe - intel - ; - -alias asm_sources - : asm/make_x86_64_ms_pe_masm.asm - asm/jump_x86_64_ms_pe_masm.asm - asm/ontop_x86_64_ms_pe_masm.asm - dummy.cpp - : ms - 64 - x86 - pe - msvc - ; - -# Embarcadero on Windows, bcc64, uses the sysv-elf format for 64-bits -# This is configured in the embarcadero toolset as using bcc64 with the -# command line option '-x assembler-with-cpp'. - -alias asm_sources - : asm/make_x86_64_sysv_elf_gas.S - asm/jump_x86_64_sysv_elf_gas.S - asm/ontop_x86_64_sysv_elf_gas.S - : ms - 64 - x86 - pe - embarcadero - ; - -# X86_64/SYSV/X32 -alias asm_sources - : asm/make_x86_64_sysv_elf_gas.S - asm/jump_x86_64_sysv_elf_gas.S - asm/ontop_x86_64_sysv_elf_gas.S - : x32 - 32 - x86 - elf - clang - ; - -alias asm_sources - : asm/make_x86_64_sysv_elf_gas.S - asm/jump_x86_64_sysv_elf_gas.S - asm/ontop_x86_64_sysv_elf_gas.S - : x32 - 32 - x86 - elf - gcc - ; - -alias asm_sources - : asm/make_x86_64_sysv_elf_gas.S - asm/jump_x86_64_sysv_elf_gas.S - asm/ontop_x86_64_sysv_elf_gas.S - : x32 - 32 - x86 - elf - intel - ; - -#X86 universal -alias asm_sources - : asm/make_i386_x86_64_sysv_macho_gas.S - asm/jump_i386_x86_64_sysv_macho_gas.S - asm/ontop_i386_x86_64_sysv_macho_gas.S - : sysv - 32_64 - x86 - mach-o - ; - -# COMBINED -alias asm_sources - : asm/make_combined_sysv_macho_gas.S - asm/jump_combined_sysv_macho_gas.S - asm/ontop_combined_sysv_macho_gas.S - : sysv - arm+x86 - mach-o - ; - -explicit asm_sources ; - - -# fcontext_t -alias impl_sources - : asm_sources - : fcontext - ; - -# ucontext_t -alias impl_sources - : continuation.cpp - fiber.cpp - : ucontext - [ requires cxx11_auto_declarations - cxx11_constexpr - cxx11_defaulted_functions - cxx11_final - cxx11_hdr_thread - cxx11_hdr_tuple - cxx11_lambdas - cxx11_noexcept - cxx11_nullptr - cxx11_rvalue_references - cxx11_template_aliases - cxx11_thread_local - cxx11_variadic_templates ] - ; - -# WinFiber -alias impl_sources - : continuation.cpp - fiber.cpp - : winfib - [ requires cxx11_auto_declarations - cxx11_constexpr - cxx11_defaulted_functions - cxx11_final - cxx11_hdr_thread - cxx11_hdr_tuple - cxx11_lambdas - cxx11_noexcept - cxx11_nullptr - cxx11_rvalue_references - cxx11_template_aliases - cxx11_thread_local - cxx11_variadic_templates ] - ; - -explicit impl_sources ; - -alias stack_traits_sources - : windows/stack_traits.cpp - : windows - ; - -alias stack_traits_sources - : posix/stack_traits.cpp - ; - -explicit stack_traits_sources ; - -lib boost_context - : impl_sources - stack_traits_sources - ; - -boost-install boost_context ; From 3850a4da99705236094fcafeb44030acacdc7ea2 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Sun, 28 Apr 2024 20:14:38 -0500 Subject: [PATCH 08/16] Add missing NO_LIB usage requirements. --- build/Jamfile.v2 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/build/Jamfile.v2 b/build/Jamfile.v2 index 6d4da5a0..4feff766 100644 --- a/build/Jamfile.v2 +++ b/build/Jamfile.v2 @@ -41,6 +41,7 @@ project msvc,32:/safeseh : usage-requirements shared:BOOST_CONTEXT_DYN_LINK=1 + BOOST_CONTEXT_NO_LIB=1 speed:BOOST_DISABLE_ASSERTS release:BOOST_DISABLE_ASSERTS : source-location ../src @@ -807,7 +808,7 @@ alias asm_sources pe msvc ; - + # Embarcadero on Windows, bcc64, uses the sysv-elf format for 64-bits # This is configured in the embarcadero toolset as using bcc64 with the # command line option '-x assembler-with-cpp'. From ebca1ad3af1593bd20cab9b2152c401d23791106 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Sat, 4 May 2024 23:28:40 -0500 Subject: [PATCH 09/16] Add missing import-search for cconfig/predef checks. --- test/Jamfile.v2 | 1 + 1 file changed, 1 insertion(+) diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index 6be2c47b..dbd6a9f1 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -12,6 +12,7 @@ import modules ; import os ; import testing ; import toolset ; +import-search /boost/config/checks ; import config : requires ; using flags ; From b0af135610a2897777c5dfdcd1172cafbcb59944 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Sun, 5 May 2024 09:00:01 -0500 Subject: [PATCH 10/16] Add requires-b2 check to top-level build file. --- build.jam | 2 ++ 1 file changed, 2 insertions(+) diff --git a/build.jam b/build.jam index b48e790d..b0b8967b 100644 --- a/build.jam +++ b/build.jam @@ -3,6 +3,8 @@ # (See accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) +require-b2 5.1 ; + import-search /boost/predef/tools/check ; import project ; From 649dd50d2c7c6a2f7f6af7a3c1ea0c624ee5ac28 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Fri, 14 Jun 2024 11:33:55 -0500 Subject: [PATCH 11/16] Bump B2 require to 5.2 --- build.jam | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/build.jam b/build.jam index b0b8967b..134b3ab3 100644 --- a/build.jam +++ b/build.jam @@ -3,11 +3,10 @@ # (See accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) -require-b2 5.1 ; +require-b2 5.2 ; import-search /boost/predef/tools/check ; -import project ; import feature ; import os ; import predef ; From 9084161b8778c18ebce7514f886f0f22f9bff490 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Thu, 18 Jul 2024 21:44:38 -0500 Subject: [PATCH 12/16] Default ABI for arm needs to check ARM64 platform for Darwin, at least. --- build.jam | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.jam b/build.jam index 134b3ab3..43a20965 100644 --- a/build.jam +++ b/build.jam @@ -60,7 +60,7 @@ local rule default_abi ( ) local tmp = sysv ; if [ os.name ] = "NT" { tmp = ms ; } else if [ os.name ] = "CYGWIN" { tmp = ms ; } - else if [ os.platform ] = "ARM" { tmp = aapcs ; } + else if [ os.platform ] in "ARM" "ARM64" { tmp = aapcs ; } else if [ os.platform ] = "MIPS32" { tmp = o32 ; } else if [ os.platform ] = "MIPS64" { tmp = n64 ; } return $(tmp) ; From 285b05d34787551375769930d2d844b6e67b5b08 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Sat, 20 Jul 2024 22:52:04 -0500 Subject: [PATCH 13/16] Update copyright dates. --- build.jam | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.jam b/build.jam index 43a20965..faa4333b 100644 --- a/build.jam +++ b/build.jam @@ -1,4 +1,4 @@ -# Copyright René Ferdinand Rivera Morell 2023 +# Copyright René Ferdinand Rivera Morell 2023-2024 # 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) From 953437695b9e3c3dc9165355b30a0b6b217c6123 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Tue, 23 Jul 2024 22:34:23 -0500 Subject: [PATCH 14/16] Move inter-lib dependencies to a project variable and into the build targets. --- build.jam | 17 ++++++++++------- build/Jamfile.v2 | 1 + 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/build.jam b/build.jam index faa4333b..b450ad36 100644 --- a/build.jam +++ b/build.jam @@ -11,15 +11,17 @@ import feature ; import os ; import predef ; +constant boost_dependencies : + /boost/assert//boost_assert + /boost/config//boost_config + /boost/core//boost_core + /boost/mp11//boost_mp11 + /boost/pool//boost_pool + /boost/predef//boost_predef + /boost/smart_ptr//boost_smart_ptr ; + project /boost/context : common-requirements - /boost/assert//boost_assert - /boost/config//boost_config - /boost/core//boost_core - /boost/mp11//boost_mp11 - /boost/pool//boost_pool - /boost/predef//boost_predef - /boost/smart_ptr//boost_smart_ptr include : requirements # Auto-detect toolset default address-model and architecture. @@ -88,3 +90,4 @@ explicit call-if : boost-library context : install boost_context ; + diff --git a/build/Jamfile.v2 b/build/Jamfile.v2 index 4feff766..2a753bde 100644 --- a/build/Jamfile.v2 +++ b/build/Jamfile.v2 @@ -17,6 +17,7 @@ import config : requires ; import feature ; project + : common-requirements $(boost_dependencies) : requirements windows:_WIN32_WINNT=0x0601 linux,gcc,on:-fsplit-stack From 3f7b900f0957a116a7d5759e562bf6f2a1fcfbf1 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Fri, 26 Jul 2024 11:22:36 -0500 Subject: [PATCH 15/16] Move custom features to its own file we can import from other projects. --- build.jam | 56 +------------------------------------------------------ 1 file changed, 1 insertion(+), 55 deletions(-) diff --git a/build.jam b/build.jam index b450ad36..28de7941 100644 --- a/build.jam +++ b/build.jam @@ -7,9 +7,8 @@ require-b2 5.2 ; import-search /boost/predef/tools/check ; -import feature ; -import os ; import predef ; +import boost-context-features ; constant boost_dependencies : /boost/assert//boost_assert @@ -29,59 +28,6 @@ project /boost/context [ predef.architecture ] ; -feature.feature segmented-stacks : on : optional propagated composite ; -feature.compose on : BOOST_USE_SEGMENTED_STACKS ; - -feature.feature htm : tsx : optional propagated composite ; -feature.compose tsx : BOOST_USE_TSX ; - -feature.feature valgrind : on : optional propagated composite ; -feature.compose on : BOOST_USE_VALGRIND ; - -local rule default_binary_format ( ) -{ - local tmp = elf ; - if [ os.name ] = "NT" { tmp = pe ; } - else if [ os.name ] = "CYGWIN" { tmp = pe ; } - else if [ os.name ] = "AIX" { tmp = xcoff ; } - else if [ os.name ] = "MACOSX" { tmp = mach-o ; } - return $(tmp) ; -} - -feature.feature binary-format - : elf - mach-o - pe - xcoff - : propagated - ; -feature.set-default binary-format : [ default_binary_format ] ; - -local rule default_abi ( ) -{ - local tmp = sysv ; - if [ os.name ] = "NT" { tmp = ms ; } - else if [ os.name ] = "CYGWIN" { tmp = ms ; } - else if [ os.platform ] in "ARM" "ARM64" { tmp = aapcs ; } - else if [ os.platform ] = "MIPS32" { tmp = o32 ; } - else if [ os.platform ] = "MIPS64" { tmp = n64 ; } - return $(tmp) ; -} - -feature.feature abi - : aapcs - eabi - ms - n32 - n64 - o32 - o64 - sysv - x32 - : propagated - ; -feature.set-default abi : [ default_abi ] ; - explicit [ alias boost_context : build//boost_context ] [ alias all : boost_context test ] From c79fa6187f4a48bf7aae3fac0def9ca69ad972e6 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Fri, 26 Jul 2024 11:22:52 -0500 Subject: [PATCH 16/16] Move custom features to its own file we can import from other projects. --- boost-context-features.jam | 60 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 boost-context-features.jam diff --git a/boost-context-features.jam b/boost-context-features.jam new file mode 100644 index 00000000..ff3265e2 --- /dev/null +++ b/boost-context-features.jam @@ -0,0 +1,60 @@ +# Copyright René Ferdinand Rivera Morell 2023-2024 +# 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) + +import feature ; +import os ; + +feature.feature segmented-stacks : on : optional propagated composite ; +feature.compose on : BOOST_USE_SEGMENTED_STACKS ; + +feature.feature htm : tsx : optional propagated composite ; +feature.compose tsx : BOOST_USE_TSX ; + +feature.feature valgrind : on : optional propagated composite ; +feature.compose on : BOOST_USE_VALGRIND ; + +local rule default_binary_format ( ) +{ + local tmp = elf ; + if [ os.name ] = "NT" { tmp = pe ; } + else if [ os.name ] = "CYGWIN" { tmp = pe ; } + else if [ os.name ] = "AIX" { tmp = xcoff ; } + else if [ os.name ] = "MACOSX" { tmp = mach-o ; } + return $(tmp) ; +} + +feature.feature binary-format + : elf + mach-o + pe + xcoff + : propagated + ; +feature.set-default binary-format : [ default_binary_format ] ; + +local rule default_abi ( ) +{ + local tmp = sysv ; + if [ os.name ] = "NT" { tmp = ms ; } + else if [ os.name ] = "CYGWIN" { tmp = ms ; } + else if [ os.platform ] in "ARM" "ARM64" { tmp = aapcs ; } + else if [ os.platform ] = "MIPS32" { tmp = o32 ; } + else if [ os.platform ] = "MIPS64" { tmp = n64 ; } + return $(tmp) ; +} + +feature.feature abi + : aapcs + eabi + ms + n32 + n64 + o32 + o64 + sysv + x32 + : propagated + ; +feature.set-default abi : [ default_abi ] ;