Compiling on CYGWIN prints this error:
[ 4%] Building ASM-ATT object libs/context/CMakeFiles/boost_context.dir/src/asm/make_x86_64_sysv_elf_gas.S.o
/usr/bin/as: unrecognized option `-x'
make[2]: *** [libs/context/CMakeFiles/boost_context.dir/build.make:78: libs/context/CMakeFiles/boost_context.dir/src/asm/make_x86_64_sysv_elf_gas.S.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:3961: libs/context/CMakeFiles/boost_context.dir/all] Error 2
make: *** [Makefile:156: all] Error 2
This PR fixes the right assembly sources to build because sysv and elf are nonsense on CYGWIN.
After this patch, it correctly searches make_x86_64_ms_pe_gas.asm, although it still raises an error because unrecognized -x option.
Also mark the non-mangled fcontext asm function symbols
as hidden visibility
These functions should not be exported as dynamic
symbols by boost, only the namespaced C++ symbols
introduced by this patch should.
Without this, asm files passed to gcc with "-c" option (without preprocessing).
It leads to "linker input file unused because linking not done" warnings and
"make_x86_64_ms_pe_gas.asm.obj: No such file or directory" error.
Use CMAKE_SYSTEM_PROCESSOR at first step and if it matches to any
Boost.Context arch option, then we will use it as default arch.
Otherwise we try to detect the known arm names depending on current
bitness.
Fixes#182.
On C++11 static local variables are initialized in thread-safe manner, but even on C++03 it should not be a problem because in our case variables are of trivial types, which means double initialization is not an issue, and they are initialized with the same value in every thread.