Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 20 Apr 2024 10:34:22 GMT
From:      Dimitry Andric <dim@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: 335f7960dc37 - stable/13 - Add two FreeBSD customizations to libc++
Message-ID:  <202404201034.43KAYMSC013456@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by dim:

URL: https://cgit.FreeBSD.org/src/commit/?id=335f7960dc37e3f149c0d795909e2d3948c4a554

commit 335f7960dc37e3f149c0d795909e2d3948c4a554
Author:     Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2024-01-07 11:32:29 +0000
Commit:     Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2024-04-19 21:24:41 +0000

    Add two FreeBSD customizations to libc++
    
    This is intended to better support ports usage of older clang versions:
    * Add _LIBCPP_ENABLE_COMPILER_VERSION_CHECKS block around compiler
      version checks, to avoid any warnings about support. This makes some
      ports that use -Werror fall over.
    * When using clang < 15.0, avoid using a type visibility attribute on
      the std namespace, as older versions of clang do not support this.
    
    PR:             276104
    MFC after:      1 month
    
    (cherry picked from commit 412fa3436f0d1fe4a7e5e3b66783aa40f599125e)
---
 contrib/llvm-project/libcxx/include/__config | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/contrib/llvm-project/libcxx/include/__config b/contrib/llvm-project/libcxx/include/__config
index f52fb0441293..959082502a49 100644
--- a/contrib/llvm-project/libcxx/include/__config
+++ b/contrib/llvm-project/libcxx/include/__config
@@ -32,6 +32,7 @@
 
 // Warn if a compiler version is used that is not supported anymore
 // LLVM RELEASE Update the minimum compiler versions
+#if defined(_LIBCPP_ENABLE_COMPILER_VERSION_CHECKS) // FreeBSD customization
 #  if defined(_LIBCPP_CLANG_VER)
 #    if _LIBCPP_CLANG_VER < 1600
 #      warning "Libc++ only supports Clang 16 and later"
@@ -45,6 +46,7 @@
 #      warning "Libc++ only supports GCC 13 and later"
 #    endif
 #  endif
+#endif // _LIBCPP_ENABLE_COMPILER_VERSION_CHECKS
 
 // The attributes supported by clang are documented at https://clang.llvm.org/docs/AttributeReference.html
 
@@ -725,7 +727,8 @@ typedef __char32_t char32_t;
 #      define _LIBCPP_TEMPLATE_VIS
 #    endif
 
-#    if !defined(_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS) && __has_attribute(__type_visibility__)
+#    if !defined(_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS) && __has_attribute(__type_visibility__) \
+        && _LIBCPP_CLANG_VER >= 1500 // FreeBSD customization
 #      define _LIBCPP_TYPE_VISIBILITY_DEFAULT __attribute__((__type_visibility__("default")))
 #    else
 #      define _LIBCPP_TYPE_VISIBILITY_DEFAULT



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202404201034.43KAYMSC013456>