aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Wakely <jwakely@redhat.com>2022-12-23 13:43:52 +0000
committerJonathan Wakely <jwakely@redhat.com>2022-12-23 13:45:30 +0000
commitb358521b608f36409281a51263ace3155d28f54d (patch)
tree00408fb0c468264d723e15841d2558f1a5b235e0
parent1e7d2b2d22c509abbd0a59840fae7c4ed26d273b (diff)
downloadgcc-b358521b608f36409281a51263ace3155d28f54d.zip
gcc-b358521b608f36409281a51263ace3155d28f54d.tar.gz
gcc-b358521b608f36409281a51263ace3155d28f54d.tar.bz2
libstdc++: Fix Darwin bootstrap error in src/c++20/tzdb.cc
Mach-O requires weak symbols to have a definition, so add a default implementation of __gnu_cxx::zoneinfo_dir_override. libstdc++-v3/ChangeLog: * src/c++20/tzdb.cc [__APPLE__] (zoneinfo_dir_override): Add definition.
-rw-r--r--libstdc++-v3/src/c++20/tzdb.cc13
1 files changed, 10 insertions, 3 deletions
diff --git a/libstdc++-v3/src/c++20/tzdb.cc b/libstdc++-v3/src/c++20/tzdb.cc
index a02bcd4..5f5c419 100644
--- a/libstdc++-v3/src/c++20/tzdb.cc
+++ b/libstdc++-v3/src/c++20/tzdb.cc
@@ -52,6 +52,10 @@
# endif
#endif
+#ifndef _GLIBCXX_ZONEINFO_DIR
+# define _GLIBCXX_ZONEINFO_DIR "/usr/share/zoneinfo"
+#endif
+
namespace __gnu_cxx
{
#ifdef _AIX
@@ -59,6 +63,12 @@ namespace __gnu_cxx
const char* (*zoneinfo_dir_override)() = nullptr;
#else
[[gnu::weak]] const char* zoneinfo_dir_override();
+
+#ifdef __APPLE__
+ // Need a weak definition for Mach-O.
+ [[gnu::weak]] const char* zoneinfo_dir_override()
+ { return _GLIBCXX_ZONEINFO_DIR; }
+#endif
#endif
}
@@ -934,9 +944,6 @@ namespace std::chrono
return info;
}
-#ifndef _GLIBCXX_ZONEINFO_DIR
-# define _GLIBCXX_ZONEINFO_DIR "/usr/share/zoneinfo"
-#endif
namespace
{
string