ncbi / ncbi-cxx-toolkit-public

NCBI C++ Toolkit package sources
Other
55 stars 20 forks source link

Build fails on the armv7 architecture: undefined reference to NCBI_SwapPointers #8

Closed yurivict closed 9 months ago

yurivict commented 9 months ago
ld: error: /wrkdirs/usr/ports/biology/ncbi-cxx-toolkit/work/ncbi-cxx-toolkit-public-release-28.0.0/Clang1405-ReleaseMTDLL/lib/libconnect.so: undefined reference to NCBI_SwapPointers [--no-allow-shlib-undefined]

log

src/corelib/ncbiatomic.cpp has NCBI_SwapPointers implementation conditional on NCBI_SLOW_ATOMIC_SWAP which is likely not defined on armv7 leaving this symbol undefined.

Version: 28.0.0 FreeBSD 13.2

vakatov commented 9 months ago

@ucko - can you please take a look? You were the last to person to work with NCBI_SwapPointers()... which was 15 years ago ;-)

ucko commented 9 months ago

(Pasting an emailed comment that I sent a few hours ago but never showed up and taking the opportunity to add a bit of formatting; if it eventually does show up, I apologize in advance for the resulting duplication.)

I’ve committed a pair of adjustments to the traditional Autotools-based build system (which you appear to be using) that should help. These fixes are so far in place only in-house, but should automatically propagate to GitHub by tomorrow.

FTR, my review of the relevant logic indicates that NCBI_SLOW_ATOMIC_SWAP was getting set correctly; I’m pretty sure you would have otherwise encountered errors from the compiler rather than the linker. However, build-system logic meant to reflect the header logic incorrectly lumped 32-bit ARM with 64-bit ARM, for which the Toolkit instead arranges to use inline assembly. (NB: The CMake build system does not so far account for any NCBI_SLOW_ATOMIC_SWAP platforms.)

Thanks for the report, and sorry you ran into trouble!

yurivict commented 9 months ago

Thank you, @ucko .

I will try it once the next release will be out.

Yuri

vakatov commented 9 months ago

Fixed in code, so - resolving.