Commit graph

692 commits

Author SHA1 Message Date
Victor Stinner 53af5b2dd2
[3.12] gh-123917: Fix crypt check in configure (#123952)
Use a global volatile variable and check if the function is not NULL
to use the variable. Otherwise, a compiler optimization can remove
the variable making the check useless.

Co-authored-by: Paul Smith <paul@mad-scientist.net>
2024-09-12 16:21:31 +02:00
Victor Stinner 8b16ec65a2
[3.12] Fix typos (#123775) (#123867)
Fix typos (#123775)

(cherry picked from commit 9017b95ff2)

Co-authored-by: algonell <algonell@gmail.com>
2024-09-09 13:22:13 +00:00
Serhiy Storchaka e6878fc3c8
Revert "[3.12] gh-120713: Normalize year with century for datetime.strftime (GH-120820) (GH-121145)" (GH-122409)
This reverts commit 027902b56f.
2024-07-29 21:55:12 +03:00
Serhiy Storchaka 027902b56f
[3.12] gh-120713: Normalize year with century for datetime.strftime (GH-120820) (GH-121145)
(cherry picked from commit 6d34938dc8)

Co-authored-by: blhsing <blhsing@gmail.com>
2024-06-29 06:54:27 +00:00
Miss Islington (bot) 433a5f89c9
[3.12] gh-120671: Fix PY_CHECK_CC_WARNING() in configure.ac (GH-120822) (#120986)
gh-120671: Fix PY_CHECK_CC_WARNING() in configure.ac (GH-120822)

Add missing space in AS_VAR_APPEND() on CFLAGS.
(cherry picked from commit 2106c9bef0)

Co-authored-by: Michael Allwright <allsey87@gmail.com>
2024-06-25 08:11:22 +00:00
Miss Islington (bot) a9f2daf1ab
[3.12] GH-115983: skip building shared modules for testing under WASI (GH-116528) (#120316)
GH-115983: skip building shared modules for testing under WASI (GH-116528)
(cherry picked from commit 8c094c3095)

Co-authored-by: Brett Cannon <brett@python.org>
2024-06-10 13:27:04 +00:00
Victor Stinner 315611aac8
[3.12] gh-120154: Fix Emscripten/WASI pattern in case statement for LDSHARED… (#120204)
gh-120154: Fix Emscripten/WASI pattern in case statement for LDSHARED (#120173)

Fix Emscripten/WASI pattern in case statement for LDSHARED

(cherry picked from commit 47816f465e)

Co-authored-by: Michael Allwright <contact@allwright.io>
2024-06-07 09:49:54 +00:00
Miss Islington (bot) a39e01dd09
[3.12] gh-117752: Autoconf: fix PGO builds for 'make -C build' incantations (GH-117803) (#117805)
(cherry picked from commit 1ddbeae040)

Co-authored-by: Erlend E. Aasland <erlend@python.org>
2024-04-12 10:07:42 +00:00
Miss Islington (bot) 3f2f0cff75
[3.12] gh-117752: Autoconf: fix -fno-semantic-interposition check (GH-117789) (#117800)
Force the compiler to issue an error if the flag is not supported.
(cherry picked from commit 49fc1414b5)

Co-authored-by: Erlend E. Aasland <erlend@python.org>
2024-04-12 07:53:22 +00:00
Miss Islington (bot) c64b65e3aa
[3.12] gh-117752: Autoconf: store all LLVM profile data in the build directory (GH-117790) (#117795)
This prevents spurious 'env changed' and llvm-profdata merge errors.

(cherry picked from commit 396b831850)

Co-authored-by: Erlend E. Aasland <erlend@python.org>
2024-04-12 05:39:14 +00:00
Antoine Pitrou 2ac1b48a04
[3.12] gh-112536: Add support for thread sanitizer (TSAN) (gh-112648) (#116924)
* [3.12] gh-112536: Add support for thread sanitizer (TSAN) (gh-112648)
(cherry picked from commit 88cb972000)

* Remove doc for configure option (leave it hidden in this branch)

---------

Co-authored-by: Samet YASLAN <sametyaslan@gmail.com>
2024-03-17 16:33:35 +01:00
Brett Cannon 88fdb082d9
[3.12] GH-116313: get WASI builds to run under wasmtime 18 w/ WASI 0.2/preview2 primitives (GH-116327) (GH-116373) 2024-03-05 13:35:02 -08:00
Miss Islington (bot) 99d8dfd430
[3.12] gh-80532: Do not set ipv6type when cross-compiling (GH-17956) (#113740)
(cherry picked from commit 5e1916ba1b)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
Co-authored-by: Xavier de Gaye <xdegaye@gmail.com>
2024-01-05 15:56:43 +00:00
Miss Islington (bot) 0e3cf5bcac
[3.12] bpo-11102: Make configure enable major(), makedev(), and minor() on HP-UX (GH-19856) (GH-113540)
Always include <sys/types.h> before <sys/sysmacros.h>.

(cherry picked from commit f108468970)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-12-28 11:12:16 +00:00
Miss Islington (bot) 72073ca560
[3.12] gh-110459: Make sure --with-openssl-rpath works on macOS (GH-113441) (#113535)
gh-110459: Make sure --with-openssl-rpath works on macOS (GH-113441)

* gh-110459: Make sure --with-openssl-rpath works on macOS

On macOS the `-rpath` linker flag is spelled differently
than on on platforms.
(cherry picked from commit cc13eabc7c)

Co-authored-by: Ronald Oussoren <ronaldoussoren@mac.com>
2023-12-28 10:21:12 +01:00
Victor Stinner a498433df2
[3.12] gh-112088: Run autoreconf in GHA check_generated_files (GH-112090) (#112159)
gh-112088: Run autoreconf in GHA check_generated_files (#112090)

The "Check if generated files are up to date" job of GitHub Actions
now runs the "autoreconf -ivf -Werror" command instead of the "make
regen-configure" command to avoid depending on the external quay.io
server.

Add Tools/build/regen-configure.sh script to regenerate the configure
with an Ubuntu container image. The
"quay.io/tiran/cpython_autoconf:271" container image
(https://github.com/tiran/cpython_autoconf) is no longer used.

(cherry picked from commit d9fd33a869)
2023-11-16 15:55:40 +01:00
Miss Islington (bot) d34650e740
[3.12] gh-111460: Restore ncurses widechar support on macOS (GH-111878) (gh-112034)
gh-111460: Restore ncurses widechar support on macOS (GH-111878)
(cherry picked from commit d2f305dfd1)

Co-authored-by: Davide Rizzo <sorcio@gmail.com>
2023-11-14 10:59:01 +09:00
Miss Islington (bot) 727f8ee31c
[3.12] gh-111046: for wasi-threads, export memory as well via the linker (GH-111099) (GH-111141)
gh-111046: for wasi-threads, export memory as well via the linker (GH-111099)
(cherry picked from commit 5dfa71769f)

Co-authored-by: YAMAMOTO Takashi <yamamoto@midokura.com>
2023-10-20 22:23:15 +00:00
Miss Islington (bot) 190660abe9
[3.12] gh-78469: Declare missing sethostname for Solaris 10 (GH-109447) (#110580)
Add OS version specific macro for Solaris: Py_SUNOS_VERSION.
(cherry picked from commit 3b1580af07)

Co-authored-by: Jakub Kulík <Kulikjak@gmail.com>
2023-10-10 09:26:36 +00:00
Miss Islington (bot) 53122bcf82
[3.12] gh-109191: Fix build with newer editline (gh-110239) (gh-110562)
gh-109191: Fix build with newer editline (gh-110239)
(cherry picked from commit f4cb0d27cc)

Co-authored-by: Bo Anderson <mail@boanderson.me>
2023-10-09 23:01:00 +09:00
justdan6 80aebd54c8
[3.12] gh-106881: Check for linux/limits.h before including it (#107397) (#107414)
* Check for linux/limits.h before including it

Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
(cherry picked from commit 11c055f5ff)
2023-07-28 16:29:31 -07:00
Miss Islington (bot) d87d67b9e6
[3.12] gh-106962: Detect mpicc in configure.ac (GH-106961) (#107081)
Don't let autoconf mistake MPI compilers for Intel compilers;
filter out the MPI case to prevent Intel specific options from being applied.
(cherry picked from commit 9a6b278769)

Co-authored-by: Lukas van de Wiel <30800501+LukasvdWiel@users.noreply.github.com>
2023-07-23 00:01:44 +00:00
Miss Islington (bot) e903c16a6c
[3.12] gh-101538: Add experimental wasi-threads build (GH-101537) (#106834)
(cherry picked from commit d8f87cdf94)

Co-authored-by: YAMAMOTO Takashi <yamamoto@midokura.com>
Co-authored-by: Brett Cannon <brett@python.org>
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
2023-07-18 00:31:17 +02:00
Miss Islington (bot) 0efbe4d189
[3.12] gh-106123: Modules/_sha3 appears to no longer be necessary (GH-106124) (#106127)
Co-authored-by: Skip Montanaro <skip.montanaro@gmail.com>
2023-06-26 22:49:32 -07:00
Erlend E. Aasland c607551baf
[3.12] gh-89886: Use Autoconf quadrigraphs where appropriate (#105226) (#105423) 2023-06-07 07:41:17 +00:00
Erlend E. Aasland 6f3a4fd4f2
[3.12] gh-90005: Don't link with libbsd if not needed (#105236) (#105360)
The regression was introduced with commit 5b946cada.
Restore pre gh-29696 behaviour.
2023-06-06 10:58:13 +00:00
Erlend E. Aasland 83c7386cee
[3.12] GH-89886: Bump to GNU Autoconf v2.71 (#104925) (#105207)
Co-authored-by: Christian Heimes <christian@python.org>
2023-06-01 22:19:19 +00:00
Miss Islington (bot) 6375287b37
[3.12] gh-89886: Rely on HAVE_SYS_TIME_H (GH-105058) (#105192)
Quoting autoconf (v2.71):

    All current systems provide time.h; it need not be checked for.
    Not all systems provide sys/time.h, but those that do, all allow
    you to include it and time.h simultaneously.

(cherry picked from commit 9ab587b714)

Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
2023-06-01 12:08:37 +00:00
Erlend E. Aasland af7b55d37f
[3.12] gh-89886: Properly quote Autoconf macro arguments (#105062) (#105118)
Autoconf 2.70 macros are picky about argument quotation.
2023-05-30 21:54:31 +00:00
Dong-hee Na b151660883
[3.12] gh-101282: Enclose BOLT_APPLY_FLAGS value in double quotes (gh… (gh-104853)
[3.12] gh-101282: Enclose BOLT_APPLY_FLAGS value in double quotes (gh-104752)
(cherry picked from commit c43785192c)
2023-05-24 10:47:07 +00:00
Gregory Szorc 5360cb3d56
gh-101282: Apply BOLT optimizations to libpython for shared builds (#104709)
Apply BOLT optimizations to libpython for shared builds. Most of the C
code is in libpython so it is critical to apply BOLT there fully realize
BOLT benefits.

This change also reworks how BOLT instrumentation is applied. It
effectively removes the readelf based logic added in gh-101525 and
replaces it with a mechanism that saves a copy of the pre-bolt binary
and restores that copy when necessary. This allows us to perform BOLT
optimizations without having to manually delete the output binary to
force a new bolt run.

Also:
- add a clean-bolt target for purging BOLT files and hook that up to the
  clean target
- .gitignore BOLT related files

Before and after this refactor, `make` will no-op after a previous run.
Both versions should also share common make DAG deficiencies where
targets fail to trigger as often as they need to or can trigger
prematurely in certain scenarios. e.g. after this change you may need to
`rm profile-bolt-stamp` to force a BOLT run because there aren't
appropriate non-phony targets for BOLT's make target to depend on.

To make it easier to iterate on custom BOLT settings, the flags to pass
to instrumentation and application are now defined in configure and can
be overridden by passing BOLT_INSTRUMENT_FLAGS and BOLT_APPLY_FLAGS.
2023-05-22 13:45:20 +02:00
Erlend E. Aasland 146106a0f1
gh-104487: PYTHON_FOR_REGEN must be minimum Python 3.10 (#104488)
Also include Python 3.12 in the list of accepted versions.
2023-05-15 08:02:44 +00:00
Gregory Szorc 27d8ecd7f3
gh-101282: move BOLT config after PGO (gh-104493) 2023-05-15 04:29:44 +00:00
Zhang Na 03029ace92
gh-90656: Add platform triplets for 64-bit LoongArch (LA64) (#30939)
Signed-off-by: Zhang Na <zhangna@loongson.cn>
Co-authored-by: WANG Xuerui <git@xen0n.name>
2023-05-09 09:19:40 +00:00
Petr Viktorin cd9a56c2b0
gh-103509: PEP 697 -- Limited C API for Extending Opaque Types (GH-103511)
Co-authored-by: Oleg Iarygin <oleg@arhadthedev.net>
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
2023-05-04 09:56:53 +02:00
Dong-hee Na 5d9762e7cf
gh-101525: Fix make test if the --enable-bolt enabled (gh-103574) 2023-04-17 23:14:18 +09:00
Nikita Sobolev 7f3c106503
gh-103326: Remove Python/importlib.h (GH-103331)
Co-authored-by: Brett Cannon <brett@python.org>
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2023-04-12 11:27:14 -07:00
Matthias Görgens eff9f43924
gh-96821: Add config option --with-strict-overflow (#96823)
Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Shantanu <hauntsaninja@gmail.com>
2023-03-04 13:39:52 -08:00
Jonathan Protzenko fcadc7e405
gh-99108: Import MD5 and SHA1 from HACL* (#102089)
Replaces our fallback non-OpenSSL MD5 and SHA1 implementations with those from HACL* as we've already done with SHA2.
2023-02-22 13:18:43 -08:00
Eli Schwartz 226484e475
gh-99942: correct the pkg-config/python-config flags for cygwin/android 2023-02-16 17:57:59 +00:00
Gregory P. Smith 0b13575e74
gh-99108: Refactor _sha256 & _sha512 into _sha2. (#101924)
This merges their code. They're backed by the same single HACL* static library, having them be a single module simplifies maintenance.

This should unbreak the wasm enscripten builds that currently fail due to linking in --whole-archive mode and the HACL* library appearing twice.

Long unnoticed error fixed: _sha512.SHA384Type was doubly assigned and was actually SHA512Type. Nobody depends on those internal names.

Also rename LIBHACL_ make vars to LIBHACL_SHA2_ in preperation for other future HACL things.
2023-02-15 22:08:20 -08:00
Jonathan Protzenko e5da9ab2c8
gh-99108: Import SHA2-384/512 from HACL* (#101707)
Replace the builtin hashlib implementations of SHA2-384 and SHA2-512
originally from LibTomCrypt with formally verified, side-channel resistant
code from the [HACL*](https://github.com/hacl-star/hacl-star/) project.
The builtins remain a fallback only used when OpenSSL does not provide them.
2023-02-14 01:25:16 -08:00
Erlend E. Aasland 2db2c4b455
gh-92547: Purge sqlite3_enable_shared_cache() detection from configure (#101873) 2023-02-13 13:36:42 +01:00
Jonathan Protzenko 1fcc0efdaa
gh-99108: Replace SHA2-224 & 256 with verified code from HACL* (#99109)
replacing hashlib primitives (for the non-OpenSSL case) with verified implementations from HACL*. This is the first PR in the series, and focuses specifically on SHA2-256 and SHA2-224.

This PR imports Hacl_Streaming_SHA2 into the Python tree. This is the HACL* implementation of SHA2, which combines a core implementation of SHA2 along with a layer of buffer management that allows updating the digest with any number of bytes. This supersedes the previous implementation in the tree.

@franziskuskiefer was kind enough to benchmark the changes: in addition to being verified (thus providing significant safety and security improvements), this implementation also provides a sizeable performance boost!

```
---------------------------------------------------------------
Benchmark                     Time             CPU   Iterations
---------------------------------------------------------------
Sha2_256_Streaming            3163 ns      3160 ns       219353     // this PR
LibTomCrypt_Sha2_256          5057 ns      5056 ns       136234     // library used by Python currently
``` 

The changes in this PR are as follows:
- import the subset of HACL* that covers SHA2-256/224 into `Modules/_hacl`
- rewire sha256module.c to use the HACL* implementation

Co-authored-by: Gregory P. Smith [Google LLC] <greg@krypto.org>
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
2023-02-06 18:11:01 -08:00
Eric Snow c67b00534a
gh-101524: Split Up the _xxsubinterpreters Module (gh-101526)
This is step 1 in potentially dropping all the "channel"-related code. Channels have already been removed from PEP 554.

https://github.com/python/cpython/issues/101524
2023-02-03 18:14:43 -07:00
Dong-hee Na a958e7d35a
gh-101278: Drop -gdwarf-4 flag from the BOLT build (gh-101280) 2023-01-24 19:22:00 +09:00
Gregory Szorc 7589d713a1
gh-101060: conditionally add -fno-reorder-blocks-and-partition (gh-101061) 2023-01-24 18:34:44 +09:00
Gregory Szorc 79af40a403
gh-101047: Remove vestigial references to macOS libtool options (gh-101048)
LIBTOOL_CRUFT and OTHER_LIBTOOL_OPT variables have been unused since commit
19199830f7 in 2011.
2023-01-22 17:26:42 -05:00
Kushal Das 75c8133efe
gh-100340: Allows -Wno-int-conversion for wasm (#100341)
Fixes #100340 allows -Wno-int-conversion for wasm
2023-01-18 19:43:49 +01:00
Michał Górny 02a72f080d
gh-98636: Fix detecting gdbm_compat for _dbm module (#98643)
Fix the gdbm_compat library detection logic to actually check for
-lgdbm_compat independently of the ndbm detection.
This fixes the build failure with `--with-dbmliborder=gdbm`,
and implicit fallback to ndbm with the default value.
2023-01-11 22:46:28 +01:00