Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Undefined symbols: _wg_compare_and_swap #15

Closed
joshleaves opened this issue Apr 16, 2014 · 2 comments
Closed

Undefined symbols: _wg_compare_and_swap #15

joshleaves opened this issue Apr 16, 2014 · 2 comments

Comments

@joshleaves
Copy link

Hi,
Tried compiling whitedb on Mac OS X but I kept crashing on the linking phase of make.

Here are the full outputs from both ./configure and make: https://gist.github.com/joshleaves/4a7baa64372273b704eb

Issue seems to come from declaring wg_compare_and_swap as inline. When removing it from prototype and declaration, compilation works fine.

My knowledge on GCC options and C standards is a bit rusty but apparently, depending on the standard (tried compiling with "-std=c99" too), declaring a function inline prevents it from being accessed from another file (in this case, dbdata.c).

My suggestion would be to remove the inline keyword but this could effect performance. I've tried multiple combinations of keywords ("extern", as some articles recommended) but nothing could make compilation work. I'm all ears to work on tests if you have a better idea to keep the "inline" and making it work.

Thanks for your help,

@priitj
Copy link
Owner

priitj commented Apr 17, 2014

Hi,

this should be fixed by commit ad30631, but getting the next package (0.7.3) out will take some time still.

Edited to add: from the compile log I'm assuming you're using 0.7.2, you could continue using that source, but patch it with the diff from the commit I've referenced or drop in dblock.c and dblock.h from the github repo. Regarding the inline keyword and performance, AFAIK it no longer guarantees that the function is inlined with gcc anyway.

@joshleaves
Copy link
Author

That resolved the issue, thanks =)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants