[libcxx-commits] [libcxx] [libcxx][FreeBSD] Mark unsupported only in _XOPEN_SOURCE=500 (PR #216002)

via libcxx-commits libcxx-commits at lists.llvm.org
Thu Aug 13 03:05:45 PDT 2026


llvmorg-github-actions[bot] wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-libcxx

Author: aokblast

<details>
<summary>Changes</summary>

FreeBSD hides all C99 definition when -D_XOPEN_SOURCE=500. As a result, we can turn on these tests if we have definition higher than 500.

---
Full diff: https://github.com/llvm/llvm-project/pull/216002.diff


1 Files Affected:

- (modified) libcxx/test/extensions/posix/xopen_source.gen.py (+6-4) 


``````````diff
diff --git a/libcxx/test/extensions/posix/xopen_source.gen.py b/libcxx/test/extensions/posix/xopen_source.gen.py
index 99e0b0b7c7d1f..ea508445c84aa 100644
--- a/libcxx/test/extensions/posix/xopen_source.gen.py
+++ b/libcxx/test/extensions/posix/xopen_source.gen.py
@@ -16,9 +16,6 @@
 # recent value of _XOPEN_SOURCE.
 # UNSUPPORTED: LIBCXX-AIX-FIXME
 
-# This test fails on FreeBSD for an unknown reason.
-# UNSUPPORTED: LIBCXX-FREEBSD-FIXME
-
 # RUN: %{python} %s %{libcxx-dir}/utils
 # END.
 
@@ -36,11 +33,16 @@
         if header == "fstream" and version == 500:
             continue
 
+        # FreeBSD maps _XOPEN_SOURCE=500 to __ISO_C_VISIBLE=1990 (see <sys/_visible.h>), which hides
+        # everything C99 added to the C library, even in C++ mode. libc++ needs some of those
+        # additions to provide a conforming library at all
+        freebsd_unsupported = "// UNSUPPORTED: freebsd\n" if version == 500 else ""
+
         print(
             f"""\
 //--- {header}.xopen_source_{version}.compile.pass.cpp
 {lit_header_undeprecations.get(header, '')}
-
+{freebsd_unsupported}
 // ADDITIONAL_COMPILE_FLAGS: -D_XOPEN_SOURCE={version}
 
 // Some parts of the code like <fstream> use non-standard functions in their implementation,

``````````

</details>


https://github.com/llvm/llvm-project/pull/216002


More information about the libcxx-commits mailing list