Skip to content

fix(webrtc-sys): replace __sF with POSIX fdopen for NDK 28+#993

Open
fraschm1998 wants to merge 1 commit intolivekit:mainfrom
fraschm1998:fix/android-ndk28-sF
Open

fix(webrtc-sys): replace __sF with POSIX fdopen for NDK 28+#993
fraschm1998 wants to merge 1 commit intolivekit:mainfrom
fraschm1998:fix/android-ndk28-sF

Conversation

@fraschm1998
Copy link
Copy Markdown

Problem

webrtc-sys/src/android.cpp references __sF, a libc internal symbol that was removed in Android NDK 28. This causes compilation errors when building with NDK 28 or 29:

src/android.cpp:34:17: error: use of undeclared identifier '__sF'
   34 | FILE *stdout = &__sF[1];
src/android.cpp:37:17: error: use of undeclared identifier '__sF'
   37 | FILE *stderr = &__sF[2];

Fix

Replace the __sF references with POSIX fdopen(STDOUT_FILENO, ...) and fdopen(STDERR_FILENO, ...). This:

  • Works across all NDK versions (no internal libc symbols)
  • Achieves the same goal: providing stdout/stderr symbols when WebRTC examples need them
  • Uses standard POSIX APIs

Tested

Builds successfully with NDK 28.0.12916984 and NDK 29.0.14206865 targeting aarch64-linux-android.

Closes #992

The __sF libc internal symbol was removed in Android NDK 28. The
previous workaround in android.cpp referenced &__sF[1] and &__sF[2]
to force-define stdout/stderr, causing compilation errors with
NDK 28 and 29:

  src/android.cpp:34:17: error: use of undeclared identifier '__sF'
     34 | FILE *stdout = &__sF[1];

Use POSIX fdopen(STDOUT_FILENO/STDERR_FILENO) instead — works across
all NDK versions and avoids reaching into libc internals.
@CLAassistant
Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


Massimo Fraschetti seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

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.

webrtc-sys: android.cpp uses __sF which was removed in NDK 28+

2 participants