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

Update CMake to 3.9 #666

Merged
merged 7 commits into from
Oct 23, 2024
Merged

Update CMake to 3.9 #666

merged 7 commits into from
Oct 23, 2024

Conversation

waahm7
Copy link
Contributor

@waahm7 waahm7 commented Oct 17, 2024

See: awslabs/aws-c-common#1159

Issue #, if available:
awslabs/aws-c-common#1142

Description of changes:

  • set CXX_VISIBILITY_PRESET hidden
  • update CMake minimum to 3.9

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@waahm7 waahm7 changed the title Update required CMake Update CMake to 3.9 Oct 18, 2024
@waahm7 waahm7 merged commit cc157e8 into main Oct 23, 2024
59 checks passed
@waahm7 waahm7 deleted the update-cmake branch October 23, 2024 17:55
graebm added a commit that referenced this pull request Nov 28, 2024
**Issue:**
A user had been building aws-crt-cpp with `CXXFLAGS=-D_GLIBCXX_USE_CXX11_ABI=0`, and that worked fine until the recent change where we started hiding symbols by default (PR #666)

With symbols hidden by default, and `_GLIBCXX_USE_CXX11_ABI=0`, tests would crash in the destructor of `Aws::Crt::String` (which is `std::string` with a custom allocator).

**Description of changes:**
Don't hide symbols when building for the ancient glibcxx ABI.

I don't 100% understand why this fixes the issue, but the situation is esoteric enough that it doesn't seem worth spending more days on this problem.

**Background**
See: https://gcc.gnu.org/onlinedocs/libstdc++/manual/using_dual_abi.html
GCC had to introduce a new ABI for C++11 which removed the copy-on-write optimization for strings, which is forbidden in C++11 and later (new ABI uses a small-string optimization instead). But GCC let users manually set `_GLIBCXX_USE_CXX11_ABI=0` so they could opt back into the old ABI and continue working with libraries compiled for C++03.

I don't think GCC intended devs to continue using this 10 years later, but some people are, because the old copy-on-write optimization has less memory usage.
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

Successfully merging this pull request may close these issues.

2 participants