Skip to content

3.12.0b3 build issue: 'O_CLOEXEC' undeclared in sysmodule.c #106118

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
lmunch opened this issue Jun 26, 2023 · 1 comment · Fixed by #106120
Closed

3.12.0b3 build issue: 'O_CLOEXEC' undeclared in sysmodule.c #106118

lmunch opened this issue Jun 26, 2023 · 1 comment · Fixed by #106120
Labels
build The build process and cross-build type-bug An unexpected behavior, bug, or error

Comments

@lmunch
Copy link

lmunch commented Jun 26, 2023

I am building Python 3.12.0b3 (3.11.X builds fine) on CentOS 5 using glibc-2.5 and gcc-4.8.5 and I encounter this build error:

gcc-4.8 -std=gnu11 -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. -I./Include -fPIC -DPy_BUILD_CORE
-DABIFLAGS='""'
-DMULTIARCH="x86_64-linux-gnu"
-o Python/sysmodule.o ./Python/sysmodule.c
./Python/sysmodule.c: In function 'PyUnstable_PerfMapState_Init':
./Python/sysmodule.c:2280:62: error: 'O_CLOEXEC' undeclared (first use in this function)
int flags = O_WRONLY | O_CREAT | O_APPEND | O_NOFOLLOW | O_CLOEXEC;
^
./Python/sysmodule.c:2280:62: note: each undeclared identifier is reported only once for each function it appears in
make: *** [Python/sysmodule.o] Error 1

Perhaps there is a missing #ifdef O_CLOEXEC in ./Python/sysmodule.c?

Thanks

Linked PRs

@lmunch lmunch added the type-bug An unexpected behavior, bug, or error label Jun 26, 2023
@erlend-aasland
Copy link
Contributor

It looks like the other usages of O_CLOEXEC are guarded by preprocessor conditionals. AFAICS, we should do the same here.

@erlend-aasland erlend-aasland added the build The build process and cross-build label Jun 26, 2023
erlend-aasland added a commit to erlend-aasland/cpython that referenced this issue Jun 26, 2023
@erlend-aasland erlend-aasland linked a pull request Jun 26, 2023 that will close this issue
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Jun 28, 2023
(cherry picked from commit 6c60684)

Co-authored-by: Erlend E. Aasland <[email protected]>
erlend-aasland added a commit that referenced this issue Jun 28, 2023
(cherry picked from commit 6c60684)

Co-authored-by: Erlend E. Aasland <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build The build process and cross-build type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants