Skip to content

Commit 8487ef6

Browse files
authored
[3.6] bpo-34121: Fix detection of C11 atomic support on clang. (GH-8290)
(cherry picked from commit 15c7b2a) Co-authored-by: Benjamin Peterson <[email protected]>
1 parent b2f8aa0 commit 8487ef6

File tree

5 files changed

+21
-78
lines changed

5 files changed

+21
-78
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: 5 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# generated automatically by aclocal 1.15 -*- Autoconf -*-
1+
# generated automatically by aclocal 1.15.1 -*- Autoconf -*-
22

3-
# Copyright (C) 1996-2014 Free Software Foundation, Inc.
3+
# Copyright (C) 1996-2017 Free Software Foundation, Inc.
44

55
# This file is free software; the Free Software Foundation
66
# gives unlimited permission to copy and/or distribute it,
@@ -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 11 (pkg-config-0.29.1)
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
@@ -288,71 +288,3 @@ AS_VAR_COPY([$1], [pkg_cv_][$1])
288288
AS_VAR_IF([$1], [""], [$5], [$4])dnl
289289
])dnl PKG_CHECK_VAR
290290

291-
dnl PKG_WITH_MODULES(VARIABLE-PREFIX, MODULES,
292-
dnl [ACTION-IF-FOUND],[ACTION-IF-NOT-FOUND],
293-
dnl [DESCRIPTION], [DEFAULT])
294-
dnl ------------------------------------------
295-
dnl
296-
dnl Prepare a "--with-" configure option using the lowercase
297-
dnl [VARIABLE-PREFIX] name, merging the behaviour of AC_ARG_WITH and
298-
dnl PKG_CHECK_MODULES in a single macro.
299-
AC_DEFUN([PKG_WITH_MODULES],
300-
[
301-
m4_pushdef([with_arg], m4_tolower([$1]))
302-
303-
m4_pushdef([description],
304-
[m4_default([$5], [build with ]with_arg[ support])])
305-
306-
m4_pushdef([def_arg], [m4_default([$6], [auto])])
307-
m4_pushdef([def_action_if_found], [AS_TR_SH([with_]with_arg)=yes])
308-
m4_pushdef([def_action_if_not_found], [AS_TR_SH([with_]with_arg)=no])
309-
310-
m4_case(def_arg,
311-
[yes],[m4_pushdef([with_without], [--without-]with_arg)],
312-
[m4_pushdef([with_without],[--with-]with_arg)])
313-
314-
AC_ARG_WITH(with_arg,
315-
AS_HELP_STRING(with_without, description[ @<:@default=]def_arg[@:>@]),,
316-
[AS_TR_SH([with_]with_arg)=def_arg])
317-
318-
AS_CASE([$AS_TR_SH([with_]with_arg)],
319-
[yes],[PKG_CHECK_MODULES([$1],[$2],$3,$4)],
320-
[auto],[PKG_CHECK_MODULES([$1],[$2],
321-
[m4_n([def_action_if_found]) $3],
322-
[m4_n([def_action_if_not_found]) $4])])
323-
324-
m4_popdef([with_arg])
325-
m4_popdef([description])
326-
m4_popdef([def_arg])
327-
328-
])dnl PKG_WITH_MODULES
329-
330-
dnl PKG_HAVE_WITH_MODULES(VARIABLE-PREFIX, MODULES,
331-
dnl [DESCRIPTION], [DEFAULT])
332-
dnl -----------------------------------------------
333-
dnl
334-
dnl Convenience macro to trigger AM_CONDITIONAL after PKG_WITH_MODULES
335-
dnl check._[VARIABLE-PREFIX] is exported as make variable.
336-
AC_DEFUN([PKG_HAVE_WITH_MODULES],
337-
[
338-
PKG_WITH_MODULES([$1],[$2],,,[$3],[$4])
339-
340-
AM_CONDITIONAL([HAVE_][$1],
341-
[test "$AS_TR_SH([with_]m4_tolower([$1]))" = "yes"])
342-
])dnl PKG_HAVE_WITH_MODULES
343-
344-
dnl PKG_HAVE_DEFINE_WITH_MODULES(VARIABLE-PREFIX, MODULES,
345-
dnl [DESCRIPTION], [DEFAULT])
346-
dnl ------------------------------------------------------
347-
dnl
348-
dnl Convenience macro to run AM_CONDITIONAL and AC_DEFINE after
349-
dnl PKG_WITH_MODULES check. HAVE_[VARIABLE-PREFIX] is exported as make
350-
dnl and preprocessor variable.
351-
AC_DEFUN([PKG_HAVE_DEFINE_WITH_MODULES],
352-
[
353-
PKG_HAVE_WITH_MODULES([$1],[$2],[$3],[$4])
354-
355-
AS_IF([test "$AS_TR_SH([with_]m4_tolower([$1]))" = "yes"],
356-
[AC_DEFINE([HAVE_][$1], 1, [Enable ]m4_tolower([$1])[ support])])
357-
])dnl PKG_HAVE_DEFINE_WITH_MODULES
358-

