Skip to content

A recent C++ Interop pull broke cross-compiling the stdlib with an alternate sysroot for SwiftGlibc platforms #60224

Closed
@finagolfin

Description

@finagolfin

Describe the bug
My Android CI builds each new snapshot tag of the stdlib with the Android NDK, but since #59846 it cannot cross-compile the stdlib:

swift/stdlib/public/Platform/Glibc.swift.gyb:13:19: error: no such module 'SwiftGlibc'
@_exported import SwiftGlibc // Clang module

Steps To Reproduce
Steps to reproduce the behavior:

  1. Cross-compile the stdlib with an alternate libc sysroot.

Expected behavior
Previously, the Swift compiler would look in the -sdk and -resource-dir flags passed in for a Swift resource directory and use the glibc.modulemap from there. Now, it only remaps any Include directories the clang Driver is aware of, which works fine if using the system libc sysroot, but not for alternate cross-compilation sysroots.

Environment

  • OS: Ubuntu 20.04 x86_64 building for Android API 24 with LTS NDK 23c

Additional context
@3405691582 has also noted that a mistaken check from that pull broke building for non-Linux platforms like BSD.

@egorzhdan, let me know if you have a fix in mind.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions