-
Notifications
You must be signed in to change notification settings - Fork 10.5k
runtime: workaround GCC 4.8 libstdc++ C++11 conformance #17140
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
Conversation
@swift-ci please test |
I expect the Linux testing here (and for any other PR) to fail until swiftlang/swift-corelibs-foundation#1596 is merged. |
Please test with following PR: @swift-ci please test Linux platform |
stdlib/public/runtime/Casting.cpp
Outdated
@@ -44,6 +44,11 @@ | |||
#include <cstring> | |||
#include <type_traits> | |||
|
|||
#if __GLIBCXX__-0 < 20160726 |
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.
Won't this be true when not using glibc?
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.
Ah, crap. I guess I can't do the clever trick. I'll change this to
#if defined(__GLIBCXX__) && __GLIBCXX__ < 20160726
Good catch!
libstdc++ included with GCC 4.8 does not define `std::max_align_t` as required by the C++11 specification. As a workaround, explicitly create the definition locally. This was fixed in GCC 4.9 and later.
Please test with following PR: @swift-ci please test |
Build failed |
Build failed |
@swift-ci please test and merge |
1 similar comment
@swift-ci please test and merge |
@@ -44,6 +44,11 @@ | |||
#include <cstring> | |||
#include <type_traits> | |||
|
|||
#if defined(__GLIBCXX__) && __GLIBCXX__ < 20160726 | |||
#include <stddef.h> |
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.
…and this could still be cstddef
, right?
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.
max_align_t
is defined by stddef.h
, so this is safer. I did have a look at the failure now that I was able to reproduce it, and this definitely fixed it.
libstdc++ included with GCC 4.8 does not define
std::max_align_t
asrequired by the C++11 specification. As a workaround, explicitly create
the definition locally. This was fixed in GCC 4.9 and later.
Replace this paragraph with a description of your changes and rationale. Provide links to external references/discussions if appropriate.
Resolves SR-NNNN.