configure

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -784,6 +784,7 @@ infodir
784784
docdir
785785
oldincludedir
786786
includedir
787+
runstatedir
787788
localstatedir
788789
sharedstatedir
789790
sysconfdir
@@ -895,6 +896,7 @@ datadir='${datarootdir}'
895896
sysconfdir='${prefix}/etc'
896897
sharedstatedir='${prefix}/com'
897898
localstatedir='${prefix}/var'
899+
runstatedir='${localstatedir}/run'
898900
includedir='${prefix}/include'
899901
oldincludedir='/usr/include'
900902
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
@@ -1147,6 +1149,15 @@ do
11471149
| -silent | --silent | --silen | --sile | --sil)
11481150
silent=yes ;;
11491151

1152+
-runstatedir | --runstatedir | --runstatedi | --runstated \
1153+
| --runstate | --runstat | --runsta | --runst | --runs \
1154+
| --run | --ru | --r)
1155+
ac_prev=runstatedir ;;
1156+
-runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
1157+
| --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
1158+
| --run=* | --ru=* | --r=*)
1159+
runstatedir=$ac_optarg ;;
1160+
11501161
-sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
11511162
ac_prev=sbindir ;;
11521163
-sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
@@ -1284,7 +1295,7 @@ fi
12841295
for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
12851296
datadir sysconfdir sharedstatedir localstatedir includedir \
12861297
oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
1287-
libdir localedir mandir
1298+
libdir localedir mandir runstatedir
12881299
do
12891300
eval ac_val=\$$ac_var
12901301
# Remove trailing slashes.
@@ -1437,6 +1448,7 @@ Fine tuning of the installation directories:
14371448
--sysconfdir=DIR read-only single-machine data [PREFIX/etc]
14381449
--sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
14391450
--localstatedir=DIR modifiable single-machine data [PREFIX/var]
1451+
--runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run]
14401452
--libdir=DIR object code libraries [EPREFIX/lib]
14411453
--includedir=DIR C header files [PREFIX/include]
14421454
--oldincludedir=DIR C header files for non-gcc [/usr/include]
@@ -16796,7 +16808,6 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
1679616808
1679716809
#include <stdatomic.h>
1679816810
atomic_int value = ATOMIC_VAR_INIT(1);
16799-
_Atomic void *py_atomic_address = (void*) &value;
1680016811
int main() {
1680116812
int loaded_value = atomic_load(&value);
1680216813
return 0;

configure.ac

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5451,7 +5451,6 @@ AC_LINK_IFELSE(
54515451
AC_LANG_SOURCE([[
54525452
#include <stdatomic.h>
54535453
atomic_int value = ATOMIC_VAR_INIT(1);
5454-
_Atomic void *py_atomic_address = (void*) &value;
54555454
int main() {
54565455
int loaded_value = atomic_load(&value);
54575456
return 0;
@@ -5463,7 +5462,7 @@ AC_MSG_RESULT($have_stdatomic_h)
54635462

54645463
if test "$have_stdatomic_h" = yes; then
54655464
AC_DEFINE(HAVE_STD_ATOMIC, 1,
5466-
[Has stdatomic.h, atomic_int and _Atomic void* types work])
5465+
[Has stdatomic.h with atomic_int])
54675466
fi
54685467

54695468
# Check for GCC >= 4.7 __atomic builtins

pyconfig.h.in

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

947-
/* Has stdatomic.h, atomic_int and _Atomic void* types work */
947+
/* Has stdatomic.h with atomic_int */
948948
#undef HAVE_STD_ATOMIC
949949

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

0 commit comments

Comments
 (0)