[libcxx] r250261 - Use __config_site when building libc++. Also cleanup ABI versioning doc
Eric Fiselier via cfe-commits
cfe-commits at lists.llvm.org
Tue Oct 13 17:22:06 PDT 2015
Author: ericwf
Date: Tue Oct 13 19:22:05 2015
New Revision: 250261
URL: http://llvm.org/viewvc/llvm-project?rev=250261&view=rev
Log:
Use __config_site when building libc++. Also cleanup ABI versioning doc
Added:
libcxx/trunk/docs/DesignDocs/ABIVersioning.rst
Removed:
libcxx/trunk/docs/Abi.rst
Modified:
libcxx/trunk/CMakeLists.txt
libcxx/trunk/cmake/Modules/HandleLibcxxFlags.cmake
libcxx/trunk/docs/index.rst
libcxx/trunk/test/libcxx/test/config.py
Modified: libcxx/trunk/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/CMakeLists.txt?rev=250261&r1=250260&r2=250261&view=diff
==============================================================================
--- libcxx/trunk/CMakeLists.txt (original)
+++ libcxx/trunk/CMakeLists.txt Tue Oct 13 19:22:05 2015
@@ -321,6 +321,9 @@ if (LIBCXX_NEEDS_SITE_CONFIG)
include/__config_site.in
${LIBCXX_BINARY_DIR}/__config_site
@ONLY)
+ # Provide the config definitions by included the generated __config_site
+ # file at compile time.
+ add_compile_flags("-include ${LIBCXX_BINARY_DIR}/__config_site")
endif()
#===============================================================================
Modified: libcxx/trunk/cmake/Modules/HandleLibcxxFlags.cmake
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/cmake/Modules/HandleLibcxxFlags.cmake?rev=250261&r1=250260&r2=250261&view=diff
==============================================================================
--- libcxx/trunk/cmake/Modules/HandleLibcxxFlags.cmake (original)
+++ libcxx/trunk/cmake/Modules/HandleLibcxxFlags.cmake Tue Oct 13 19:22:05 2015
@@ -49,10 +49,12 @@ macro(define_if_not condition def)
endif()
endmacro()
+# Add a macro definition to the __config_site file if the specified condition
+# is 'true'. Note that '-D${def}' is not added. Instead it is expected that
+# the build include the '__config_site' header.
macro(config_define_if condition def)
if (${condition})
set(${def} ON)
- add_definitions(-D${def})
set(LIBCXX_NEEDS_SITE_CONFIG ON)
endif()
endmacro()
@@ -60,14 +62,12 @@ endmacro()
macro(config_define_if_not condition def)
if (NOT ${condition})
set(${def} ON)
- add_definitions(-D${def})
set(LIBCXX_NEEDS_SITE_CONFIG ON)
endif()
endmacro()
macro(config_define value def)
set(${def} ${value})
- add_definitions(-D${def}=${value})
set(LIBCXX_NEEDS_SITE_CONFIG ON)
endmacro()
Removed: libcxx/trunk/docs/Abi.rst
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/docs/Abi.rst?rev=250260&view=auto
==============================================================================
--- libcxx/trunk/docs/Abi.rst (original)
+++ libcxx/trunk/docs/Abi.rst (removed)
@@ -1,17 +0,0 @@
-
-====================
-Libc++ ABI stability
-====================
-
-Libc++ aims to preserve stable ABI to avoid subtle bugs when code built to the old ABI
-is linked with the code build to the new ABI. At the same time, libc++ allows ABI-breaking
-improvements and bugfixes for the scenarios when ABI change is not a issue.
-
-To support both cases, libc++ allows specifying the ABI version at the
-build time. The version is defined with a cmake option
-LIBCXX_ABI_VERSION. Another option LIBCXX_ABI_UNSTABLE can be used to
-include all present ABI breaking features. These options translate
-into C++ macro definitions _LIBCPP_ABI_VERSION, _LIBCPP_ABI_UNSTABLE.
-
-Any ABI-changing feature is placed under it's own macro, _LIBCPP_ABI_XXX, which is enabled
-based on the value of _LIBCPP_ABI_VERSION. _LIBCPP_ABI_UNSTABLE, if set, enables all features at once.
Added: libcxx/trunk/docs/DesignDocs/ABIVersioning.rst
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/docs/DesignDocs/ABIVersioning.rst?rev=250261&view=auto
==============================================================================
--- libcxx/trunk/docs/DesignDocs/ABIVersioning.rst (added)
+++ libcxx/trunk/docs/DesignDocs/ABIVersioning.rst Tue Oct 13 19:22:05 2015
@@ -0,0 +1,17 @@
+
+====================
+Libc++ ABI stability
+====================
+
+Libc++ aims to preserve stable ABI to avoid subtle bugs when code built to the old ABI
+is linked with the code build to the new ABI. At the same time, libc++ allows ABI-breaking
+improvements and bugfixes for the scenarios when ABI change is not a issue.
+
+To support both cases, libc++ allows specifying the ABI version at the
+build time. The version is defined with a cmake option
+LIBCXX_ABI_VERSION. Another option LIBCXX_ABI_UNSTABLE can be used to
+include all present ABI breaking features. These options translate
+into C++ macro definitions _LIBCPP_ABI_VERSION, _LIBCPP_ABI_UNSTABLE.
+
+Any ABI-changing feature is placed under it's own macro, _LIBCPP_ABI_XXX, which is enabled
+based on the value of _LIBCPP_ABI_VERSION. _LIBCPP_ABI_UNSTABLE, if set, enables all features at once.
Modified: libcxx/trunk/docs/index.rst
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/docs/index.rst?rev=250261&r1=250260&r2=250261&view=diff
==============================================================================
--- libcxx/trunk/docs/index.rst (original)
+++ libcxx/trunk/docs/index.rst Tue Oct 13 19:22:05 2015
@@ -128,6 +128,7 @@ Design Documents
:maxdepth: 1
DesignDocs/CapturingConfigInfo
+ DesignDocs/ABIVersioning
* `<atomic> design <http://libcxx.llvm.org/atomic_design.html>`_
Modified: libcxx/trunk/test/libcxx/test/config.py
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/libcxx/test/config.py?rev=250261&r1=250260&r2=250261&view=diff
==============================================================================
--- libcxx/trunk/test/libcxx/test/config.py (original)
+++ libcxx/trunk/test/libcxx/test/config.py Tue Oct 13 19:22:05 2015
@@ -444,7 +444,9 @@ class Configuration(object):
def configure_compile_flags_abi_version(self):
abi_version = self.get_lit_conf('abi_version', '').strip()
abi_unstable = self.get_lit_bool('abi_unstable')
- if abi_version:
+ # Only add the ABI version when it is non-default.
+ # FIXME(EricWF): Get the ABI version from the "__config_site".
+ if abi_version and abi_version != '1':
self.cxx.compile_flags += ['-D_LIBCPP_ABI_VERSION=' + abi_version]
if abi_unstable:
self.config.available_features.add('libcpp-abi-unstable')
More information about the cfe-commits
mailing list