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

Fix build when htole64 and related macros are defined in endian.h or sys/endian.h #352

Merged
merged 1 commit into from
Mar 10, 2025

Conversation

ribbons
Copy link
Contributor

@ribbons ribbons commented Mar 7, 2025

Currently, if htole64 is available on a platform as a macro in endian.h or sys/endian.h the AC_CHECK_DECL test does not detect them as they are not included in it. As those two headers are however included in the build this causes the declarations of the compat functions to be mangled by the undetected macros and fail to compile.

Resolve this by passing conditional includes of endian.h and sys/endian.h to the includes parameter of the AC_CHECK_DECL macro so that the htole64 macro is detected correctly.

(I found this when attempting to cross compile 2025.87 for Android where htole64 is a macro defined in sys/endian.h.)

Currently, if htole64 is available on a platform as a macro in endian.h
or sys/endian.h the AC_CHECK_DECL check does not detect them as these
files are not included in the test.  As those two headers are however
included in the build this causes the declarations of the compat
functions to be mangled by the undetected macros and fail to compile.

Resolve this by passing conditional includes of endian.h and
sys/endian.h to the includes parameter of the AC_CHECK_DECL macro so
that the htole64 macro is detected correctly.
ribbons added a commit to ribbons/android-dropbear that referenced this pull request Mar 7, 2025
Add a patch (submitted upstream as mkj/dropbear#352) which fixes the
detection of htole64 and related macros by configure and so resolves the
resulting build failure.
ribbons added a commit to ribbons/android-dropbear that referenced this pull request Mar 7, 2025
Add a patch (submitted upstream as mkj/dropbear#352) which fixes the
detection of htole64 and related macros by configure and so resolves the
resulting build failure.
@mkj mkj merged commit ff77ddc into mkj:master Mar 10, 2025
18 checks passed
@mkj
Copy link
Owner

mkj commented Mar 10, 2025

Thanks

@ribbons ribbons deleted the htole64-macro-in-sys-endian branch March 10, 2025 18:28
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

Successfully merging this pull request may close these issues.

2 participants