aerospike / aerospike-client-c

Aerospike C Client
Other
98 stars 103 forks source link

Undefined symbols in static library #106

Closed thias closed 3 years ago

thias commented 3 years ago

This is related to https://github.com/aerospike/aerospike-client-php/issues/65

When building aerospike-client-c on RHEL 7.9, the resulting libaerospike.a seems to have unresolved symbols that correspond to code from the "common" files.

Steps to reproduce:

git clone https://github.com/aerospike/aerospike-client-c
cd aerospike-client-c/
git submodule update --init
make

The way I'm checking right now is like this (there are a lot more "U" lines):

$ nm -u target/Linux-x86_64/lib/libaerospike.a | grep g_as_log
                 U g_as_log
                 U g_as_log
                 U g_as_log
                 U g_as_log
                 U g_as_log
                 U g_as_log
                 U g_as_log
                 U g_as_log
                 U g_as_log
                 U g_as_log
                 U g_as_log
                 U g_as_log
                 U g_as_log
                 U g_as_log
                 U g_as_log
                 U g_as_log
                 U g_as_log
                 U g_as_log

I went through the README's build instructions a few times already, and can't figure out if I'm doing anything wrong. This is happening with both 4.x and 5.x. When I ran make test I got a result of 266 tests: 253 passed, 13 failed against a locally running 5.5.0.3 CE, which is even more confusing.

BrianNichols commented 3 years ago

Remove "-u" argument or use "--defined-only" and g_as_log is shown as defined.

$ nm --defined-only target/Linux-x86_64/lib/libaerospike.a | grep g_as_log
0000000000000000 D g_as_log

Can you provide your test output?

thias commented 3 years ago

@BrianNichols : I get the same "D" output indeed. So my issue with g_as_log being undefined in my PHP module is due to something else? I'll keep digging, thanks for the reply!