You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add some extra content check in configure process for some empty header file who has been deprecated by glibc #85277
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee=Noneclosed_at=Nonecreated_at=<Date2020-06-24.15:16:58.262>labels= ['build', '3.8', '3.9', '3.10']
title='Add some extra content check in configure process for some empty header file who has been deprecated by glibc'updated_at=<Date2021-11-03.18:32:16.444>user='https://github.com/Zheaoli'
When I try to compile the code from the master branch on my Manjaro, one of the Linux system based on the Arch and based on the glibc-2.31 && gcc-10.1.0 . the compiler show me that the fcntl module has been failed to be compiled
Here's the message
/home/manjusaka/Documents/project/cpython/Modules/fcntlmodule.c:618:33: error: ‘I_PUSH’ undeclared (first use in this function)
618 | if (PyModule_AddIntMacro(m, I_PUSH)) return -1;
| ^~~~~~
./Include/modsupport.h:146:67: note: in definition of macro ‘PyModule_AddIntMacro’
146 | #define PyModule_AddIntMacro(m, c) PyModule_AddIntConstant(m, #c, c)
| ^
/home/manjusaka/Documents/project/cpython/Modules/fcntlmodule.c:618:33: note: each undeclared identifier is reported only once for each function it appears in
618 | if (PyModule_AddIntMacro(m, I_PUSH)) return -1;
| ^~~~~~
./Include/modsupport.h:146:67: note: in definition of macro ‘PyModule_AddIntMacro’
146 | #define PyModule_AddIntMacro(m, c) PyModule_AddIntConstant(m, #c, c)
| ^
/home/manjusaka/Documents/project/cpython/Modules/fcntlmodule.c:619:33: error: ‘I_POP’ undeclared (first use in this function)
619 | if (PyModule_AddIntMacro(m, I_POP)) return -1;
| ^~~~~
./Include/modsupport.h:146:67: note: in definition of macro ‘PyModule_AddIntMacro’
146 | #define PyModule_AddIntMacro(m, c) PyModule_AddIntConstant(m, #c, c)
| ^
/home/manjusaka/Documents/project/cpython/Modules/fcntlmodule.c:620:33: error: ‘I_LOOK’ undeclared (first use in this function); did you mean ‘F_LOCK’?
620 | if (PyModule_AddIntMacro(m, I_LOOK)) return -1;
| ^~~~~~
I have figured out the reason because the stropts.h has been deprecated since the glic-2.30, but some of the distribution of Linux keep an empty file on the /usr/include, so the configure process will recognize stropts.h is existed and open HAVE_STROPTS_H flag.
So should we add an extra content check in the configure process to avoid the empty file problem?
changed the title [-]Add some extra content check for some who has been deprecated by glibc[/-][+]Add some extra content check in configure process for some empty header file who has been deprecated by glibc[/+]on Jun 24, 2020
changed the title [-]Add some extra content check for some who has been deprecated by glibc[/-][+]Add some extra content check in configure process for some empty header file who has been deprecated by glibc[/+]on Jun 24, 2020
etale-cohomology commented on Oct 7, 2021
etale-cohomologymannequin
Mannequin
More actions
Yes, I have the same problem. The empty file is needed to avoid compilation errors in certain builds, but in this case it creates an error...
Activity
Zheaoli commentedon Jun 24, 2020
Hello everyone
When I try to compile the code from the master branch on my Manjaro, one of the Linux system based on the Arch and based on the glibc-2.31 && gcc-10.1.0 . the compiler show me that the fcntl module has been failed to be compiled
Here's the message
/home/manjusaka/Documents/project/cpython/Modules/fcntlmodule.c:618:33: error: ‘I_PUSH’ undeclared (first use in this function)
618 | if (PyModule_AddIntMacro(m, I_PUSH)) return -1;
| ^~~~~~
./Include/modsupport.h:146:67: note: in definition of macro ‘PyModule_AddIntMacro’
146 | #define PyModule_AddIntMacro(m, c) PyModule_AddIntConstant(m, #c, c)
| ^
/home/manjusaka/Documents/project/cpython/Modules/fcntlmodule.c:618:33: note: each undeclared identifier is reported only once for each function it appears in
618 | if (PyModule_AddIntMacro(m, I_PUSH)) return -1;
| ^~~~~~
./Include/modsupport.h:146:67: note: in definition of macro ‘PyModule_AddIntMacro’
146 | #define PyModule_AddIntMacro(m, c) PyModule_AddIntConstant(m, #c, c)
| ^
/home/manjusaka/Documents/project/cpython/Modules/fcntlmodule.c:619:33: error: ‘I_POP’ undeclared (first use in this function)
619 | if (PyModule_AddIntMacro(m, I_POP)) return -1;
| ^~~~~
./Include/modsupport.h:146:67: note: in definition of macro ‘PyModule_AddIntMacro’
146 | #define PyModule_AddIntMacro(m, c) PyModule_AddIntConstant(m, #c, c)
| ^
/home/manjusaka/Documents/project/cpython/Modules/fcntlmodule.c:620:33: error: ‘I_LOOK’ undeclared (first use in this function); did you mean ‘F_LOCK’?
620 | if (PyModule_AddIntMacro(m, I_LOOK)) return -1;
| ^~~~~~
I have figured out the reason because the stropts.h has been deprecated since the glic-2.30, but some of the distribution of Linux keep an empty file on the /usr/include, so the configure process will recognize stropts.h is existed and open HAVE_STROPTS_H flag.
So should we add an extra content check in the configure process to avoid the empty file problem?
Zheaoli commentedon Jun 24, 2020
Here's the reference
https://sourceware.org/legacy-ml/libc-alpha/2019-08/msg00029.html
[-]Add some extra content check for some who has been deprecated by glibc[/-][+]Add some extra content check in configure process for some empty header file who has been deprecated by glibc[/+][-]Add some extra content check for some who has been deprecated by glibc[/-][+]Add some extra content check in configure process for some empty header file who has been deprecated by glibc[/+]etale-cohomology commentedon Oct 7, 2021
Yes, I have the same problem. The empty file is needed to avoid compilation errors in certain builds, but in this case it creates an error...
akulakov commentedon Nov 3, 2021
I think adding this code in the
configurescript may fix it:here: https://github.com/akulakov/cpython/blob/8f24b7dbcbd83311dad510863d8cb41f0e91b464/configure#L8144
.. but I wasn't able to test it. I have a MacOS system and for me even with a non-empty stropts.h, configure does not pick it up.
tiran commentedon Nov 3, 2021
The configure script is auto-generated from configure.ac. Any chance must be applied to configure.ac.
We could replace the AC_CHECK_HEADERS() for stropt.h with a more elaborate AC_COMPILE_IFELSE() block that checks for presence of I_PUSH.
Could you please report the issue to your Linux vendor, too? The empty file seems to break Open Group Unix 98 standard.
serhiy-storchaka commentedon Nov 3, 2021
Rather of using AC_COMPILE_IFELSE() in configure.ac, would not be easier to use #ifdef in the C file?
gh-85277: Fix building without `stropts.h` or empty `stropts.h` (#143521
vstinner commentedon Mar 10, 2026
The
stropts.hissues (I_PUSH) should be fixed by #143521.pythongh-85277: Fix building without `stropts.h` or empty `stropts.h` (…