-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Fix be2enc and be2dec includes #3720
base: master
Are you sure you want to change the base?
Conversation
Use autoconf probes to see if they're available, and fall back to compat versions in src/compat/endian.h otherwise.
9663ddf
to
7a3ccab
Compare
I've added them to this commit as well. Thanks for the reminder. |
FreeBSD, you say? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reACK on 7a3ccab
- arm64 macOS Sonoma tested to work (doesn't have any
endian.h
) - x86_64 linux tested to work (has GNU
endian.h
but that doesn't have*enc
or*dec
)
FreeBSD should be the final test as that both has BSD sys/endian.h
AND *dec
/*enc
functions.
This comment was marked as resolved.
This comment was marked as resolved.
Hm, I'm expecting to see something like:
Do you have lines like that? |
I'm afraid no.. |
I was able to reproduce the issue from #3673 on FreeBSD 14.1 and boost 1.85 using the Tested with: ./configure --without-gui --enable-c++17 \
BDB_LIBS="-L/usr/local/lib/db5 -ldb_cxx-5.3" \
BDB_CFLAGS="-I/usr/local/include/db5"
The reason that the declarations aren't found is because we're prioritizing If I reverse the check order, it does detect the latter, but I have to read up on any potential downsides of doing that. I propose to take a bit more time for this one, and make sure that we don't mess this up, especially since this touches consensus code (indirectly, but still does.) |
Alternate approach: wrap the defines within I'm leery of reversing the check order because we're vulnerable to any other third-party include changing its own check order. |
Yes, or add |
I dug a bit and found that this is what boost does. In short: if gnu or android or openbsd then endian.h
else if macOS then machine/endian.h
else if bsd then sys/endian.h i.e. the platform selects which to include, which is nasty. But since there is a dependency on this boost code (at least through
Probably the easiest way forward from where we are with this PR right now is to first do 1, then 2? A pure configure.ac solution on top of what is proposed here is possible, by simply testing the same way boost does on top of the detected presence of |
Attempt to address #3673 . This approach works for me on x86-64 Linux.