From c7f471f9cafe55e9b9d42b6d1a6fe94749879676 Mon Sep 17 00:00:00 2001 From: DrishtiTripathi2230 Date: Sat, 27 Jun 2026 19:27:13 +0530 Subject: [PATCH 1/5] Fix macOS GCC15 build: define _DARWIN_C_SOURCE alongside _XOPEN_SOURCE Defining _XOPEN_SOURCE on Darwin lowers __DARWIN_C_LEVEL, hiding quick_exit/at_quick_exit. GCC 15's libstdc++ unconditionally does 'using ::quick_exit;', which fails to compile when those symbols are hidden. Defining _DARWIN_C_SOURCE alongside _XOPEN_SOURCE restores full Darwin visibility while keeping the POSIX/SUSv2 definitions cctz needs elsewhere. Scoped to __APPLE__ only; no effect on other platforms. Fixes #2027 --- absl/time/internal/cctz/src/time_zone_format.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/absl/time/internal/cctz/src/time_zone_format.cc b/absl/time/internal/cctz/src/time_zone_format.cc index 4c8d2f9cac7..b04c6e11616 100644 --- a/absl/time/internal/cctz/src/time_zone_format.cc +++ b/absl/time/internal/cctz/src/time_zone_format.cc @@ -22,6 +22,9 @@ #if HAS_STRPTIME #if !defined(_XOPEN_SOURCE) && !defined(__FreeBSD__) && !defined(__OpenBSD__) +#if defined(__APPLE__) +#define _DARWIN_C_SOURCE +#endif #define _XOPEN_SOURCE 500 // Exposes definitions for SUSv2 (UNIX 98). #endif #endif From a9513f5ea2a7d24b17f1c051311ccb060aae8bc9 Mon Sep 17 00:00:00 2001 From: DrishtiTripathi2230 Date: Sat, 27 Jun 2026 19:28:27 +0530 Subject: [PATCH 2/5] Add temporary CI workflow to verify macOS GCC15 build --- .github/workflows/test-macos-gcc15.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 .github/workflows/test-macos-gcc15.yml diff --git a/.github/workflows/test-macos-gcc15.yml b/.github/workflows/test-macos-gcc15.yml new file mode 100644 index 00000000000..2c70b080419 --- /dev/null +++ b/.github/workflows/test-macos-gcc15.yml @@ -0,0 +1,20 @@ +name: macOS GCC15 repro +on: + push: + branches: + - fix-2027-darwin-xopen-source + +jobs: + build: + runs-on: macos-latest + steps: + - uses: actions/checkout@v4 + - name: Install GCC 15 + run: brew install gcc@15 + - name: Configure + run: | + mkdir build && cd build + cmake .. -DCMAKE_CXX_COMPILER=g++-15 -DCMAKE_C_COMPILER=gcc-15 \ + -DABSL_BUILD_TESTING=OFF + - name: Build time_zone target + run: cmake --build build --target time_zone \ No newline at end of file From 5b123e1d27aee66c06e65faaf8f8ee12d3fcdc91 Mon Sep 17 00:00:00 2001 From: DrishtiTripathi2230 Date: Sat, 27 Jun 2026 19:31:13 +0530 Subject: [PATCH 3/5] Revert "Fix macOS GCC15 build: define _DARWIN_C_SOURCE alongside _XOPEN_SOURCE" This reverts commit c7f471f9cafe55e9b9d42b6d1a6fe94749879676. --- absl/time/internal/cctz/src/time_zone_format.cc | 3 --- 1 file changed, 3 deletions(-) diff --git a/absl/time/internal/cctz/src/time_zone_format.cc b/absl/time/internal/cctz/src/time_zone_format.cc index b04c6e11616..4c8d2f9cac7 100644 --- a/absl/time/internal/cctz/src/time_zone_format.cc +++ b/absl/time/internal/cctz/src/time_zone_format.cc @@ -22,9 +22,6 @@ #if HAS_STRPTIME #if !defined(_XOPEN_SOURCE) && !defined(__FreeBSD__) && !defined(__OpenBSD__) -#if defined(__APPLE__) -#define _DARWIN_C_SOURCE -#endif #define _XOPEN_SOURCE 500 // Exposes definitions for SUSv2 (UNIX 98). #endif #endif From 5b46e2e5b0f4a78926184e32755a6a41e8eb70c8 Mon Sep 17 00:00:00 2001 From: DrishtiTripathi2230 Date: Sat, 27 Jun 2026 19:32:46 +0530 Subject: [PATCH 4/5] Reapply "Fix macOS GCC15 build: define _DARWIN_C_SOURCE alongside _XOPEN_SOURCE" This reverts commit 5b123e1d27aee66c06e65faaf8f8ee12d3fcdc91. --- absl/time/internal/cctz/src/time_zone_format.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/absl/time/internal/cctz/src/time_zone_format.cc b/absl/time/internal/cctz/src/time_zone_format.cc index 4c8d2f9cac7..b04c6e11616 100644 --- a/absl/time/internal/cctz/src/time_zone_format.cc +++ b/absl/time/internal/cctz/src/time_zone_format.cc @@ -22,6 +22,9 @@ #if HAS_STRPTIME #if !defined(_XOPEN_SOURCE) && !defined(__FreeBSD__) && !defined(__OpenBSD__) +#if defined(__APPLE__) +#define _DARWIN_C_SOURCE +#endif #define _XOPEN_SOURCE 500 // Exposes definitions for SUSv2 (UNIX 98). #endif #endif From 1aa854f46494ead30e56e44273e770fdd6475f38 Mon Sep 17 00:00:00 2001 From: DrishtiTripathi2230 Date: Sat, 27 Jun 2026 19:34:30 +0530 Subject: [PATCH 5/5] Remove temporary CI verification workflow --- .github/workflows/test-macos-gcc15.yml | 20 -------------------- 1 file changed, 20 deletions(-) delete mode 100644 .github/workflows/test-macos-gcc15.yml diff --git a/.github/workflows/test-macos-gcc15.yml b/.github/workflows/test-macos-gcc15.yml deleted file mode 100644 index 2c70b080419..00000000000 --- a/.github/workflows/test-macos-gcc15.yml +++ /dev/null @@ -1,20 +0,0 @@ -name: macOS GCC15 repro -on: - push: - branches: - - fix-2027-darwin-xopen-source - -jobs: - build: - runs-on: macos-latest - steps: - - uses: actions/checkout@v4 - - name: Install GCC 15 - run: brew install gcc@15 - - name: Configure - run: | - mkdir build && cd build - cmake .. -DCMAKE_CXX_COMPILER=g++-15 -DCMAKE_C_COMPILER=gcc-15 \ - -DABSL_BUILD_TESTING=OFF - - name: Build time_zone target - run: cmake --build build --target time_zone \ No newline at end of file