Commit Graph

858 Commits

Author SHA1 Message Date
Victor Stinner aabab76c8a
gh-131268: Adjust _PYTHREAD_NAME_MAXLEN on BSD (#131345)
Adjust _PYTHREAD_NAME_MAXLEN constant on FreeBSD and NetBSD.
Initial patch by Xavier G.
2025-03-17 16:52:59 +00:00
Hood Chatham db1e5827c4
gh-127503: Improve tracebacks on Emscripten when there is a trap (#131158)
Modifies the behavior of the interpreter on crash under Emscripten:
1. No Python traceback shown on segfault/trap
2. The JavaScript source line is shown

The JavaScript source line is super long and completely unenlightening,
whereas the Python traceback is very helpful.
2025-03-13 08:28:15 +08:00
Mark Shannon 014223649c
GH-130396: Use computed stack limits on linux (GH-130398)
* Implement C recursion protection with limit pointers for Linux, MacOS and Windows

* Remove calls to PyOS_CheckStack

* Add stack protection to parser

* Make tests more robust to low stacks

* Improve error messages for stack overflow
2025-02-25 09:24:48 +00:00
Ken Jin aa28423201
Revert "gh-130048: Reintroduce full LTO as default on Clang (GH-130049)" (#130088)
This reverts commit 34c06ccc4c.
2025-02-13 17:27:19 +00:00
Ken Jin 34c06ccc4c
gh-130048: Reintroduce full LTO as default on Clang (GH-130049) 2025-02-13 22:06:00 +08:00
Ken Jin 1b27f36eb0
gh-129819: Allow tier2/JIT and tailcall (GH-129820) 2025-02-13 02:18:36 +08:00
Erlend E. Aasland 167cf3ace0
gh-115806: Don't mangle gdbm header dependency detection output (#129390)
Replace AC_CACHE_VAL/AC_CHECK_HEADER with a cleaner variant using
AC_CACHE_CHECK/AC_PREPROC_IFELSE.

The former would produce garbled output when config.cache was reused. It
also required directly manipulating GNU Autoconf cache variables.
2025-02-08 15:38:11 +01:00
Pieter Eendebak 43e0240213
gh-129737: Fix help message for tail calling interpreter configuration (GH-129754) 2025-02-07 08:47:13 +08:00
Ken Jin cb640b659e
gh-128563: A new tail-calling interpreter (GH-128718)
Co-authored-by: Garrett Gu <garrettgu777@gmail.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2025-02-06 23:21:57 +08:00
Michael Osipov e3eba8ce26
gh-129393: Make 'sys.platform' return "freebsd" only on FreeBSD (#129394)
Make 'sys.platform' return "freebsd" only on FreeBSD without major version.
2025-01-31 10:02:45 +01:00
Hood Chatham 960936fe90
gh-128627: Emscripten: Fix address calculation for wasm-gc trampoline (#128782)
Modifies the memory calculation to divide the entire memory address by 4, not just the base address.
2025-01-23 08:02:04 +08:00
Victor Stinner 81159fce36
gh-59705: Make PYTHREAD_NAME_MAXLEN macro private (#128945)
Rename PYTHREAD_NAME_MAXLEN to _PYTHREAD_NAME_MAXLEN.
2025-01-18 15:10:29 +00:00
Zanie Blue 6ecb620a0c
gh-90905: Allow cross-compilation on macOS (#128385) 2025-01-13 03:38:28 -05:00
Filipe Laíns 🇵🇸 95cd9c669c
GH-127970: find the runtime library when dladdr is available (#127972) 2025-01-08 12:03:21 +00:00
Erlend E. Aasland e08b28235a
gh-127614: Correctly check for ttyname_r() in configure (#128503)
PR #14868 replaced the ttyname() call with ttyname_r(), but the old
check remained.
2025-01-07 22:42:36 +01:00
Zanie Blue 24b147a19b
gh-128472: Add `-skip-funcs` to BOLT options to fix computed goto errors (gh-128511)
* Add `-skip-funcs` to BOLT options to fix computed goto errors

Co-authored-by: Gregory Szorc <gregory.szorc@gmail.com>

* NEWS

---------

Co-authored-by: Gregory Szorc <gregory.szorc@gmail.com>
2025-01-07 12:02:55 +09:00
Hood Chatham 61c1a2478e
gh-127146: Strip dash from Emscripten compiler version (#128557)
`emcc -dumpversion` will sometimes say e.g., `4.0.0-git` but in this case
uname does not include `-git` in the version string. Use cut to delete
everything after the dash.
2025-01-07 06:26:35 +08:00
Zanie Blue b60044b838
gh-128437: Add `BOLT_COMMON_FLAGS` with `-update-debug-sections` (gh-128455)
Add `BOLT_COMMON_FLAGS` with `-update-debug-sections`

Co-authored-by: Gregory Szorc <gregory.szorc@gmail.com>
2025-01-05 13:16:30 +09:00
Erlend E. Aasland 0cafa97932
gh-115765: Document and enforce Autoconf 2.72 requirement (#128502) 2025-01-04 23:38:46 +00:00
Zanie Blue b75ed951d4
gh-128354: Consistently use LIBS over LDFLAGS in library build checks (#128359) 2025-01-03 21:51:06 +01:00
Zanie Blue 4974bbdb29
gh-128456: Use '-reorder-functions=cdsort' for BOLT builds (#128457)
'hfsort+' is deprecated in favor of 'cdsort'.
2025-01-03 20:49:50 +00:00
Zanie Blue bb2dfadb92
gh-128104: Remove `Py_STRFTIME_C99_SUPPORT`; require C99-compliant strftime (#128106) 2025-01-03 11:04:03 +01:00
Zanie Blue 81376fef76
gh-128321: Set LIBS instead of LDFLAGS when checking sqlite3 requirements (#128322)
Co-authored-by: Erlend E. Aasland <erlend@python.org>
2024-12-30 09:55:14 +01:00
Furkan Onder 492b224b99
gh-128279: Enhance the NetBSD compatibility for thread naming (#128280)
Enhance NetBSD compatibility for thread naming in _threadmodule.c.
2024-12-28 19:49:45 +01:00
Zanie Blue 9d3a8f4949
gh-100384: Error on `unguarded-availability` in macOS builds (#128155)
Generate a build error on ``unguarded-availability`` in portable macOS builds (i.e. using MACOSX_DEPLOYMENT_TARGET), preventing invalid use of symbols that are not available in older versions of the OS.
2024-12-22 11:01:45 -08:00
RUANG (James Roy) ea578fc6d3
gh-127688: Add `SCHED_DEADLINE` and `SCHED_NORMAL` constants to `os` module (GH-127689) 2024-12-19 14:51:21 +01:00
Hood Chatham b92f101d0f
gh-127146: Emscripten Include compiler version in _PYTHON_HOST_PLATFORM (#127992)
Modifies _PYTHON_HOST_PLATFORM to include the compiler version under
Emscripten. The Emscripten compiler version is the platform version
compatibility identifier.
2024-12-18 07:17:09 +08:00
Hood Chatham be07edf511
gh-127111: Emscripten Move link flags from `LDFLAGS_NODIST` to `LINKFORSHARED` (#127666)
Corrects the usage of linking flags to avoid compilation errors related to the
use of `-sEXPORTED_FUNCTIONS` when linking shared libraries.
2024-12-09 09:34:28 +08:00
Victor Stinner 67b18a18b6
gh-59705: Add _thread.set_name() function (#127338)
On Linux, threading.Thread now sets the thread name to the operating
system.

* configure now checks if pthread_getname_np()
  and pthread_setname_np() functions are available.
* Add PYTHREAD_NAME_MAXLEN macro.
* Add _thread._NAME_MAXLEN constant for test_threading.

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-12-06 16:27:12 +00:00
Victor Stinner fcbe6ecdb6
gh-93312: Include <sys/pidfd.h> to get PIDFD_NONBLOCK (#127593) 2024-12-05 10:39:44 +01:00
Hood Chatham 87faf0a9c4
gh-127503: Emscripten make Python.sh function as proper Python CLI (#127506)
Modifies the python.sh script to work on macOS, and adapt to recent emscripten changes.
2024-12-05 08:44:50 +08:00
Hood Chatham 43634fc1fc
gh-127146: Emscripten: Skip segfaults in test suite (#127151)
Added skips for tests known to cause problems when running on Emscripten. 
These mostly relate to the limited stack depth on Emscripten.
2024-12-05 08:26:25 +08:00
Hood Chatham bfb0788bfc
gh-127111: Emscripten Make web example work again (#127113)
Moves the Emscripten web example into a standalone folder, and updates 
Makefile targets to build the web example. Instructions for usage have
also been added.
2024-12-03 07:30:24 +08:00
Filipe Laíns 🇵🇸 2950bc50af
GH-127429: fix sysconfig data generation on cross-builds (#127430) 2024-12-02 07:12:36 +00:00
Hood Chatham 1629d2ca56
gh-126898: Emscripten support: Use es6 modules (#126903)
Modify Emscripten support to use ES6 modules.
2024-11-21 15:10:46 +11:00
Hood Chatham 544b001b23
gh-126691: Remove --with-emscripten-target (#126787)
This unifies the code for nodejs and the code for the browser. After this
commit, the browser example doesn't work; this will be fixed in a
subsequent update.
2024-11-16 09:44:05 +08:00
Hood Chatham 142104ce78
gh-89640: Pull in update to float word order detection in autoconf-archive (#126747) 2024-11-13 21:57:33 +01:00
Hood Chatham 403410fa1b
gh-89640: Restore configure error message on failure to detect float word order (#126569)
Before #126387, if we didn't detect float word order we'd raise the following
configure error:

    Unknown float word ordering. You need to manually preset
    ax_cv_c_float_words_bigendian=no (or yes) according to your system.

This puts it back (except for ARM or WASM, which as hardcoded).
2024-11-08 11:57:17 +00:00
Brett Cannon bbe9b21d06
GH-123877: default to `wasm32-wasip1` instead of `wasm32-wasi` to be more specific (GH-126552)
Eventually wasm32-wasi will represent WASI 1.0, and so it's currently deprecated so it can be used for that eventual purpose. wasm32-wasip1 is also more specific to what version of WASI is currently supported.

---------

Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
2024-11-07 13:40:56 -08:00
Erlend E. Aasland a5b94d0660
gh-96398: Improve accuracy of compiler checks in configure.ac (#117815)
The following variables are now used in compiler checks:
- $ac_cv_gcc_compat is set to 'yes' for GCC compatible compilers
  (the C preprocessor defines the __GNUC__ macro)
- for compiler basename checks, use $CC_BASENAME
  (may contain platform triplets)
- for the rest, use $ac_cv_cc_name
  (does not contain platform triplets)
2024-11-07 10:49:58 +01:00
Brett Cannon 2a6b6b33df
GH-126458: disable SIMD for HACL under WASI (#126512)
Requires an extra `-msimd128` flag and the `*mmintrin.h` header files are exclusive to x86-family CPUs.
2024-11-06 14:33:46 -08:00
Erlend E. Aasland 532fc08102
gh-89640: Hardcode WASM float word ordering as little endian (#126387) 2024-11-04 21:48:09 +01:00
Bénédikt Tran 38a604fd90
gh-99108: Cleanup references to inexisting `Modules/_blake2`. (GH-126270)
* Remove references to `Modules/_blake2`.

* Remove `Modules/_blake2` entry from CODEOWNERS

The folder does not exist anymore.

* Remove `Modules/_blake2` entry from `Tools/c-analyzer/TODO`
2024-11-01 16:18:44 +00:00
Hood Chatham b3122aa613
gh-126178: NFC Separate Emscripten and WASI standard lib disables in configure (#126179)
Separate the Emscripten and WASI stdlib configuration in configure.
2024-10-31 08:51:11 +08:00
Jakub Kulík 1064141967
gh-91962: Fix `hstrerror` detection issues on Solaris (GH-91963) 2024-10-30 13:19:44 +01:00
Sergey B Kirpichev dcad8fecbd
gh-125206: Correct detection of complex numbers support in libffi (#126104) 2024-10-30 10:12:39 +01:00
Hood Chatham b1f13bce62
gh-124932: Distinguish build prefix from host prefix in cross builds (#124933)
In Emscripten and other cross builds, the build file system and the host file
system look different. For instance, we may want to install into
`cross-build/$TARGET/lib`, and then mount that as `/lib` in the host file
system. This change adds a distinction between:

* `prefix` -- the path in the build file system where we want to install the files
* `host_prefix` -- the path in the host file system where getpath.c will look for the files

And similarly for `exec_prefix` and `host_exec_prefix`. At present, this is only
used for Emscripten.
2024-10-30 05:45:49 +08:00
Hood Chatham dc2552d429
gh-124928: Emscripten node support: Clean up old node <= 16 flags (#124929)
Clean up configure flags for old node versions

These flags are only needed for node <= 16. Node 16 has been end of life since
October of 2023.
2024-10-29 06:28:54 +00:00
Erlend E. Aasland 8b7cdc5e0c
gh-125698: Autoconf: Sync EXEEXT and ac_exeext (#125995) 2024-10-26 17:11:42 +02:00
Erlend E. Aasland b3c6b2c9e1
gh-125698: Restore EXEEXT in configure and Make (#125758)
This reverts commit e924bb667.
2024-10-20 23:08:01 +02:00