8000 bpo-34121: Fix detection of C11 atomic support on clang. (GH-8288) · python/cpython@3fc12f0 · GitHub
[go: up one dir, main page]

Skip to content

Commit 3fc12f0

Browse files
bpo-34121: Fix detection of C11 atomic support on clang. (GH-8288)
(cherry picked from commit 15c7b2a) Co-authored-by: Benjamin Peterson <benjamin@python.org>
1 parent c721472 commit 3fc12f0

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 <scott@netsplit.com>.
1919
dnl Copyright © 2012-2015 Dan Nicholson <dbn.lists@gmail.com>
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
@@ -892,6 +893,7 @@ datadir='${datarootdir}'
892893
sysconfdir='${prefix}/etc'
893894
sharedstatedir='${prefix}/com'
894895
localstatedir='${prefix}/var'
896+
runstatedir='${localstatedir}/run'
895897
includedir='${prefix}/include'
896898
oldincludedir='/usr/include'
897899
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
@@ -1144,6 +1146,15 @@ do
11441146
| -silent | --silent | --silen | --sile | --sil)
11451147
silent=yes ;;
11461148

1149+
-runstatedir | --runstatedir | --runstatedi | --runstated \
1150+
| --runstate | --runstat | --runsta | --runst | --runs \
1151+
| --run | --ru | --r)
1152+
ac_prev=runstatedir ;;
1153+
-runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
1154+
| --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
1155+
| --run=* | --ru=* | --r=*)
1156+
runstatedir=$ac_optarg ;;
1157+
11471158
-sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
11481159
ac_prev=sbindir ;;
11491160
-sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
@@ -1281,7 +1292,7 @@ fi
12811292
for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
12821293
datadir sysconfdir sharedstatedir localstatedir includedir \
12831294
oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
1284-
libdir localedir mandir
1295+
libdir localedir mandir runstatedir
12851296
do
12861297
eval ac_val=\$$ac_var
12871298
# Remove trailing slashes.
@@ -1434,6 +1445,7 @@ Fine tuning of the installation directories:
14341445
--sysconfdir=DIR read-only single-machine data [PREFIX/etc]
14351446
--sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
14361447
--localstatedir=DIR modifiable single-machine data [PREFIX/var]
1448+
--runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run]
14371449
--libdir=DIR object code libraries [EPREFIX/lib]
14381450
--includedir=DIR C header files [PREFIX/include]
14391451
--oldincludedir=DIR C header files for non-gcc [/usr/include]
@@ -16616,7 +16628,6 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
1661616628
1661716629
#include <stdatomic.h>
1661816630
atomic_int value = ATOMIC_VAR_INIT(1);
16619-
_Atomic void *py_atomic_address = (void*) &value;
1662016631
int main() {
1662116632
int loaded_value = atomic_load(&value);
1662216633
return 0;

configure.ac

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5413,7 +5413,6 @@ AC_LINK_IFELSE(
54135413
AC_LANG_SOURCE([[
54145414
#include <stdatomic.h>
54155415
atomic_int value = ATOMIC_VAR_INIT(1);
5416-
_Atomic void *py_atomic_address = (void*) &value;
54175416
int main() {
54185417
int loaded_value = atomic_load(&value);
54195418
return 0;
@@ -5425,7 +5424,7 @@ AC_MSG_RESULT($have_stdatomic_h)
54255424

54265425
if test "$have_stdatomic_h" = yes; then
54275426
AC_DEFINE(HAVE_STD_ATOMIC, 1,
5428-
[Has stdatomic.h, atomic_int and _Atomic void* types work])
5427+
[Has stdatomic.h with atomic_int])
54295428
fi
54305429

54315430
# Check for GCC >= 4.7 __atomic builtins

pyconfig.h.in

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

963-
/* Has stdatomic.h, atomic_int and _Atomic void* types work */
963+
/* Has stdatomic.h with atomic_int */
964964
#undef HAVE_STD_ATOMIC
965965

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

0 commit comments

Comments
 (0)
0