Skip to content

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

@fraschm1998

Description

@fraschm1998

Problem

webrtc-sys/src/android.cpp lines 33-37 reference __sF, a libc symbol that was removed in Android NDK 28:

#undef stdout
FILE *stdout = &__sF[1];

#undef stderr
FILE *stderr = &__sF[2];

This causes a compilation error when building with NDK 28 or 29:

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

Fix

Replace with POSIX-standard fdopen:

#include <unistd.h>
#undef stdout
FILE *stdout = fdopen(STDOUT_FILENO, "w");
#undef stderr
FILE *stderr = fdopen(STDERR_FILENO, "w");

This is compatible with all NDK versions.

Environment

  • webrtc-sys 0.3.27
  • NDK 28.0.12916984 and 29.0.14206865
  • Target: aarch64-linux-android

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions