Skip to content

Commit df9af64

Browse files
committed
Disable C++20 time zone support
LLVM 18.1.2 adds C++20 time zone support (https://libcxx.llvm.org/DesignDocs/TimeZone.html) to libcxx, which requires access IANA Time Zone Database. Currently it seems it only supports Linux: https://github.com/llvm/llvm-project/blob/26a1d6601d727a96f4301d0d8647b5a42760ae0c/libcxx/src/tz.cpp#L45-L49 So this excludes the two source files from build (which is done via `CMakeLists.txt` in the upstream LLVM) and sets `_LIBCPP_HAS_NO_TIME_ZONE_DATABASE` macro in `__config_site`. In future maybe we can consider implementing this in JS.
1 parent 6a0909e commit df9af64

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

system/lib/libcxx/include/__config_site

+1
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@
88
#define _LIBCPP_PSTL_CPU_BACKEND_SERIAL
99
// __libcpp_verbose_abort creases code size too much
1010
#define _LIBCPP_AVAILABILITY_HAS_NO_VERBOSE_ABORT
11+
#define _LIBCPP_HAS_NO_TIME_ZONE_DATABASE

tools/system_libs.py

+4
Original file line numberDiff line numberDiff line change
@@ -1617,6 +1617,10 @@ class libcxx(NoExceptLibrary, MTLibrary):
16171617
'support.cpp',
16181618
'int128_builtins.cpp',
16191619
'libdispatch.cpp',
1620+
# Emscripten does not have C++20's time zone support which requires access
1621+
# to IANA Time Zone Database. TODO Implement this using JS timezone
1622+
'tz.cpp',
1623+
'tzdb_list.cpp',
16201624
]
16211625

16221626
def get_cflags(self):

0 commit comments

Comments
 (0)