`__builtin_os_log_format_buffer_size` is missing for Catalina+GCC
Đang mở
Chưa có ai nhận issue này.
build
OS-mac
pending
type-bug
- Ngôn ngữ chính
- Python
- Star
- 77.2k
- Fork
- 35.9k
- Chỉ số merge pull request
- Chỉ số pull request đang chờ
Mô tả
Bug report
Bug description:
Build fails on macOS with gcc.
/opt/local/bin/gcc-mp-14 -c -fno-strict-overflow -Wsign-compare -fno-common -dynamic -DNDEBUG -g -O3 -Wall -pipe -Os -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk -arch x86_64 -flto -std=c11 -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wstrict-prototypes -Werror=implicit-function-declaration -fvisibility=hidden -I./Include/internal -I./Include/internal/mimalloc -I. -I./Include -I/opt/local/include -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk -DPy_BUILD_CORE -o Python/preconfig.o Python/preconfig.c
/opt/local/bin/gcc-mp-14 -c -fno-strict-overflow -Wsign-compare -fno-common -dynamic -DNDEBUG -g -O3 -Wall -pipe -Os -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk -arch x86_64 -flto -std=c11 -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wstrict-prototypes -Werror=implicit-function-declaration -fvisibility=hidden -I./Include/internal -I./Include/internal/mimalloc -I. -I./Include -I/opt/local/include -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk -DPy_BUILD_CORE -o Python/pyarena.o Python/pyarena.c
/opt/local/bin/gcc-mp-14 -c -fno-strict-overflow -Wsign-compare -fno-common -dynamic -DNDEBUG -g -O3 -Wall -pipe -Os -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk -arch x86_64 -flto -std=c11 -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wstrict-prototypes -Werror=implicit-function-declaration -fvisibility=hidden -I./Include/internal -I./Include/internal/mimalloc -I. -I./Include -I/opt/local/include -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk -DPy_BUILD_CORE -o Python/pyctype.o Python/pyctype.c
/opt/local/bin/gcc-mp-14 -c -fno-strict-overflow -Wsign-compare -fno-common -dynamic -DNDEBUG -g -O3 -Wall -pipe -Os -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk -arch x86_64 -flto -std=c11 -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wstrict-prototypes -Werror=implicit-function-declaration -fvisibility=hidden -I./Include/internal -I./Include/internal/mimalloc -I. -I./Include -I/opt/local/include -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk -DPy_BUILD_CORE -o Python/pyfpe.o Python/pyfpe.c
/opt/local/bin/gcc-mp-14 -c -fno-strict-overflow -Wsign-compare -fno-common -dynamic -DNDEBUG -g -O3 -Wall -pipe -Os -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk -arch x86_64 -flto -std=c11 -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wstrict-prototypes -Werror=implicit-function-declaration -fvisibility=hidden -I./Include/internal -I./Include/internal/mimalloc -I. -I./Include -I/opt/local/include -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk -DPy_BUILD_CORE -o Python/pyhash.o Python/pyhash.c
/opt/local/bin/gcc-mp-14 -c -fno-strict-overflow -Wsign-compare -fno-common -dynamic -DNDEBUG -g -O3 -Wall -pipe -Os -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk -arch x86_64 -flto -std=c11 -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wstrict-prototypes -Werror=implicit-function-declaration -fvisibility=hidden -I./Include/internal -I./Include/internal/mimalloc -I. -I./Include -I/opt/local/include -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk -DPy_BUILD_CORE -o Python/pylifecycle.o Python/pylifecycle.c
/opt/local/bin/gcc-mp-14 -c -fno-strict-overflow -Wsign-compare -fno-common -dynamic -DNDEBUG -g -O3 -Wall -pipe -Os -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk -arch x86_64 -flto -std=c11 -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wstrict-prototypes -Werror=implicit-function-declaration -fvisibility=hidden -I./Include/internal -I./Include/internal/mimalloc -I. -I./Include -I/opt/local/include -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk -DPy_BUILD_CORE -o Python/pymath.o Python/pymath.c
/opt/local/bin/gcc-mp-14 -c -fno-strict-overflow -Wsign-compare -fno-common -dynamic -DNDEBUG -g -O3 -Wall -pipe -Os -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk -arch x86_64 -flto -std=c11 -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wstrict-prototypes -Werror=implicit-function-declaration -fvisibility=hidden -I./Include/internal -I./Include/internal/mimalloc -I. -I./Include -I/opt/local/include -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk -DPy_BUILD_CORE -o Python/pystate.o Python/pystate.c
/opt/local/bin/gcc-mp-14 -c -fno-strict-overflow -Wsign-compare -fno-common -dynamic -DNDEBUG -g -O3 -Wall -pipe -Os -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk -arch x86_64 -flto -std=c11 -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wstrict-prototypes -Werror=implicit-function-declaration -fvisibility=hidden -I./Include/internal -I./Include/internal/mimalloc -I. -I./Include -I/opt/local/include -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk -DPy_BUILD_CORE -o Python/pythonrun.o Python/pythonrun.c
/opt/local/bin/gcc-mp-14 -c -fno-strict-overflow -Wsign-compare -fno-common -dynamic -DNDEBUG -g -O3 -Wall -pipe -Os -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk -arch x86_64 -flto -std=c11 -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wstrict-prototypes -Werror=implicit-function-declaration -fvisibility=hidden -I./Include/internal -I./Include/internal/mimalloc -I. -I./Include -I/opt/local/include -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk -DPy_BUILD_CORE -o Python/pytime.o Python/pytime.c
In file included from Python/pylifecycle.c:64:
/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/os/log.h:17:2: error: #error using os/log.h requires Xcode 8 or later
17 | #error using os/log.h requires Xcode 8 or later
| ^~~~~
/opt/local/bin/gcc-mp-14 -c -fno-strict-overflow -Wsign-compare -fno-common -dynamic -DNDEBUG -g -O3 -Wall -pipe -Os -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk -arch x86_64 -flto -std=c11 -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wstrict-prototypes -Werror=implicit-function-declaration -fvisibility=hidden -I./Include/internal -I./Include/internal/mimalloc -I. -I./Include -I/opt/local/include -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk -DPy_BUILD_CORE -o Python/qsbr.o Python/qsbr.c
Python/pytime.c: In function 'py_get_system_clock':
Python/pytime.c:940:20: warning: unused variable 'tv' [-Wunused-variable]
940 | struct timeval tv;
| ^~
Python/pylifecycle.c: In function 'apple_log_write_impl':
Python/pylifecycle.c:2973: warning: ignoring '#pragma clang diagnostic' [-Wunknown-pragmas]
2973 | os_log_with_type(OS_LOG_DEFAULT, logtype, "%s", text);
Python/pylifecycle.c:2973: warning: ignoring '#pragma clang diagnostic' [-Wunknown-pragmas]
Python/pylifecycle.c:2973: warning: ignoring '#pragma clang diagnostic' [-Wunknown-pragmas]
Python/pylifecycle.c:2973:5: warning: 'internal_linkage' attribute directive ignored [-Wattributes]
2973 | os_log_with_type(OS_LOG_DEFAULT, logtype, "%s", text);
| ^~~~~~~~~~~~~~~~
In file included from /opt/local/lib/gcc14/gcc/x86_64-apple-darwin19/14.2.0/include-fixed/os/trace.h:17,
from /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/os/log.h:14:
Python/pylifecycle.c:2973:5: error: implicit declaration of function '__builtin_os_log_format_buffer_size' [-Wimplicit-function-declaration]
2973 | os_log_with_type(OS_LOG_DEFAULT, logtype, "%s", text);
| ^~~~~~~~~~~~~~~~
Python/pylifecycle.c:2973:5: error: implicit declaration of function '__builtin_os_log_format'; did you mean '__builtin_isnormal'? [-Wimplicit-function-declaration]
2973 | os_log_with_type(OS_LOG_DEFAULT, logtype, "%s", text);
| ^~~~~~~~~~~~~~~~
Python/pylifecycle.c:2973: warning: ignoring '#pragma clang diagnostic' [-Wunknown-pragmas]
2973 | os_log_with_type(OS_LOG_DEFAULT, logtype, "%s", text);
make: *** [Python/pylifecycle.o] Error 1
Catalina has Xcode 12 though:
% /usr/bin/xcodebuild -version
Xcode 12.4
Build version 12D4e
Is this Apple bug?
CPython versions tested on:
3.13
Operating systems tested on:
macOS
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Hướng nghiên cứu
Bắt đầu với Python/pylifecycle.c tại apple_log_write_impl và tái hiện bản build Catalina được báo cáo bằng GCC 14, macOS 10.15 SDK và các cờ trình biên dịch đã nêu. Kiểm tra SDK os/log.h và các header liên quan để hiểu các builtin còn thiếu; hoàn tất khi bản build CPython hoàn thành mà không có lỗi khai báo ngầm định.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- c, python
- Lĩnh vực
- build-system, operating-systems
- Loại issue
- Lỗi
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 35/100