diff --git a/build/Jamfile.v2 b/build/Jamfile.v2 index 0c85682..7b549ee 100644 --- a/build/Jamfile.v2 +++ b/build/Jamfile.v2 @@ -15,11 +15,13 @@ import toolset ; import architecture ; project boost/context - : source-location ../src : requirements SOLARIS:_XOPEN_SOURCE=600 + shared:BOOST_CONTEXT_DYN_LINK=1 + BOOST_CONTEXT_SOURCE : usage-requirements shared:BOOST_CONTEXT_DYN_LINK=1 + : source-location ../src ; local rule default_binary_format ( ) @@ -459,7 +461,6 @@ alias select_asm_context_sources lib boost_context : select_asm_context_sources - : shared:BOOST_CONTEXT_DYN_LINK=1 ; boost-install boost_context ; diff --git a/example/Jamfile.v2 b/example/Jamfile.v2 index bad2538..7efcd6c 100644 --- a/example/Jamfile.v2 +++ b/example/Jamfile.v2 @@ -32,7 +32,6 @@ else if [ os.name ] = HPUX project boost/context/example : requirements /boost/context//boost_context - BOOST_ALL_NO_LIB=1 static ; diff --git a/include/boost/context/detail/config.hpp b/include/boost/context/detail/config.hpp index 0d7b7fc..3f59ed0 100644 --- a/include/boost/context/detail/config.hpp +++ b/include/boost/context/detail/config.hpp @@ -14,16 +14,12 @@ # undef BOOST_CONTEXT_DECL #endif -#if defined(BOOST_HAS_DECLSPEC) -# if defined(BOOST_ALL_DYN_LINK) || defined(BOOST_CONTEXT_DYN_LINK) -# if ! defined(BOOST_DYN_LINK) -# define BOOST_DYN_LINK -# endif -# if defined(BOOST_CONTEXT_SOURCE) -# define BOOST_CONTEXT_DECL BOOST_SYMBOL_EXPORT -# else -# define BOOST_CONTEXT_DECL BOOST_SYMBOL_IMPORT -# endif +#if (defined(BOOST_ALL_DYN_LINK) || defined(BOOST_CONTEXT_DYN_LINK) ) && ! defined(BOOST_CONTEXT_STATIC_LINK) +# if defined(BOOST_CONTEXT_SOURCE) +# define BOOST_CONTEXT_DECL BOOST_SYMBOL_EXPORT +# define BOOST_CONTEXT_BUILD_DLL +# else +# define BOOST_CONTEXT_DECL BOOST_SYMBOL_IMPORT # endif #endif diff --git a/src/asm/jump_arm_aapcs_elf_gas.S b/src/asm/jump_arm_aapcs_elf_gas.S index 1498414..7c406f6 100644 --- a/src/asm/jump_arm_aapcs_elf_gas.S +++ b/src/asm/jump_arm_aapcs_elf_gas.S @@ -71,3 +71,6 @@ jump_fcontext: @ and as first arg in context function ldmia a2, {v1-v8,sp-pc} @ restore v1-V8,SP-PC .size jump_fcontext,.-jump_fcontext + +/* Mark that we don't need executable stack. */ +.section .note.GNU-stack,"",%progbits diff --git a/src/asm/jump_i386_sysv_elf_gas.S b/src/asm/jump_i386_sysv_elf_gas.S index 7b50dfe..a2bf62a 100644 --- a/src/asm/jump_i386_sysv_elf_gas.S +++ b/src/asm/jump_i386_sysv_elf_gas.S @@ -70,3 +70,6 @@ jump_fcontext: jmp *%edx /* indirect jump to context */ .size jump_fcontext,.-jump_fcontext + +/* Mark that we don't need executable stack. */ +.section .note.GNU-stack,"",%progbits diff --git a/src/asm/jump_mips32_o32_elf_gas.S b/src/asm/jump_mips32_o32_elf_gas.S index fe4c94d..21429b0 100644 --- a/src/asm/jump_mips32_o32_elf_gas.S +++ b/src/asm/jump_mips32_o32_elf_gas.S @@ -94,3 +94,6 @@ jump_fcontext: jr $t9 # jump to context .end jump_fcontext .size jump_fcontext, .-jump_fcontext + +/* Mark that we don't need executable stack. */ +.section .note.GNU-stack,"",%progbits diff --git a/src/asm/jump_ppc32_sysv_elf_gas.S b/src/asm/jump_ppc32_sysv_elf_gas.S index fc866f0..002de70 100644 --- a/src/asm/jump_ppc32_sysv_elf_gas.S +++ b/src/asm/jump_ppc32_sysv_elf_gas.S @@ -178,3 +178,6 @@ jump_fcontext: bctr # jump to context .size jump_fcontext, .-jump_fcontext + +/* Mark that we don't need executable stack. */ +.section .note.GNU-stack,"",%progbits diff --git a/src/asm/jump_ppc64_sysv_elf_gas.S b/src/asm/jump_ppc64_sysv_elf_gas.S index 2bc0861..10c42e1 100644 --- a/src/asm/jump_ppc64_sysv_elf_gas.S +++ b/src/asm/jump_ppc64_sysv_elf_gas.S @@ -199,3 +199,6 @@ jump_fcontext: bctr # jump to context .size .jump_fcontext, .-.jump_fcontext + +/* Mark that we don't need executable stack. */ +.section .note.GNU-stack,"",%progbits diff --git a/src/asm/jump_sparc64_sysv_elf_gas.S b/src/asm/jump_sparc64_sysv_elf_gas.S index 94a4f39..ec01de8 100755 --- a/src/asm/jump_sparc64_sysv_elf_gas.S +++ b/src/asm/jump_sparc64_sysv_elf_gas.S @@ -134,3 +134,6 @@ Lno_fpu: mov %o2, %o0 // return arg as result .size jump_fcontext,.-jump_fcontext + +/* Mark that we don't need executable stack. */ +.section .note.GNU-stack,"",%progbits diff --git a/src/asm/jump_sparc_sysv_elf_gas.S b/src/asm/jump_sparc_sysv_elf_gas.S index e8f7176..5f85c3e 100755 --- a/src/asm/jump_sparc_sysv_elf_gas.S +++ b/src/asm/jump_sparc_sysv_elf_gas.S @@ -130,3 +130,6 @@ Lno_fpu: mov %o2, %o0 // return arg as result .size jump_fcontext,.-jump_fcontext + +/* Mark that we don't need executable stack. */ +.section .note.GNU-stack,"",%progbits diff --git a/src/asm/jump_x86_64_sysv_elf_gas.S b/src/asm/jump_x86_64_sysv_elf_gas.S index 40b65d7..01a567a 100644 --- a/src/asm/jump_x86_64_sysv_elf_gas.S +++ b/src/asm/jump_x86_64_sysv_elf_gas.S @@ -80,3 +80,6 @@ jump_fcontext: jmp *%rcx /* indirect jump to context */ .size jump_fcontext,.-jump_fcontext + +/* Mark that we don't need executable stack. */ +.section .note.GNU-stack,"",%progbits diff --git a/src/asm/make_arm_aapcs_elf_gas.S b/src/asm/make_arm_aapcs_elf_gas.S index 400c522..ca32060 100644 --- a/src/asm/make_arm_aapcs_elf_gas.S +++ b/src/asm/make_arm_aapcs_elf_gas.S @@ -74,3 +74,6 @@ finish: mov a1, #0 @ exit code is zero bl _exit@PLT @ exit application .size make_fcontext,.-make_fcontext + +/* Mark that we don't need executable stack. */ +.section .note.GNU-stack,"",%progbits diff --git a/src/asm/make_i386_sysv_elf_gas.S b/src/asm/make_i386_sysv_elf_gas.S index 703a274..1c90773 100644 --- a/src/asm/make_i386_sysv_elf_gas.S +++ b/src/asm/make_i386_sysv_elf_gas.S @@ -75,3 +75,6 @@ finish: call _exit@PLT /* exit application */ hlt .size make_fcontext,.-make_fcontext + +/* Mark that we don't need executable stack. */ +.section .note.GNU-stack,"",%progbits diff --git a/src/asm/make_mips32_o32_elf_gas.S b/src/asm/make_mips32_o32_elf_gas.S index 1f37394..bf5381a 100644 --- a/src/asm/make_mips32_o32_elf_gas.S +++ b/src/asm/make_mips32_o32_elf_gas.S @@ -83,3 +83,6 @@ finish: jalr $t9 # exit application .end make_fcontext .size make_fcontext, .-make_fcontext + +/* Mark that we don't need executable stack. */ +.section .note.GNU-stack,"",%progbits diff --git a/src/asm/make_ppc32_sysv_elf_gas.S b/src/asm/make_ppc32_sysv_elf_gas.S index 398d3a2..817852d 100644 --- a/src/asm/make_ppc32_sysv_elf_gas.S +++ b/src/asm/make_ppc32_sysv_elf_gas.S @@ -109,3 +109,6 @@ finish: li %r3, 0 # exit code is zero bl _exit@plt # exit application .size make_fcontext, .-make_fcontext + +/* Mark that we don't need executable stack. */ +.section .note.GNU-stack,"",%progbits diff --git a/src/asm/make_ppc64_sysv_elf_gas.S b/src/asm/make_ppc64_sysv_elf_gas.S index da4c259..c4dd38a 100644 --- a/src/asm/make_ppc64_sysv_elf_gas.S +++ b/src/asm/make_ppc64_sysv_elf_gas.S @@ -131,3 +131,6 @@ finish: bl _exit # exit application nop .size .make_fcontext, .-.make_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 index 876a3e2..113e0f5 100755 --- a/src/asm/make_sparc64_sysv_elf_gas.S +++ b/src/asm/make_sparc64_sysv_elf_gas.S @@ -84,3 +84,6 @@ finish: nop .size make_fcontext,.-make_fcontext + +/* Mark that we don't need executable stack. */ +.section .note.GNU-stack,"",%progbits diff --git a/src/asm/make_sparc_sysv_elf_gas.S b/src/asm/make_sparc_sysv_elf_gas.S index 0387da1..2633471 100755 --- a/src/asm/make_sparc_sysv_elf_gas.S +++ b/src/asm/make_sparc_sysv_elf_gas.S @@ -80,3 +80,6 @@ finish: nop .size make_fcontext,.-make_fcontext + +/* Mark that we don't need executable stack. */ +.section .note.GNU-stack,"",%progbits diff --git a/src/asm/make_x86_64_sysv_elf_gas.S b/src/asm/make_x86_64_sysv_elf_gas.S index ba040d0..0a2ff6b 100644 --- a/src/asm/make_x86_64_sysv_elf_gas.S +++ b/src/asm/make_x86_64_sysv_elf_gas.S @@ -72,3 +72,5 @@ finish: hlt .size make_fcontext,.-make_fcontext +/* Mark that we don't need executable stack. */ +.section .note.GNU-stack,"",%progbits