-
Notifications
You must be signed in to change notification settings - Fork 113
order limits.h before stdlib.h to workaround for glibc _FORTIFY_SOURCE #1184
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
base: main
Are you sure you want to change the base?
Conversation
`limits.h` must be included before `stdlib.h` when building with glibc and having `_FORTIFY_SOURCE` set to a non-zero value. When building with `_FORTIFY_SOURCE`, `realpath()` is inlined, and its definition depends on whether `limits.h` has been included or not (clearly, this is a terrible idea in terms of interacting with Clang modules and should probably be fixed upstream). If the definition differs from the one in SwiftGlibc, then _TestingInternals will not build. swiftlang/swift-testing#1184
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we put it in alphabetical position? Also, can you include a URL to whatever issue tracks the upstream fix?
@swift-ci test |
Obviously we could also conditionalise this based on platform but I presume it's generally safe to include |
Yes, will do. |
`limits.h` must be included before `stdlib.h` when building with glibc and having `_FORTIFY_SOURCE` set to a non-zero value. When building with `_FORTIFY_SOURCE`, `realpath()` is inlined, and its definition depends on whether `limits.h` has been included or not (clearly, this is a terrible idea in terms of interacting with Clang modules and should probably be fixed upstream). If the definition differs from the one in SwiftGlibc, then _TestingInternals will not build.
Is there a URL we can point to tracking the issue in glibc? |
I haven't filed a bug yet, will do (sorry, it's Sunday, negotiating bug fixing around family life!). |
limits.h
must be included beforestdlib.h
when building with glibc and having_FORTIFY_SOURCE
set to a non-zero value.When building with
_FORTIFY_SOURCE
,realpath()
is inlined, and its definition depends on whetherlimits.h
has been included or not (clearly, this is a terrible idea in terms of interacting with Clang modules and should probably be fixed upstream). If the definition differs from the one in SwiftGlibc, then _TestingInternals will not build.