Skip to content

Follow up to #30596: missing symbol in linking on gentoo with gcc10 #30675

@kiwifb

Description

@kiwifb

As per #30596 comment:4, #30596 leads to some missing symbols in linking on Gentoo with gcc-10.

The first consequence of it, is failing to build the documentation:

Traceback (most recent call last):
  File "sage_setup/docbuild/__main__.py", line 1, in <module>
    from sage_setup.docbuild import main
  File "/dev/shm/portage/sci-mathematics/sage-9999/work/sage-9999/src-python3_8/sage_setup/docbuild/__init__.py", line 58, in <module>
    import sage.all
  File "/dev/shm/portage/sci-mathematics/sage-9999/work/sage-9999/src-python3_8/build/lib/sage/all.py", line 129, in <module>
    from sage.data_structures.all import *
  File "/dev/shm/portage/sci-mathematics/sage-9999/work/sage-9999/src-python3_8/build/lib/sage/data_structures/all.py", line 3, in <module>
    from .bitset import Bitset, FrozenBitset
ImportError: /dev/shm/portage/sci-mathematics/sage-9999/work/sage-9999/src-python3_8/build/lib/sage/data_structures/bitset.cpython-38-x86_64-linux-gnu.so: undefined symbol: _bitset_issubset

Only 3 symbols from bitset_intrinsics.h are missing

ldd -r /dev/shm/portage/sci-mathematics/sage-9999/work/sage-9999/src-python3_8/build/lib/sage/data_structures/bitset.cpython-38-x86_64-linux-gnu.so | grep _bit
undefined symbol: _bitset_issubset      (/dev/shm/portage/sci-mathematics/sage-9999/work/sage-9999/src-python3_8/build/lib/sage/data_structures/bitset.cpython-38-x86_64-linux-gnu.so)
undefined symbol: _bitset_isempty       (/dev/shm/portage/sci-mathematics/sage-9999/work/sage-9999/src-python3_8/build/lib/sage/data_structures/bitset.cpython-38-x86_64-linux-gnu.so)
undefined symbol: _bitset_eq    (/dev/shm/portage/sci-mathematics/sage-9999/work/sage-9999/src-python3_8/build/lib/sage/data_structures/bitset.cpython-38-x86_64-linux-gnu.so)

Declaring those three inline functions as static fix the problem. This probably implies that the inline keyword semantic from C99+ is involved.

CC: @tscrim

Component: cython

Keywords: bitset

Author: François Bissey

Branch/Commit: 2cf0ebe

Reviewer: Jonathan Kliem

Issue created by migration from https://trac.sagemath.org/ticket/30675

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions