Skip to content

inline methods (and, xor, difference, etc.) not exported #2

Description

@chickenburgers

On some compilers (e.g. g++7.3.0) the library compiles, but doesn't load, because the methods marked inline don't get exported into the .so

e.g. with inline uint64_t xor(uint64_t a, uint64_t b) { return a ^ b; }, nm bitset.so shows:

0000000000000f50 T _init
U xor
0000000000002950 T assign_bit
00000000000012d0 T bitset_free
0000000000002030 T bitset_new
0000000000002060 T bitset_setup
0000000000204058 B cBitset
U calloc@@GLIBC_2.2.5
0000000000204008 b completed.7696
00000000000011f0 t deregister_tm_clones
U difference

The definitions need to be switched to static to ensure they're exported, like so:
static uint64_t xor(uint64_t a, uint64_t b) { return a ^ b; }

see https://github.com/QuoineFinancial/bitset which did just that

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions