Skip to content

Commit 3eb0164

Browse files
committed
fix abi break change
1 parent 535c597 commit 3eb0164

File tree

5 files changed

+13
-8
lines changed

5 files changed

+13
-8
lines changed

libcxx/docs/ABIGuarantees.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,10 @@ hand, backwards compatibility is generally guaranteed.
114114

115115
There are multiple ABI flags that change the symbols exported from the built library:
116116

117+
``_LIBCPP_ABI_DO_NOT_EXPORT_ALIGN``
118+
-------------------------------------------------
119+
This removes ``align()``. In the past ``align()`` is not an inline function, but now it changed to an inline function for performance.
120+
117121
``_LIBCPP_ABI_DO_NOT_EXPORT_BASIC_STRING_COMMON``
118122
-------------------------------------------------
119123
This removes ``__basic_string_common<true>::__throw_length_error()`` and

libcxx/docs/ReleaseNotes/22.rst

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,6 @@ Potentially breaking changes
101101
``_LIBCPP_ABI_NO_ITERATOR_BASES``. If you are using this flag and care about ABI stability, you should set
102102
``_LIBCPP_ABI_NO_REVERSE_ITERATOR_SECOND_MEMBER`` as well.
103103

104-
- ``align`` has been removed from libc++ dynamic library in ABI v2. You could use the ABI flag ``_LIBCPP_DEPRECATED_ABI_LEGACY_LIBRARY_DEFINITIONS_FOR_INLINE_FUNCTIONS`` to reserve it.
105-
106104
Announcements About Future Releases
107105
-----------------------------------
108106

@@ -118,7 +116,7 @@ ABI Affecting Changes
118116
potentially inheriting from the types they wrap. At this point in time we are not aware of any ABI changes caused by
119117
this.
120118

121-
- ``align`` has been removed from libc++ dynamic library in ABI v2. You could use the ABI flag ``_LIBCPP_DEPRECATED_ABI_LEGACY_LIBRARY_DEFINITIONS_FOR_INLINE_FUNCTIONS`` to reserve it.
119+
- ``align`` has been removed from libc++ library in ABI v2. We also add a new ABI flag ``_LIBCPP_ABI_DO_NOT_EXPORT_ALIGN``.
122120

123121
Build System Changes
124122
--------------------

libcxx/include/__configuration/abi.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@
6363

6464
// These flags are documented in ABIGuarantees.rst
6565
# define _LIBCPP_ABI_ALTERNATE_STRING_LAYOUT
66+
# define _LIBCPP_ABI_DO_NOT_EXPORT_ALIGN
6667
# define _LIBCPP_ABI_DO_NOT_EXPORT_BASIC_STRING_COMMON
6768
# define _LIBCPP_ABI_DO_NOT_EXPORT_VECTOR_BASE_COMMON
6869
# define _LIBCPP_ABI_DO_NOT_EXPORT_TO_CHARS_BASE_10

libcxx/include/__memory/align.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,13 @@ __align_impl(size_t __align, size_t __sz, void*& __ptr, size_t& __space) {
3535
return __r;
3636
}
3737

38-
#ifndef _LIBCPP_ALIGN_DEFINE_LEGACY_INLINE_FUNCTIONS
38+
#ifndef _LIBCPP_EXPORT_ALIGN_SYMBOL
3939

4040
inline _LIBCPP_HIDE_FROM_ABI void* align(size_t __align, size_t __sz, void*& __ptr, size_t& __space) {
4141
return __align_impl(__align, __sz, __ptr, __space);
4242
}
4343

44-
#endif // _LIBCPP_ALIGN_DEFINE_LEGACY_INLINE_FUNCTIONS
44+
#endif // _LIBCPP_EXPORT_ALIGN_SYMBOL
4545

4646
_LIBCPP_END_NAMESPACE_STD
4747

libcxx/src/memory.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,11 @@
88

99
#include <__config>
1010
#ifdef _LIBCPP_DEPRECATED_ABI_LEGACY_LIBRARY_DEFINITIONS_FOR_INLINE_FUNCTIONS
11-
# define _LIBCPP_ALIGN_DEFINE_LEGACY_INLINE_FUNCTIONS
1211
# define _LIBCPP_SHARED_PTR_DEFINE_LEGACY_INLINE_FUNCTIONS
1312
#endif
13+
#ifndef _LIBCPP_ABI_DO_NOT_EXPORT_ALIGN
14+
# define _LIBCPP_EXPORT_ALIGN_SYMBOL
15+
#endif
1416

1517
#include <__functional/hash.h>
1618
#include <memory>
@@ -133,11 +135,11 @@ __sp_mut& __get_sp_mut(const void* p) {
133135

134136
#endif // _LIBCPP_HAS_THREADS
135137

136-
#if defined(_LIBCPP_ALIGN_DEFINE_LEGACY_INLINE_FUNCTIONS)
138+
#if defined(_LIBCPP_EXPORT_ALIGN_SYMBOL)
137139

138140
_LIBCPP_EXPORTED_FROM_ABI void* align(size_t alignment, size_t size, void*& ptr, size_t& space) {
139141
return __align_impl(alignment, size, ptr, space);
140142
}
141-
#endif // _LIBCPP_ALIGN_DEFINE_LEGACY_INLINE_FUNCTIONS
143+
#endif // _LIBCPP_EXPORT_ALIGN_SYMBOL
142144

143145
_LIBCPP_END_NAMESPACE_STD

0 commit comments

Comments
 (0)