abseil / abseil/abseil-cpp

[Bug]: Can't build on macOS with GCC 15

Open
#2,027 0 comments 2 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
18.1k
Forks
3.2k
Avg merge
20h 36m
Merged PRs (30d)
1

Description

### Describe the issue

Failed to build `abseil` via Conan or directly from git using GCC-15 installed via brew. The error is:

```
[build] FAILED: [code=1] absl/time/CMakeFiles/time_zone.dir/internal/cctz/src/time_zone_format.cc.o
[build] /opt/homebrew/bin/g++-15 -I/Users/alex/Documents/src/abseil-cpp -g -arch arm64 -Wall -Wextra -Wcast-qual -Wconversion-null -Wformat-security -Wmissing-declarations -Wnon-virtual-dtor -Woverlength-strings -Wpointer-arith -Wundef -Wunused-local-typedefs -Wunused-result -Wvarargs -Wvla -Wwrite-strings -DNOMINMAX -MD -MT absl/time/CMakeFiles/time_zone.dir/internal/cctz/src/time_zone_format.cc.o -MF absl/time/CMakeFiles/time_zone.dir/internal/cctz/src/time_zone_format.cc.o.d -o absl/time/CMakeFiles/time_zone.dir/internal/cctz/src/time_zone_format.cc.o -c /Users/alex/Documents/src/abseil-cpp/absl/time/internal/cctz/src/time_zone_format.cc
[build] In file included from /opt/homebrew/Cellar/gcc/15.2.0_1/include/c++/15/ext/string_conversions.h:45,
[build] from /opt/homebrew/Cellar/gcc/15.2.0_1/include/c++/15/bits/basic_string.h:4444,
[build] from /opt/homebrew/Cellar/gcc/15.2.0_1/include/c++/15/string:56,
[build] from /Users/alex/Documents/src/abseil-cpp/absl/time/internal/cctz/include/cctz/time_zone.h:27,
[build] from /Users/alex/Documents/src/abseil-cpp/absl/time/internal/cctz/src/time_zone_format.cc:30:
[build] /opt/homebrew/Cellar/gcc/15.2.0_1/include/c++/15/cstdlib:147:11: error: 'at_quick_exit' has not been declared in '::'
[build] 147 | using ::at_quick_exit;
[build] | ^~~~~~~~~~~~~
[build] /opt/homebrew/Cellar/gcc/15.2.0_1/include/c++/15/cstdlib:170:11: error: 'quick_exit' has not been declared in '::'
[build] 170 | using ::quick_exit;
[build] | ^~~~~~~~~~
```

### Steps to reproduce the problem

Build `abseil` via CMake.

### What version of Abseil are you using?

6c1f120e3e50ef38a3b3d6e088139f271ea9cc79

### What operating system and version are you using?

macOS Sequoia 15.7.4

### What compiler and version are you using?

gcc-15 (Homebrew GCC 15.2.0_1) 15.2.0

### What build system are you using?

CMake 4.3.0

### Additional context

Google suggested that the error might be related to `_XOPEN_SOURCE` macro being defined. The build succeeded when I commented it out here: https://github.com/abseil/abseil-cpp/blob/9cc7e8dbd54a60096ed056638cb0128fb6018fb4/absl/time/internal/cctz/src/time_zone_format.cc#L25

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.