Skip to content

musl/OHOS compatibility: dlopen detection, _LARGEFILE64_SOURCE, config.guess - #1406

Open
wotomchen wants to merge 2 commits into
steveicarus:masterfrom
wotomchen:musl-compatibility-fixes
Open

musl/OHOS compatibility: dlopen detection, _LARGEFILE64_SOURCE, config.guess#1406
wotomchen wants to merge 2 commits into
steveicarus:masterfrom
wotomchen:musl-compatibility-fixes

Conversation

@wotomchen

Copy link
Copy Markdown

Three changes for musl libc and OpenHarmony (OHOS) compatibility:

  1. dlopen detection - Check for dlopen in libc before trying -ldl. On musl (and OHOS), dlopen is part of libc with no separate libdl.

  2. _LARGEFILE64_SOURCE fallback - On musl, fopen64 needs _LARGEFILE64_SOURCE to be declared; glibc exposes it via _LARGEFILE_SOURCE alone. Add a fallback check so fopen64 is found on musl.

  3. config.guess OHOS detection - Recognize HarmonyOS from uname -s and canonicalize as *-unknown-linux-ohos.

sailor001 added 2 commits June 24, 2026 14:55
The AC_DEFINE macros for HAVE_LROUND, HAVE_LLROUND, HAVE_NAN,
HAVE_FMIN, HAVE_FMAX, and UINT64_T_AND_ULONG_SAME lack AH_TEMPLATE
declarations, causing autoheader to fail with newer autoconf versions.
Add the corresponding AH_TEMPLATE calls so autoheader can generate
proper config.h.in templates.

Also add the missing #undef entries to the hand-maintained config.h.in
to match.
…fig.guess

* configure.ac: Check for dlopen in libc before trying -ldl. On musl
  (and OpenHarmony), dlopen is part of libc with no separate libdl.

* configure.ac: Add _LARGEFILE64_SOURCE fallback detection for fopen64.
  On musl, fopen64 needs this define to be declared; glibc exposes it
  via _LARGEFILE_SOURCE alone.

* config.guess: Recognize HarmonyOS uname -s output and canonicalize
  as *-unknown-linux-ohos.
@caryr

caryr commented Jul 1, 2026

Copy link
Copy Markdown
Collaborator

This pull request also includes the AH_TEMPLATE changes from the previous PR. For config.guess this change should be pushed into the master repository. I did update to the latest available, but I do not see the Harmony updates in the latest file. Can you push that part of the change upstream as described in the config.guess file? I can pull from upstream when that is done.

@caryr

caryr commented Jul 12, 2026

Copy link
Copy Markdown
Collaborator

Are you planning to push these changes to the config.guess master repository? I'd like to get this applied.

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