This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Maxime Belanger
Recipients Maxime Belanger, ned.deily, ronaldoussoren
Date 2018-10-19.06:24:57
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1539930297.83.0.788709270274.issue35025@psf.upfronthosting.co.za>
In-reply-to
Content
We build Python on macOS with `-Werror=unguarded-availability` and `-mmacosx-version-min=<xx>` to ensure `libpython` is binary-compatible with earlier versions of macOS. 

This can create problems when building some modules, including `timemodule.c`, which was recently altered to fix bpo-28081. The initial fix is inappropriate, because attempting to reference `CLOCK_REALTIME` et al when `HAVE_CLOCK_GETTIME` is unset (in our case, due to being too "new"), results in a compiler error:

```
./Modules/timemodule.c:1368:29: error: '_CLOCK_REALTIME' is only available on macOS 10.12 or newer
      [-Werror,-Wunguarded-availability]
    PyModule_AddIntMacro(m, CLOCK_REALTIME);
                            ^~~~~~~~~~~~~~
/usr/include/time.h:154:24: note: expanded from macro 'CLOCK_REALTIME'
#define CLOCK_REALTIME _CLOCK_REALTIME
                       ^~~~~~~~~~~~~~~
./Include/modsupport.h:78:67: note: expanded from macro 'PyModule_AddIntMacro'
#define PyModule_AddIntMacro(m, c) PyModule_AddIntConstant(m, #c, c)
```

A more correct patch (I'm attaching ours) is to only add the macros to the module if at least one of the three functions is defined. This should continue to work for the author of the original issue as well as fix our problem.
History
Date User Action Args
2018-10-19 06:24:57Maxime Belangersetrecipients: + Maxime Belanger, ronaldoussoren, ned.deily
2018-10-19 06:24:57Maxime Belangersetmessageid: <1539930297.83.0.788709270274.issue35025@psf.upfronthosting.co.za>
2018-10-19 06:24:57Maxime Belangerlinkissue35025 messages
2018-10-19 06:24:57Maxime Belangercreate