Skip to content

Commit 15c7b2a

Browse files
authored
bpo-34121: Fix detection of C11 atomic support on clang. (GH-8288)
1 parent 16dfca4 commit 15c7b2a

File tree

5 files changed

+24
-13
lines changed

5 files changed

+24
-13
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix detection of C11 atomic support on clang.

aclocal.m4

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
# PARTICULAR PURPOSE.
1313

1414
m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
15-
# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
16-
# serial 12 (pkg-config-0.29.2)
17-
15+
dnl pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
16+
dnl serial 11 (pkg-config-0.29.1)
17+
dnl
1818
dnl Copyright © 2004 Scott James Remnant <[email protected]>.
1919
dnl Copyright © 2012-2015 Dan Nicholson <[email protected]>
2020
dnl
@@ -55,7 +55,7 @@ dnl
5555
dnl See the "Since" comment for each macro you use to see what version
5656
dnl of the macros you require.
5757
m4_defun([PKG_PREREQ],
58-
[m4_define([PKG_MACROS_VERSION], [0.29.2])
58+
[m4_define([PKG_MACROS_VERSION], [0.29.1])
5959
m4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1,
6060
[m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])])
6161
])dnl PKG_PREREQ
@@ -156,7 +156,7 @@ AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
156156
AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
157157
158158
pkg_failed=no
159-
AC_MSG_CHECKING([for $2])
159+
AC_MSG_CHECKING([for $1])
160160
161161
_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
162162
_PKG_CONFIG([$1][_LIBS], [libs], [$2])
@@ -166,11 +166,11 @@ and $1[]_LIBS to avoid the need to call pkg-config.
166166
See the pkg-config man page for more details.])
167167
168168
if test $pkg_failed = yes; then
169-
AC_MSG_RESULT([no])
169+
AC_MSG_RESULT([no])
170170
_PKG_SHORT_ERRORS_SUPPORTED
171171
if test $_pkg_short_errors_supported = yes; then
172172
$1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
173-
else
173+
else
174174
$1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
175175
fi
176176
# Put the nasty error message in config.log where it belongs
@@ -187,7 +187,7 @@ installed software in a non-standard prefix.
187187
_PKG_TEXT])[]dnl
188188
])
189189
elif test $pkg_failed = untried; then
190-
AC_MSG_RESULT([no])
190+
AC_MSG_RESULT([no])
191191
m4_default([$4], [AC_MSG_FAILURE(
192192
[The pkg-config script could not be found or is too old. Make sure it
193193
is in your PATH or set the PKG_CONFIG environment variable to the full

configure

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -781,6 +781,7 @@ infodir
781781
docdir
782782
oldincludedir
783783
includedir
784+
runstatedir
784785
localstatedir
785786
sharedstatedir
786787
sysconfdir
@@ -890,6 +891,7 @@ datadir='${datarootdir}'
890891
sysconfdir='${prefix}/etc'
891892
sharedstatedir='${prefix}/com'
892893
localstatedir='${prefix}/var'
894+
runstatedir='${localstatedir}/run'
893895
includedir='${prefix}/include'
894896
oldincludedir='/usr/include'
895897
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
@@ -1142,6 +1144,15 @@ do
11421144
| -silent | --silent | --silen | --sile | --sil)
11431145
silent=yes ;;
11441146

1147+
-runstatedir | --runstatedir | --runstatedi | --runstated \
1148+
| --runstate | --runstat | --runsta | --runst | --runs \
1149+
| --run | --ru | --r)
1150+
ac_prev=runstatedir ;;
1151+
-runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
1152+
| --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
1153+
| --run=* | --ru=* | --r=*)
1154+
runstatedir=$ac_optarg ;;
1155+
11451156
-sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
11461157
ac_prev=sbindir ;;
11471158
-sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
@@ -1279,7 +1290,7 @@ fi
12791290
for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
12801291
datadir sysconfdir sharedstatedir localstatedir includedir \
12811292
oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
1282-
libdir localedir mandir
1293+
libdir localedir mandir runstatedir
12831294
do
12841295
eval ac_val=\$$ac_var
12851296
# Remove trailing slashes.
@@ -1432,6 +1443,7 @@ Fine tuning of the installation directories:
14321443
--sysconfdir=DIR read-only single-machine data [PREFIX/etc]
14331444
--sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
14341445
--localstatedir=DIR modifiable single-machine data [PREFIX/var]
1446+
--runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run]
14351447
--libdir=DIR object code libraries [EPREFIX/lib]
14361448
--includedir=DIR C header files [PREFIX/include]
14371449
--oldincludedir=DIR C header files for non-gcc [/usr/include]
@@ -16534,7 +16546,6 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
1653416546
1653516547
#include <stdatomic.h>
1653616548
atomic_int value = ATOMIC_VAR_INIT(1);
16537-
_Atomic void *py_atomic_address = (void*) &value;
1653816549
int main() {
1653916550
int loaded_value = atomic_load(&value);
1654016551
return 0;

configure.ac

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5347,7 +5347,6 @@ AC_LINK_IFELSE(
53475347
AC_LANG_SOURCE([[
53485348
#include <stdatomic.h>
53495349
atomic_int value = ATOMIC_VAR_INIT(1);
5350-
_Atomic void *py_atomic_address = (void*) &value;
53515350
int main() {
53525351
int loaded_value = atomic_load(&value);
53535352
return 0;
@@ -5359,7 +5358,7 @@ AC_MSG_RESULT($have_stdatomic_h)
53595358

53605359
if test "$have_stdatomic_h" = yes; then
53615360
AC_DEFINE(HAVE_STD_ATOMIC, 1,
5362-
[Has stdatomic.h, atomic_int and _Atomic void* types work])
5361+
[Has stdatomic.h with atomic_int])
53635362
fi
53645363

53655364
# Check for GCC >= 4.7 __atomic builtins

pyconfig.h.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -963,7 +963,7 @@
963963
/* Define to 1 if you have the <stdlib.h> header file. */
964964
#undef HAVE_STDLIB_H
965965

966-
/* Has stdatomic.h, atomic_int and _Atomic void* types work */
966+
/* Has stdatomic.h with atomic_int */
967967
#undef HAVE_STD_ATOMIC
968968

969969
/* Define to 1 if you have the `strdup' function. */

0 commit comments

Comments
 (0)