If "_REENTRANT" is defined in the header file, we should use "-D_REENTRANT" when compiling #82482
Copy link
Copy link
Closed
Labels
3.7 (EOL)end of lifeend of life3.8 (EOL)end of lifeend of life3.9 (EOL)end of lifeend of lifebuildThe build process and cross-buildThe build process and cross-build
Description
Activity
When compiling on Solaris family, we define "_REENTRANT" in "Pyconfig.h". That file is included when compiling C extensions, but if the extension is made of several C files, it could be included only in the file that interfaces with python runtime.
Unfortunately, "_REENTRANT" modifies the way C code is compiled, so compiling a C extension with some source files with "_REENTRANT" and some other without that "define" can produce bizarre errors and crashes.
One example: TritonDataCenter/pkgsrc#207
In particular, "include" order can make a big difference: jnwatson/py-lmdb#213
I suggest that when "_REENTRANT" is defined in "Pyconfig.h", Python C extensions compilation machinery adds "-D_REENTRANT" to the compilation flags.
The patch is trivial.
- added3.7 (EOL)end of lifeend of life3.8 (EOL)end of lifeend of life3.9 (EOL)end of lifeend of life
on Sep 27, 2019 - changed the title
[-]If "_REENTARNT" is defined in the header file, we should use "-D_REENTRANT" when compiling[/-][+]If "_REENTRANT" is defined in the header file, we should use "-D_REENTRANT" when compiling[/+]on Sep 27, 2019
Metadata
Metadata
Assignees
Labels
3.7 (EOL)end of lifeend of life3.8 (EOL)end of lifeend of life3.9 (EOL)end of lifeend of lifebuildThe build process and cross-buildThe build process and cross-build
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:
bugs.python.org fields: