Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Swift: Use of struct statx in Base.subproj/ForSwiftFoundationOnly.h requires -D_GNU_SOURCE #4835

Open
ADKaster opened this issue Oct 4, 2023 · 1 comment

Comments

@ADKaster
Copy link

ADKaster commented Oct 4, 2023

ref: https://forums.swift.org/t/swift-5-9-release-on-ubuntu-22-04-fails-to-build-std-module/67659/2

On the swift:latest docker container, building a simple C++ interop project (as referenced in my forum post) fails because the definition of struct statx is not available. Looking at the glibc sources in bootlin elixir, it seems that <sys/stat.h> only includes <bits/statx.h> if __USE_GNU is defined,. That definition comes from the public define _GNU_SOURCE in <features.h>.

Without providing -D_GNU_SOURCE, I cannot build a simple project on ubuntu 22.04 (for other reasons), nor in the current latest tag of the swift docker container due to this mismatch in assumptions about what will provide the definition of struct statx.

@ADKaster
Copy link
Author

ADKaster commented Oct 4, 2023

I think I figured this one out actually. For inside the container anyway :)

installing cmake from the kit ware repos installs gcc-11 as a dependency at the moment. That breaks things. Removing it and making sure to install libstdc++-10-dev lets the project get to the (probably obvious) swift errors in my example project

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

No branches or pull requests

1 participant