configure.ac assumes -std=c11 rather than checking it, which causes make failures on old compilers
Đang mở
Chưa có ai nhận issue này.
build
type-bug
- Ngôn ngữ chính
- Python
- Star
- 77.2k
- Fork
- 36k
- Chỉ số merge pull request
- Chỉ số pull request đang chờ
Mô tả
Bug report
Bug description:
Repro
Steps:
- Run a container having a
gccthat does not support the C11 standard (e.g., gcc 4.4.7) tar xvJf Python-3.13.2.tar.xz && cd Python-3.13.2./configure && make
Expected: configure reports an error like "your compiler doesn't support C11"
Observed: configure succeeds, only for make to fail.
...
configure: creating Makefile
configure:
If you want a release build with all stable optimizations active (PGO, etc),
please run ./configure --enable-optimizations
configure: Your compiler or platform does have a working C11 stdatomic.h. A future version of Python may require stdatomic.h.
sh-4.1# make
gcc -std=gnu99 -pthread -c -fno-strict-overflow -Wsign-compare -DNDEBUG -g -O3 -Wall -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 -DPy_BUILD_CORE -o Programs/python.o ./Programs/python.c
cc1: error: unrecognized command line option "-std=c11"
make: *** [Programs/python.o] Error 1
Suggestion
I think this can be fixed by changing configure.ac here:
- CFLAGS_NODIST="$CFLAGS_NODIST -std=c11"
+ AX_CHECK_COMPILE_FLAG([-std=c11],[
+ CFLAGS_NODIST="$CFLAGS_NODIST -std=c11"
+ ], [
+ AC_MSG_ERROR([Python requires -std=c11 on gcc])
+ ], [-Werror])
Related issues
#91731
CPython versions tested on:
3.12.9, 3.13.2
Operating systems tested on:
Linux
Linked PRs
- gh-133608
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
Logic bị ảnh hưởng nằm trong configure.ac gần dòng được tham chiếu, nơi -std=c11 được thêm vào. Tái hiện với GCC 4.4.7 bằng cách sử dụng ./configure && make, sau đó xác minh rằng configure báo cáo trình biên dịch C11 không được hỗ trợ thay vì để make thất bại.
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
- Lĩnh vực
- build-system
- Loại issue
- Lỗi
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức phù hợp với người mới
- 25/100