Closed kxxt closed 1 year ago
wrong API selection during build
wrong API selection during build
The wrong API selection is made by the build script of this repository (build/Jamfile.v2
).
If you look into Jamfile you see that sysv is the default for the ABI. It seams that something is wrong with your environment.
If you look into Jamfile you see that sysv is the default for the ABI. It seams that something is wrong with your environment.
Yes, sysv
is the default for the ABI.
os.platform
(which is actually OSPLAT
in the end) is not defined for riscv64 in b2.
I am not familiar with the syntax of the Jamfile so I don't know why the build script end up in the ARM ARM64 case.
This makes the boost context lib 1.83 broken on almost every riscv linux distro that ships boost 1.83.
dpkg-deb -x libboost-context1.83.0_1.83.0-1_riscv64.deb ./
nm -gDC usr/lib/riscv64-linux-gnu/libboost_context.so.1.83.0
w __cxa_finalize@GLIBC_2.27
U __cxa_guard_acquire@CXXABI_1.3
U __cxa_guard_release@CXXABI_1.3
U getrlimit@GLIBC_2.27
w _ITM_deregisterTMCloneTable
w _ITM_registerTMCloneTable
U __stack_chk_fail@GLIBC_2.27
U __stack_chk_guard@GLIBC_2.27
U sysconf@GLIBC_2.27
000000000000092e T boost::context::stack_traits::default_size()
000000000000087a T boost::context::stack_traits::is_unbounded()
000000000000093a T boost::context::stack_traits::maximum_size()
0000000000000934 T boost::context::stack_traits::minimum_size()
00000000000008de T boost::context::stack_traits::page_size()
# jump_fcontext, make_fcontext and ontop_fcontext is missing
e.g.
If jump_fcontext, make_fcontext and ontop_fcontext is vital to this lib, we can make the error fatal, that is, aborting the build instead of producing a broken lib silently.
It seams to be a problem of boost build system (os property) and has to be fixed in tools/build/src/engine/jam.h. We need something similiar to:
#if defined( __riscv ) || defined( __riscv__ )
#if __riscv_xlen == 64
#define OSPLAT "OSPLAT=RISCV64"
#elif __riscv_xlen == 32
#define OSPLAT "OSPLAT=RISCV32"
#endif
#endif
I've no access to RISC systems ... could you evaluate if other other preprocessor definitions beside __riscv
and __riscv__
exist?!
I could provide a merge request for boost.build.
It seams to be a problem of boost build system (os property) and has to be fixed in tools/build/src/engine/jam.h. We need something similiar to:
#if defined( __riscv ) || defined( __riscv__ ) #if __riscv_xlen == 64 #define OSPLAT "OSPLAT=RISCV64" #elif __riscv_xlen == 32 #define OSPLAT "OSPLAT=RISCV32" #endif #endif
I've no access to RISC systems ... could you evaluate if other other preprocessor definitions beside
__riscv
and__riscv__
exist?!
__riscv_xlen
exists: https://github.com/riscv-non-isa/riscv-toolchain-conventions#cc-preprocessor-definitions
I have already referenced this issue from https://github.com/bfgroup/b2/pull/341 and https://github.com/bfgroup/b2/issues/340. And I can confirm my patch fixes this issue.
Maybe the detection logic in Jamfile could be made better as well.
I could provide a merge request for boost.build.
Thanks very much. It seems that boost.build no longer accepts PRs so I sent my PR to bfgroup/b2. It seems that boost itself is still using boost/build instead of bfgroup/b2.
It is upto the bfgroup to merge the merge-request ...
Hi,
I found that
jump_fcontext
,make_fcontext
andontop_fcontext
is missing in our builds on riscv64 linux.It seems the following non-fatal error when building boost is the cause for this:
The abi value is wrong. And I figured out that it is caused by
OSPLAT
not defined for riscv in b2.I will open an issue and PR for bfgroup/b2. But it seems that boost itself is using boostorg/build which doesn't accept PRs now.
I don't know if a PR to bfgroup/b2 will fix this issue in the future so I opened this issue here.