Commit Graph

768 Commits

Author SHA1 Message Date
Victor Stinner 49f51deeef
gh-120688: Build WASI with -O3 in debug mode (#120691)
On WASI in debug mode, Python is now built with compiler flag -O3
instead of -Og, to support more recursive calls.
2024-06-18 19:35:44 +02:00
Victor Stinner 6acf7776ef
gh-120507: Double WASI memory (#120648)
Use 16 MiB stack with 40 MiB memory limit, instead of 8 MiB stack
with 20 MiB memory limit.
2024-06-17 16:08:05 +00:00
ixgbe00 4b1e85bafc
gh-120400 :Support Linux perf profile to see Python calls on RISC-V architecture (#120089)
Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
2024-06-12 14:24:46 +01:00
Michael Allwright 47816f465e
gh-120154: Fix Emscripten/WASI pattern in case statement for LDSHARED (#120173)
Fix Emscripten/WASI pattern in case statement for LDSHARED
2024-06-07 10:38:15 +02:00
Erlend E. Aasland 642b25b9a8
gh-115119: Fall back to bundled libmpdec if system libmpdec is not found (#119196) 2024-05-20 10:58:08 -04:00
Thomas Wouters 7768ff1e41 Python 3.14.0a0 2024-05-08 16:57:05 +02:00
Erlend E. Aasland 325a1da18d
gh-115119: Default to --with-system-libmpdec=yes (#118539)
Co-authored-by: Zachary Ware <zachary.ware@gmail.com>
2024-05-06 21:16:08 +02:00
Davide Rizzo 08d169f14a
gh-109617: fix ncurses incompatibility on macOS with Xcode 15 (#111258)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2024-05-04 23:41:47 +02:00
Guido van Rossum a524152b8c
gh-118335: Make REGEN_JIT_COMMAND empty if tier2 interpreter enabled (#118493)
Also patch up news blurb for gh-118339
(add warning that PYTHON_UOPS is now PYTHON_JIT).
2024-05-01 16:36:29 -07:00
Malcolm Smith 75955110a6
gh-116622: Android sysconfig updates (#118352) 2024-05-01 16:47:54 +00:00
Guido van Rossum 7d83f7bcc4
gh-118335: Configure Tier 2 interpreter at build time (#118339)
The code for Tier 2 is now only compiled when configured
with `--enable-experimental-jit[=yes|interpreter]`.

We drop support for `PYTHON_UOPS` and -`Xuops`,
but you can disable the interpreter or JIT
at runtime by setting `PYTHON_JIT=0`.
You can also build it without enabling it by default
using `--enable-experimental-jit=yes-off`;
enable with `PYTHON_JIT=1`.

On Windows, the `build.bat` script supports
`--experimental-jit`, `--experimental-jit-off`,
`--experimental-interpreter`.

In the C code, `_Py_JIT` is defined as before
when the JIT is enabled; the new variable
`_Py_TIER2` is defined when the JIT *or* the
interpreter is enabled. It is actually a bitmask:
1: JIT; 2: default-off; 4: interpreter.
2024-04-30 18:26:34 -07:00
Malcolm Smith 3b268f4edc
gh-116622: Redirect stdout and stderr to system log when embedded in an Android app (#118063) 2024-04-30 16:00:31 +02:00
Erlend E. Aasland c7e7bfc4ca
gh-115119: Detect _decimal dependencies using pkg-config (#115406)
pkg-config is supported for libmpdec 4.0.0 and newer.
2024-04-29 08:58:57 +02:00
Eric Snow 03e3e31723
gh-76785: Rename _xxsubinterpreters to _interpreters (gh-117791)
See https://discuss.python.org/t/pep-734-multiple-interpreters-in-the-stdlib/41147/26.
2024-04-24 16:18:24 +00:00
Yichen Yan e17cd1fbfd
gh-116984: Install mimalloc headers (#116985)
- Install mimalloc header only when enabled
- Rename WITH_MIMALLOC to INSTALL_MIMALLOC
2024-04-23 09:56:00 +02:00
Joshua Root 8515fd79fe
gh-117845: Detect libedit hook function signature in configure (#117870)
Older libedit versions (like Apple's) use a different type signature
for rl_startup_hook and rl_pre_input_hook. Add a configure check to
determine which signature is accepted by introducing the
Py_RL_STARTUP_HOOK_TAKES_ARGS macro in pyconfig.h.
2024-04-17 11:26:10 +02:00
Victor Stinner 919784737c
gh-117645: Increase WASI stack size from 512 KiB to 8 MiB (#117674)
Increase also the initial memory from 10 MiB to 20 MiB.

Reenable test_dynamic on WASI build.
2024-04-16 23:26:54 +02:00
Erlend E. Aasland 0dcfd0d522
Autoconf: aarch64-apple-darwin/clang is now a tier 1 platform (#117861)
See also python/pep#3705
2024-04-14 09:21:29 +02:00
Erlend E. Aasland 3095d02642
gh-96398: Fix mpicc check in configure.ac (#117857) 2024-04-13 21:22:06 +00:00
Erlend E. Aasland c2a551a30b
gh-96398: Detect GCC compatible compilers in configure (#117825)
Introduce a cached variable $ac_cv_gcc_compat and set it to 'yes' if
the C preprocessor defines the __GNUC__ macro.
2024-04-13 09:05:07 +02:00
Erlend E. Aasland 4ce10da36f
gh-96398: Detect emcc and mpicc in compiler names in configure (#117819)
- emcc defines __EMSCRIPTEN__
- mpicc doesn't define anything in particular; detect it using basename
2024-04-12 16:33:29 +02:00
Erlend E. Aasland 1ddbeae040
gh-117752: Autoconf: fix PGO builds for 'make -C build' incantations (#117803) 2024-04-12 09:36:40 +00:00
Erlend E. Aasland 49fc1414b5
gh-117752: Autoconf: fix -fno-semantic-interposition check (#117789)
Force the compiler to issue an error if the flag is not supported.
2024-04-12 09:37:38 +02:00
Erlend E. Aasland 396b831850
gh-117752: Autoconf: store all LLVM profile data in the build directory (#117790)
This prevents spurious 'env changed' and llvm-profdata merge errors.
2024-04-12 07:23:39 +02:00
Eli Schwartz fd2bab9d28
gh-117787: Autoconf: fix bashisms/semantic breakage of iOS checks (#117788) 2024-04-12 01:03:54 +02:00
Erlend E. Aasland 9c1dfe21fd
gh-116303: Don't build xxlimited and xxlimited_35 if --disable-test-modules is given (#117554) 2024-04-05 10:29:15 +02:00
Russell Keith-Magee f006338017
gh-114099: Additions to standard library to support iOS (GH-117052)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Malcolm Smith <smith@chaquo.com>
Co-authored-by: Ned Deily <nad@python.org>
2024-03-28 03:59:33 -04:00
Malcolm Smith 3ec57307e7
gh-71052: Add Android build script and instructions (#116426) 2024-03-22 00:52:29 +01:00
Russell Keith-Magee 408e127159
gh-114099 - Add iOS framework loading machinery. (GH-116454)
Co-authored-by: Malcolm Smith <smith@chaquo.com>
Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
2024-03-19 08:36:19 -04:00
Guido van Rossum 9c7b3688e6
gh-108716: Cleanup remaining deepfreeze infrastructure (#116919)
Keep Tools/build/deepfreeze.py around (we may repurpose it for deepfreezing non-code objects),
and keep basic "clean" targets that remove the output of former deep-freeze activities,
to keep the build directories of current devs clean.
2024-03-18 11:13:11 -07:00
Brett Cannon 8c094c3095
GH-115983: skip building shared modules for testing under WASI (GH-116528) 2024-03-13 23:25:50 +00:00
Malcolm Smith 872c0714fc
gh-71052: Change Android's `sys.platform` from "linux" to "android"
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
2024-03-11 19:25:39 +00:00
Erlend E. Aasland d864b0094f
gh-116303: Explicitly check for the _testsinglephase module in configure.ac (#116479) 2024-03-07 23:42:43 +00:00
Victor Stinner d9bcdda39c
gh-116417: Add _testlimitedcapi C extension (#116419)
Add a new C extension "_testlimitedcapi" which is only built with the
limited C API.

Move heaptype_relative.c and vectorcall_limited.c from
Modules/_testcapi/ to Modules/_testlimitedcapi/.

* configure: add _testlimitedcapi test extension.
* Update generate_stdlib_module_names.py.
* Update make check-c-globals.

Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
2024-03-07 18:31:12 +00:00
Russell Keith-Magee b33980a2e3
gh-114099 - Add iOS testbed, plus Makefile target to invoke it. (gh-115930) 2024-03-06 23:24:52 -05:00
Brett Cannon 7af063d1d8
GH-116313: get WASI builds to run under wasmtime 18 w/ WASI 0.2/preview2 primitives (#116327)
* GH-116313: get WASI builds to run under wasmtime 18 w/ WASI 0.2/preview2 primitives

* Add the configure changes

* Update `wasm_build.py`
2024-03-05 09:18:53 +01:00
Sergey B Kirpichev ea1b1c579f
gh-108562: Revert enabling -fstrict-overflow for libmpdec (GH-116302)
gh-108562: partial reversion of pr114751

Reverts -fstrict-overflow for libmpdec
2024-03-04 18:07:24 +01:00
Sergey B Kirpichev 002a5948fc
gh-108562: Fix compiler warnings for libmpdec (#114751)
If awailable, enable -fstrict-overflow for libmpdec. Also
shut off false positive warnings (-Warray-bounds).

The later was backported from mpdecimal-4.0.0.
2024-03-03 08:25:39 +01:00
Erlend E. Aasland 41baa03d30
gh-115806: Don't mangle output of configure 'ipv6 stack type' check (#116165) 2024-03-01 18:38:32 +01:00
Malcolm Smith fa1d675309
gh-71052: Fix several Android build issues (#115955)
This change is part of the work on PEP-738: Adding Android as a 
supported platform.

* Remove the "1.0" suffix from libpython's filename on Android, which 
  would prevent Gradle from packaging it into an app. 
* Simplify the build command in the Makefile so that libpython always 
  gets given an SONAME with the `-Wl-h` argument, even if the SONAME is
  identical to the actual filename.
* Disable a number of functions on Android which can be compiled and 
  linked against, but always fail at runtime. As a result, the native
  _multiprocessing module is no longer built for Android.
* gh-115390 (bee7bb331) added some pre-determined results to the 
  configure script for things that can't be autodetected when
  cross-compiling; this change adds Android to these where appropriate.
* Add a couple more pre-determined results for Android, and making them 
  cover iOS as well. This means the --enable-ipv6 configure option will 
  no longer be required on either platform.
2024-02-29 22:58:20 +01:00
Erlend E. Aasland 449c6da2bd
gh-115765: Don't use deprecated AC_EGREP_* macros in configure.ac (#116016)
Rewrite using AX_CHECK_DEFINE and AC_CHECK_TYPES.
2024-02-28 14:35:41 +01:00
Pablo Galindo Salgado 1752b51012
gh-115773: Add tests to exercise the _Py_DebugOffsets structure (#115774) 2024-02-28 10:17:34 +00:00
Russell Keith-Magee bee7bb3310
gh-114099: Add configure and Makefile targets to support iOS compilation. (GH-115390) 2024-02-25 20:21:10 -05:00
Erlend E. Aasland e74cd0f910
gh-115806: Make configure output more readable (#115807)
- make sure LDLIBRARY and HOSTRUNNER checks don't overlap
- make the ipv6 library check less subtle
2024-02-23 10:52:06 +01:00
Erlend E. Aasland baae73d730
gh-115765: Don't use deprecated AC_CHECK_TYPE macro in configure.ac (#115792)
Instead use AC_CHECK_TYPES.
2024-02-22 10:04:15 +01:00
Malcolm Smith 7f5e3f04f8
gh-111225: Link extension modules against libpython on Android (#115780)
Part of the work on PEP 738: Adding Android as a supported platform.

* Rename the LIBPYTHON variable to MODULE_LDFLAGS, to more accurately 
  reflect its purpose.
* Edit makesetup to use MODULE_LDFLAGS when linking extension modules.
* Edit the Makefile so that extension modules depend on libpython on 
  Android and Cygwin.
* Restore `-fPIC` on Android. It was removed several years ago with a 
  note that the toolchain used it automatically, but this is no longer
  the case. Omitting it causes all linker commands to fail with an error
  like `relocation R_AARCH64_ADR_PREL_PG_HI21 cannot be used against
  symbol '_Py_FalseStruct'; recompile with -fPIC`.
2024-02-21 23:18:57 +00:00
Russell Keith-Magee 2f0778675a
gh-114099: Refactor configure and Makefile to accomodate non-macOS frameworks (#115120)
Part of the PEP 730 work to add iOS support.

This change lays the groundwork for introducing iOS/tvOS/watchOS 
frameworks; it includes the structural refactoring needed so that iOS
branches can be added into in a subsequent PR.

Summary of changes:
* Updates config.sub to the 2024-01-01 release. This is the "as 
  released" version of config.sub.
* Adds a RESSRCDIR variable to allow sharing of macOS and iOS Makefile 
  steps.
* Adds an INSTALLTARGETS variable so platforms can customise which
  targets are actually installed. This will be used to exclude certain
  targets (e.g., binaries, manfiles) from iOS framework installs.
* Adds a PYTHONFRAMEWORKINSTALLNAMEPREFIX variable; this is used as
  the install name for the library. This is needed to allow for iOS
  frameworks to specify an @rpath-based install name.
* Evaluates MACHDEP earlier in the configure process so that
  ac_sys_system is available.
* Modifies _PYTHON_HOST_PLATFORM evaluation for cross-platform builds
  so that the CPU architecture is differentiated from the host
  identifier. This will be used to generate a _PYTHON_HOST_PLATFORM
  definition that includes ABI information, not just CPU architecture.
* Differentiates between SOABI_PLATFORM and PLATFORM_TRIPLET.
  SOABI_PLATFORM is used in binary module names, and includes the ABI,
  but not the OS or CPU architecture (e.g.,
  math.cpython-313-iphonesimulator.dylib). PLATFORM_TRIPLET is used
  as the sys._multiarch value, and on iOS will contains the ABI and
  architecture (e.g., iphoneos-arm64). This differentiation hasn't
  historically been needed because while macOS is a multiarch platform,
  it uses a bare darwin as PLATFORM_TRIPLE.
* Removes the use of the deprecated -Wl,-single_module flag when
  compiling macOS frameworks.
* Some whitespace normalisation where there was a mix of spaces and tabs 
  in a single block.
2024-02-13 00:10:24 +01:00
Brett Cannon c968dc7ff3
GH-113632: update configure.ac for WebAssembly support tiers (#115192)
Move WASI to tier 2 and drop Emscripten.
2024-02-09 09:21:49 +01:00
Zachary Ware 1032326fe4
gh-114883: Fix Makefile dependency tree for non-jit builds (GH-114884) 2024-02-03 23:16:03 +00:00
Malcolm Smith f35c7c070c
gh-114875: Require getgrent for building the grp extension module (#114876)
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
2024-02-03 00:30:52 +01:00