Skip to content

.pc for Android contains invalid syntax #138800

Description

@lazka

Bug report

Bug description:

Looking at the Android build here: https://www.python.org/downloads/android/

The .pc files look like this:

# See: man pkg-config
prefix=/usr/local
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include

Name: Python
Description: Build a C extension for Python
Requires:
Version: 3.14
Libs.private: -ldl  -llog
Libs: -L${libdir} $(BLDLIBRARY)
Cflags: -I${includedir}/python3.14

The "Libs:" line contains some autotools internals instead of the library name resulting in linker errors like:

cannot find $(BLDLIBRARY): No such file or directory

Might be related to #115780

Disclaimer: The main reason I'm reporting this is that it also breaks the Cygwin build in the same way, but that's not a supported platform, so this is the next best thing. i.e. I've not actually tested on Android.

CPython versions tested on:

3.13

Operating systems tested on:

Windows

Linked PRs

Activity

  1. added
    type-bugAn unexpected behavior, bug, or error
    on Sep 11, 2025
  2. StanFromIreland commented on Sep 11, 2025

    @StanFromIreland
    Member
  3. added
    buildThe build process and cross-build
    on Sep 11, 2025
  4. added a commit that references this issue on Sep 12, 2025
  5. mhsmith commented on Sep 12, 2025

    @mhsmith
    Member

    Thanks for the report. I guess $(BLDLIBRARY) should probably be replaced with -lpython3.14. However, I'm not currently aware of anyone who uses the .pc file on Android, so I won't pick this up this myself just now.

  6. lazka commented on Sep 12, 2025

    @lazka
    ContributorAuthor

    Fair enough, I've hackily worked this around downstream now.

  7. mhsmith commented on Dec 16, 2025

    @mhsmith
    Member

    This affects any package using Meson, which uses pkgconfig to detect Python, so I'll implement a workaround in cibuildwheel.

    Example error:

    FAILED: numpy/_core/_struct_ufunc_tests.cpython-313-aarch64-linux-android.so 
    /Users/msmith/Library/Android/sdk/ndk/27.3.13750724/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android24-clang  -o numpy/_core/_struct_ufunc_tests.cpython-313-aarch64-linux-android.so numpy/_core/_struct_ufunc_tests.cpython-313-aarch64-linux-android.so.p/src_umath__struct_ufunc_tests.c.o -L/private/var/folders/2t/th8vxc813_gcch7lkh1sbbmc0000gp/T/cibw-run-5ef4oo3_/cp313-android_arm64_v8a/python/prefix/lib -I/private/var/folders/2t/th8vxc813_gcch7lkh1sbbmc0000gp/T/cibw-run-5ef4oo3_/cp313-android_arm64_v8a/python/prefix/include -Wl,--as-needed -Wl,--allow-shlib-undefined -Wl,-O1 -shared -fPIC -lm -Wl,--build-id=sha1 -Wl,--no-rosegment -Wl,-z,max-page-size=16384 -Wl,--no-undefined -D__BIONIC_NO_PAGE_SIZE_MACRO -DNDEBUG -O3 -Wall '$(BLDLIBRARY)'
    clang: error: no such file or directory: '$(BLDLIBRARY)'
    
  8. 48 remaining items

  9. added 2 commits that reference this issue on Feb 20, 2026
  10. added a commit that references this issue on Mar 6, 2026
  11. added a commit that references this issue on May 11, 2026
  12. added a commit that references this issue on Jun 10, 2026
  13. added 2 commits that reference this issue on Aug 3, 2026
  14. lazka commented on Aug 3, 2026

    @lazka
    ContributorAuthor
  15. added 2 commits that reference this issue on Aug 3, 2026
  16. added a commit that references this issue on Aug 5, 2026
  17. added a commit that references this issue on Aug 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    OS-androidbuildThe build process and cross-buildtype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions