From 2dd18375866eb3ecef7da901569d2be1c8fa62b3 Mon Sep 17 00:00:00 2001 From: Andrei Tatar Date: Tue, 18 Jul 2023 22:22:33 +0200 Subject: [PATCH] Update to upstream Python 3.10.11 This change updates the unikraft port of python to 3.10, bringing patches, pyconfig.h and modules_config.c up to date. Signed-off-by: Andrei Tatar Reviewed-by: Maria Sfiraiala Reviewed-by: Stefan Jumarea Approved-by: Razvan Deaconescu Tested-by: Unikraft CI GitHub-Closes: #15 --- Config.uk | 19 +- Makefile.uk | 94 ++-- include/pyconfig.h | 485 ++++++++++++++---- main.c | 2 +- modules_config.c | 35 +- ...-Undefine-HAVE_FORK-and-HAVE_EXECVE.patch} | 23 +- ...ncio-Replace-unix-sockets-with-pipes.patch | 91 ++++ ...-compile-py-files-on-library-install.patch | 51 ++ ...thread_t-to-unsigned-long-conversion.patch | 40 -- ...t-compile-C-files-on-library-install.patch | 26 + patches/0003-Do-not-use-SOCK_CLOEXEC.patch | 31 -- 11 files changed, 650 insertions(+), 247 deletions(-) rename patches/{0001-Undefine-HAVE_FORK-and-HAVE_EXECVE.patch => 0000-Undefine-HAVE_FORK-and-HAVE_EXECVE.patch} (55%) create mode 100644 patches/0001-asyncio-Replace-unix-sockets-with-pipes.patch create mode 100644 patches/0002-Do-not-compile-py-files-on-library-install.patch delete mode 100644 patches/0002-Use-pthread_t-to-unsigned-long-conversion.patch create mode 100644 patches/0003-Do-not-compile-C-files-on-library-install.patch delete mode 100644 patches/0003-Do-not-use-SOCK_CLOEXEC.patch diff --git a/Config.uk b/Config.uk index d0786bd..a1a65d0 100644 --- a/Config.uk +++ b/Config.uk @@ -1,12 +1,12 @@ menuconfig LIBPYTHON3 bool "Python 3" default n - select LIBNEWLIBC - select LIBNEWLIBC_WANT_IO_C99_FORMATS if LIBNEWLIBC - select LIBNEWLIBC_LINUX_ERRNO_EXTENSIONS if LIBNEWLIBC + imply LIBMUSL + imply LIBCOMPILER_RT select LIBUKDEBUG select LIBUKALLOC select LIBUKSCHED + select LIBUKSIGNAL select LIBPOSIX_SYSINFO select LIBPOSIX_USER select LIBPOSIX_LIBDL @@ -15,20 +15,20 @@ menuconfig LIBPYTHON3 select LIBPTHREAD_EMBEDDED select LIBPOSIX_SOCKET select LIBPOSIX_EVENT - select LIBLWIP - select LWIP_DHCP - select LWIP_DNS - select LWIP_IPV6 + imply LIBLWIP + imply LWIP_DHCP + imply LWIP_DNS + imply LWIP_IPV6 if LIBPYTHON3 config LIBPYTHON3_PYTHONHOME string "Python home directory" - default "/lib/python3.7" + default "/lib/python3.10" config LIBPYTHON3_PYTHONPATH string "Python path" - default "/lib/python3.7" + default "/lib/python3.10" config LIBPYTHON3_TMPDIR string "Temp directory location" @@ -55,6 +55,7 @@ config LIBPYTHON3_EXTENSION_EXPAT if LIBFFI config LIBPYTHON3_EXTENSION_CTYPES bool "ctypes" + select LIBFFI_NO_TYPES default y endif config LIBPYTHON3_EXTENSION_LIBMPDEC diff --git a/Makefile.uk b/Makefile.uk index c25803f..1c84ef7 100644 --- a/Makefile.uk +++ b/Makefile.uk @@ -4,8 +4,10 @@ # # Authors: Vlad-Andrei Badoiu # Costin Lupu +# Andrei Tatar # # Copyright (c) 2019, University Politehnica of Bucharest. All rights reserved. +# Copyright (c) 2023, Unikraft GmbH and The Unikraft Authors. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -43,8 +45,8 @@ $(eval $(call addlib_s,libpython3_extensions,$(CONFIG_LIBPYTHON3))) ################################################################################ # Sources ################################################################################ -LIBPYTHON3_VERSION=3.7 -LIBPYTHON3_REVISION=4 +LIBPYTHON3_VERSION=3.10 +LIBPYTHON3_REVISION=11 LIBPYTHON3_VERSION_LONG=$(LIBPYTHON3_VERSION).$(LIBPYTHON3_REVISION) LIBPYTHON3_BASENAME=Python-$(LIBPYTHON3_VERSION_LONG) LIBPYTHON3_URL=https://www.python.org/ftp/python/$(LIBPYTHON3_VERSION_LONG)/$(LIBPYTHON3_BASENAME).tgz @@ -61,22 +63,34 @@ LIBPYTHON3_SRC = $(LIBPYTHON3_ORIGIN)/$(LIBPYTHON3_BASENAME) # Library includes ################################################################################ LIBPYTHON3_GLOBAL_INCLUDES-y += -I$(LIBPYTHON3_BASE)/include -LIBPYTHON3_GLOBAL_INCLUDES-y += -I$(LIBPYTHON3_SRC) LIBPYTHON3_GLOBAL_INCLUDES-y += -I$(LIBPYTHON3_SRC)/Include -CINCLUDES-y += $(LIBPYTHON3_GLOBAL_INCLUDES-y) -CXXINCLUDES-y += $(LIBPYTHON3_GLOBAL_INCLUDES-y) + +LIBPYTHON3_COMMON_INCLUDES-y += -I$(LIBPYTHON3_SRC) +LIBPYTHON3_COMMON_INCLUDES-y += -I$(LIBPYTHON3_SRC)/Include/internal + +CINCLUDES-$(CONFIG_LIBPYTHON3) += $(LIBPYTHON3_GLOBAL_INCLUDES-y) +CXXINCLUDES-$(CONFIG_LIBPYTHON3) += $(LIBPYTHON3_GLOBAL_INCLUDES-y) ################################################################################ # Common flags ################################################################################ # Suppress flags -LIBPYTHON3_SUPPRESS_FLAGS += -Wno-unused-parameter \ - -Wno-unused-variable -Wno-unused-value -Wno-unused-function \ - -Wno-missing-field-initializers -Wno-implicit-fallthrough \ - -Wno-cast-function-type -Wno-stringop-truncation \ - -Wno-char-subscripts -Wno-sign-compare -Wno-maybe-uninitialized -LIBPYTHON3_SUPRESS_CFLAGS-y += $(LIBPYTHON3_SUPPRESS_FLAGS) -Wno-pointer-to-int-cast -Wno-int-to-pointer-cast -LIBPYTHON3_SUPRESS_CXXFLAGS-y += $(LIBPYTHON3_SUPPRESS_FLAGS) +LIBPYTHON3_SUPPRESS_FLAGS-y += -Wno-unused-parameter +LIBPYTHON3_SUPPRESS_FLAGS-y += -Wno-unused-variable +LIBPYTHON3_SUPPRESS_FLAGS-y += -Wno-unused-value +LIBPYTHON3_SUPPRESS_FLAGS-y += -Wno-unused-function +LIBPYTHON3_SUPPRESS_FLAGS-y += -Wno-missing-field-initializers +LIBPYTHON3_SUPPRESS_FLAGS-y += -Wno-implicit-fallthrough +LIBPYTHON3_SUPPRESS_FLAGS-y += -Wno-char-subscripts +LIBPYTHON3_SUPPRESS_FLAGS-y += -Wno-sign-compare +LIBPYTHON3_SUPPRESS_FLAGS-$(call have_gcc) += -Wno-stringop-truncation +LIBPYTHON3_SUPPRESS_FLAGS-$(call have_gcc) += -Wno-maybe-uninitialized +LIBPYTHON3_SUPPRESS_FLAGS-$(call have_clang) += -Wno-documentation-unknown-command +LIBPYTHON3_SUPPRESS_FLAGS-$(call clang_version_ge,13,0) += -Wno-cast-function-type + +LIBPYTHON3_SUPRESS_CFLAGS-y += $(LIBPYTHON3_SUPPRESS_FLAGS-y) \ + -Wno-pointer-to-int-cast -Wno-int-to-pointer-cast +LIBPYTHON3_SUPRESS_CXXFLAGS-y += $(LIBPYTHON3_SUPPRESS_FLAGS-y) # Common flags LIBPYTHON3_COMMON_FLAGS-y += -fwrapv @@ -119,23 +133,13 @@ LIBPYTHON3_CORE_CXXFLAGS-y += $(LIBPYTHON3_CORE_DEFINES-y) #LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Programs/python.c -LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Parser/acceler.c -LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Parser/bitset.c -LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Parser/firstsets.c -LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Parser/grammar1.c -LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Parser/grammar.c -LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Parser/listnode.c -LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Parser/metagrammar.c LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Parser/myreadline.c -LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Parser/node.c LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Parser/parser.c -LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Parser/parsetok.c -#LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Parser/parsetok_pgen.c -LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Parser/pgen.c -#LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Parser/pgenmain.c -LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Parser/printgrammar.c +LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Parser/peg_api.c +LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Parser/pegen.c +LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Parser/string_parser.c +LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Parser/token.c LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Parser/tokenizer.c -#LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Parser/tokenizer_pgen.c LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Objects/abstract.c LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Objects/accu.c @@ -157,7 +161,9 @@ LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Objects/fileobject.c LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Objects/floatobject.c LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Objects/frameobject.c LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Objects/funcobject.c +LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Objects/genericaliasobject.c LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Objects/genobject.c +LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Objects/interpreteridobject.c LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Objects/iterobject.c LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Objects/listobject.c LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Objects/longobject.c @@ -168,6 +174,7 @@ LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Objects/namespaceobject.c LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Objects/object.c LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Objects/obmalloc.c LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Objects/odictobject.c +LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Objects/picklebufobject.c LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Objects/rangeobject.c LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Objects/setobject.c LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Objects/sliceobject.c @@ -176,6 +183,7 @@ LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Objects/tupleobject.c LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Objects/typeobject.c LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Objects/unicodectype.c LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Objects/unicodeobject.c +LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Objects/unionobject.c LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Objects/weakrefobject.c LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Python/asdl.c @@ -191,9 +199,10 @@ LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Python/context.c LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Python/dtoa.c #LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Python/dup2.c LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Python/dynamic_annotations.c -#LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Python/dynload_dl.c +#LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Python/dynload_hpux.c #LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Python/dynload_shlib.c LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Python/dynload_stub.c +#LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Python/dynload_win.c LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Python/errors.c LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Python/fileutils.c LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Python/formatter_unicode.c @@ -206,16 +215,18 @@ LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Python/getcopyright.c LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Python/getopt.c LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Python/getplatform.c LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Python/getversion.c -LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Python/graminit.c LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Python/hamt.c +LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Python/hashtable.c LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Python/import.c LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Python/importdl.c +LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Python/initconfig.c +LIBPYTHON3_CORE_INITCONFIG_FLAGS-y += -DPLATLIBDIR='"lib"' LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Python/marshal.c LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Python/modsupport.c LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Python/mysnprintf.c LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Python/mystrtoul.c LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Python/pathconfig.c -LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Python/peephole.c +LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Python/preconfig.c LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Python/pyarena.c LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Python/pyctype.c LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Python/pyfpe.c @@ -229,8 +240,8 @@ LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Python/pystrtod.c LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Python/Python-ast.c LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Python/pythonrun.c LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Python/pytime.c -#LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Python/strdup.c LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Python/structmember.c +LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Python/suggestions.c LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Python/symtable.c LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Python/sysmodule.c LIBPYTHON3_CORE_SYSMODULE_FLAGS-y += -DABIFLAGS='"m"' -DMULTIARCH=\"x86_64-linux-gnu\" @@ -253,7 +264,6 @@ LIBPYTHON3_CORE_GETPATH_FLAGS-y += -DPYTHONPATH='"/lib/python$(LIBPYTHON3_VERSIO -DEXEC_PREFIX='""' \ -DVERSION='"$(LIBPYTHON3_VERSION)"' \ -DVPATH='""' -LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Modules/hashtable.c LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_io/bufferedio.c LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_io/bytesio.c LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_io/fileio.c @@ -277,7 +287,6 @@ LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Modules/timemodule.c LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_tracemalloc.c LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_weakref.c LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Modules/xxsubtype.c -LIBPYTHON3_CORE_SRCS-y += $(LIBPYTHON3_SRC)/Modules/zipimport.c ################################################################################ # Python extensions @@ -296,6 +305,7 @@ LIBPYTHON3_EXTENSIONS_DEFINES-y += $(LIBPYTHON3_COMMON_DEFINES-y) -DPy_BUILD_EX LIBPYTHON3_EXTENSIONS_CFLAGS-y += $(LIBPYTHON3_EXTENSIONS_DEFINES-y) LIBPYTHON3_EXTENSIONS_CXXFLAGS-y += $(LIBPYTHON3_EXTENSIONS_DEFINES-y) +LIBPYTHON3_EXTENSIONS_CFLAGS-y += -DPy_BUILD_CORE -DPy_BUILD_CORE_MODULE LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/arraymodule.c LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_asynciomodule.c # Audio: LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/audioop.c @@ -351,16 +361,27 @@ LIBPYTHON3_EXTENSIONS_CINCLUDES-y += -I$(LIBPYTHON3_SRC)/Modules/_decimal/libmpd LIBPYTHON3_EXTENSIONS_CFLAGS-y += -DCONFIG_64 -DANSI LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_decimal/_decimal.c LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_decimal/libmpdec/basearith.c +#LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_decimal/libmpdec/bench.c +#LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_decimal/libmpdec/bench_full.c LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_decimal/libmpdec/constants.c LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_decimal/libmpdec/context.c LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_decimal/libmpdec/convolute.c LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_decimal/libmpdec/crt.c LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_decimal/libmpdec/difradix2.c +#LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_decimal/libmpdec/examples/compare.c +#LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_decimal/libmpdec/examples/div.c +#LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_decimal/libmpdec/examples/divmod.c +#LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_decimal/libmpdec/examples/multiply.c +#LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_decimal/libmpdec/examples/pow.c +#LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_decimal/libmpdec/examples/powmod.c +#LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_decimal/libmpdec/examples/shift.c +#LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_decimal/libmpdec/examples/sqrt.c LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_decimal/libmpdec/fnt.c LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_decimal/libmpdec/fourstep.c LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_decimal/libmpdec/io.c -LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_decimal/libmpdec/memory.c +LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_decimal/libmpdec/mpalloc.c LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_decimal/libmpdec/mpdecimal.c +LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_decimal/libmpdec/mpsignal.c LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_decimal/libmpdec/numbertheory.c LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_decimal/libmpdec/sixstep.c LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_decimal/libmpdec/transpose.c @@ -369,7 +390,6 @@ ifeq ($(CONFIG_LIBPYTHON3_EXTENSION_EXPAT),y) LIBPYTHON3_EXTENSIONS_CINCLUDES-y += -I$(LIBPYTHON3_SRC)/Modules/expat LIBPYTHON3_EXTENSIONS_CFLAGS-y += -DHAVE_EXPAT_CONFIG_H=1 -DXML_POOR_ENTROPY=1 -DUSE_PYEXPAT_CAPI LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_elementtree.c -LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/expat/loadlibrary.c LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/expat/xmlparse.c LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/expat/xmlrole.c LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/expat/xmltok.c @@ -391,12 +411,12 @@ LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/mathmodule.c LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/md5module.c # TODO enable LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/mmapmodule.c #LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_multiprocessing/multiprocessing.c +LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_multiprocessing/posixshmem.c #LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_multiprocessing/semaphore.c #LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/nismodule.c LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_opcode.c # Audio: LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/ossaudiodev.c # Windows: LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/overlapped.c -LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/parsermodule.c LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_pickle.c LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_posixsubprocess.c LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_queuemodule.c @@ -435,12 +455,15 @@ LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_sqlite/statement.c LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_sqlite/util.c|sqlite endif LIBPYTHON3_EXTENSIONS_SRCS-$(CONFIG_LIBPYTHON3_EXTENSION_SSL) += $(LIBPYTHON3_SRC)/Modules/_ssl.c +LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_statisticsmodule.c LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_struct.c LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/syslogmodule.c #LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/termios.c LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_testbuffer.c LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_testcapimodule.c +LIBPYTHON3_EXTENSIONS__TESTCAPIMODULE_FLAGS-y += -UPy_BUILD_CORE -UPy_BUILD_CORE_MODULE LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_testimportmultiple.c +LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_testinternalcapi.c LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_testmultiphase.c #LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/tkappinit.c #LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_tkinter.c @@ -452,6 +475,7 @@ LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/xxmodule.c LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_xxtestfuzz/fuzzer.c LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_xxtestfuzz/_xxtestfuzz.c LIBPYTHON3_EXTENSIONS_SRCS-$(CONFIG_LIBPYTHON3_EXTENSION_ZLIB) += $(LIBPYTHON3_SRC)/Modules/zlibmodule.c +LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_zoneinfo.c #LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Misc/coverity_model.c diff --git a/include/pyconfig.h b/include/pyconfig.h index 359f314..868c3b5 100644 --- a/include/pyconfig.h +++ b/include/pyconfig.h @@ -1,6 +1,9 @@ /* pyconfig.h. Generated from pyconfig.h.in by configure. */ /* pyconfig.h.in. Generated from configure.ac by autoheader. */ - +/* Modified by hand for compatibility with Unikraft; entries marked + * 'UNIKRAFT' are purposely different from autoconfigured values. + * When updating, take care to integrate and verify new flags. + */ #ifndef Py_PYCONFIG_H #define Py_PYCONFIG_H @@ -10,10 +13,24 @@ /* Define if building universal (internal helper macro) */ /* #undef AC_APPLE_UNIVERSAL_BUILD */ +/* BUILD_GNU_TYPE + AIX_BUILDDATE are used to construct the PEP425 tag of the + build system. */ +/* #undef AIX_BUILDDATE */ + /* Define for AIX if your compiler is a genuine IBM xlC/xlC_r and you want support for AIX C++ shared extension modules. */ /* #undef AIX_GENUINE_CPLUSPLUS */ +/* The normal alignment of `long', in bytes. */ +#define ALIGNOF_LONG 8 + +/* The normal alignment of `size_t', in bytes. */ +#define ALIGNOF_SIZE_T 8 + +/* Alternative SOABI used in debug build to load C extensions built in release + mode */ +/* #undef ALT_SOABI */ + /* The Android API level. */ /* #undef ANDROID_API_LEVEL */ @@ -32,18 +49,21 @@ /* Define if --enable-ipv6 is specified */ #define ENABLE_IPV6 1 +/* Better isolate subinterpreters, experimental build mode. */ +/* #undef EXPERIMENTAL_ISOLATED_SUBINTERPRETERS */ + +/* Define to 1 if your system stores words within floats with the most + significant word first */ +/* #undef FLOAT_WORDS_BIGENDIAN */ + /* Define if flock needs to be linked with bsd library. */ /* #undef FLOCK_NEEDS_LIBBSD */ /* Define if getpgrp() must be called as getpgrp(0). */ /* #undef GETPGRP_HAVE_ARG */ -/* Define if gettimeofday() does not have second (timezone) argument This is - the case on Motorola V4 (R40V4.2) */ -/* #undef GETTIMEOFDAY_NO_TZ */ - /* Define to 1 if you have the `accept4' function. */ -/* #define HAVE_ACCEPT4 1 */ +#define HAVE_ACCEPT4 1 /* Define to 1 if you have the `acosh' function. */ #define HAVE_ACOSH 1 @@ -106,7 +126,7 @@ /* Define if `unsetenv` does not return an int. */ /* #undef HAVE_BROKEN_UNSETENV */ -/* Has builtin atomics */ +/* Has builtin __atomic_load_n() and __atomic_store_n() functions */ #define HAVE_BUILTIN_ATOMIC 1 /* Define to 1 if you have the 'chflags' function. */ @@ -116,13 +136,14 @@ #define HAVE_CHOWN 1 /* Define if you have the 'chroot' function. */ +/*UNIKRAFT*/ /* #define HAVE_CHROOT 1 */ /* Define to 1 if you have the `clock' function. */ #define HAVE_CLOCK 1 /* Define to 1 if you have the `clock_getres' function. */ -/* #define HAVE_CLOCK_GETRES 1 */ +#define HAVE_CLOCK_GETRES 1 /* Define to 1 if you have the `clock_gettime' function. */ #define HAVE_CLOCK_GETTIME 1 @@ -130,6 +151,10 @@ /* Define to 1 if you have the `clock_settime' function. */ #define HAVE_CLOCK_SETTIME 1 +/* Define to 1 if you have the `close_range' function. */ +/*UNIKRAFT*/ +/* #define HAVE_CLOSE_RANGE 1 */ + /* Define if the C compiler supports computed gotos. */ #define HAVE_COMPUTED_GOTOS 1 @@ -142,8 +167,15 @@ /* Define to 1 if you have the `copysign' function. */ #define HAVE_COPYSIGN 1 +/* Define to 1 if you have the `copy_file_range' function. */ +/*UNIKRAFT*/ +/* #define HAVE_COPY_FILE_RANGE 1 */ + /* Define to 1 if you have the header file. */ -/* #define HAVE_CRYPT_H 1 */ +/*UNIKRAFT*/ +#if CONFIG_LIBMUSL +#define HAVE_CRYPT_H 1 +#endif /* Define if you have the crypt_r() function. */ #define HAVE_CRYPT_R 1 @@ -204,6 +236,7 @@ /* Define to 1 if you have the declaration of `RTLD_DEEPBIND', and to 0 if you don't. */ +/*UNIKRAFT*/ #define HAVE_DECL_RTLD_DEEPBIND 0 /* Define to 1 if you have the declaration of `RTLD_GLOBAL', and to 0 if you @@ -272,17 +305,21 @@ /* Define to 1 if you have the `dup3' function. */ #define HAVE_DUP3 1 +/* Define if you have the '_dyld_shared_cache_contains_path' function. */ +/* #undef HAVE_DYLD_SHARED_CACHE_CONTAINS_PATH */ + /* Defined when any dynamic module loading is enabled. */ +/*UNIKRAFT*/ /* #define HAVE_DYNAMIC_LOADING 1 */ /* Define to 1 if you have the header file. */ #define HAVE_ENDIAN_H 1 /* Define if you have the 'epoll' functions. */ -//#define HAVE_EPOLL 1 +#define HAVE_EPOLL 1 /* Define if you have the 'epoll_create1' function. */ -//#define HAVE_EPOLL_CREATE1 1 +#define HAVE_EPOLL_CREATE1 1 /* Define to 1 if you have the `erf' function. */ #define HAVE_ERF 1 @@ -293,8 +330,18 @@ /* Define to 1 if you have the header file. */ #define HAVE_ERRNO_H 1 +/* Define if you have the 'eventfd' function. */ +#define HAVE_EVENTFD 1 + /* Define to 1 if you have the `execv' function. */ -//#define HAVE_EXECV 1 +/*UNIKRAFT*/ +/* #define HAVE_EXECV 1 */ + +/* Define to 1 if you have the `explicit_bzero' function. */ +#define HAVE_EXPLICIT_BZERO 1 + +/* Define to 1 if you have the `explicit_memset' function. */ +/* #undef HAVE_EXPLICIT_MEMSET */ /* Define to 1 if you have the `expm1' function. */ #define HAVE_EXPM1 1 @@ -309,12 +356,14 @@ #define HAVE_FCHMOD 1 /* Define to 1 if you have the `fchmodat' function. */ +/*UNIKRAFT*/ /* #define HAVE_FCHMODAT 1 */ /* Define to 1 if you have the `fchown' function. */ #define HAVE_FCHOWN 1 /* Define to 1 if you have the `fchownat' function. */ +/*UNIKRAFT*/ /* #define HAVE_FCHOWNAT 1 */ /* Define to 1 if you have the header file. */ @@ -326,19 +375,25 @@ /* Define to 1 if you have the `fdopendir' function. */ #define HAVE_FDOPENDIR 1 +/* Define to 1 if you have the `fdwalk' function. */ +/* #undef HAVE_FDWALK */ + /* Define to 1 if you have the `fexecve' function. */ +/*UNIKRAFT*/ /*#define HAVE_FEXECVE 1 */ /* Define to 1 if you have the `finite' function. */ #define HAVE_FINITE 1 /* Define to 1 if you have the `flock' function. */ -/* #define HAVE_FLOCK 1 */ +#define HAVE_FLOCK 1 /* Define to 1 if you have the `fork' function. */ +/*UNIKRAFT*/ /* #define HAVE_FORK 1 */ /* Define to 1 if you have the `forkpty' function. */ +/*UNIKRAFT*/ /* #define HAVE_FORKPTY 1 */ /* Define to 1 if you have the `fpathconf' function. */ @@ -372,13 +427,13 @@ #define HAVE_FTRUNCATE 1 /* Define to 1 if you have the `futimens' function. */ -/* #define HAVE_FUTIMENS 1 */ +#define HAVE_FUTIMENS 1 /* Define to 1 if you have the `futimes' function. */ -/* #define HAVE_FUTIMES 1 */ +#define HAVE_FUTIMES 1 /* Define to 1 if you have the `futimesat' function. */ -/* #define HAVE_FUTIMESAT 1 */ +#define HAVE_FUTIMESAT 1 /* Define to 1 if you have the `gai_strerror' function. */ #define HAVE_GAI_STRERROR 1 @@ -390,7 +445,7 @@ /* #undef HAVE_GCC_ASM_FOR_MC68881 */ /* Define if we can use x64 gcc inline assembler */ - +/*UNIKRAFT*/ #if defined(__x86_64__) #define HAVE_GCC_ASM_FOR_X64 1 #endif @@ -409,13 +464,19 @@ #define HAVE_GETADDRINFO 1 /* Define this if you have flockfile(), getc_unlocked(), and funlockfile() */ -/* #define HAVE_GETC_UNLOCKED 1 */ +#define HAVE_GETC_UNLOCKED 1 /* Define to 1 if you have the `getentropy' function. */ -/* #define HAVE_GETENTROPY 1 */ +#define HAVE_GETENTROPY 1 + +/* Define to 1 if you have the `getgrgid_r' function. */ +#define HAVE_GETGRGID_R 1 + +/* Define to 1 if you have the `getgrnam_r' function. */ +#define HAVE_GETGRNAM_R 1 /* Define to 1 if you have the `getgrouplist' function. */ -/* #define HAVE_GETGROUPLIST 1 */ +#define HAVE_GETGROUPLIST 1 /* Define to 1 if you have the `getgroups' function. */ #define HAVE_GETGROUPS 1 @@ -436,9 +497,11 @@ #define HAVE_GETHOSTBYNAME_R_6_ARG 1 /* Define to 1 if you have the `getitimer' function. */ +/*UNIKRAFT*/ /* #define HAVE_GETITIMER 1 */ /* Define to 1 if you have the `getloadavg' function. */ +/*UNIKRAFT*/ /* #define HAVE_GETLOADAVG 1 */ /* Define to 1 if you have the `getlogin' function. */ @@ -457,21 +520,28 @@ #define HAVE_GETPGID 1 /* Define to 1 if you have the `getpgrp' function. */ -/* #define HAVE_GETPGRP 1 */ +#define HAVE_GETPGRP 1 /* Define to 1 if you have the `getpid' function. */ #define HAVE_GETPID 1 /* Define to 1 if you have the `getpriority' function. */ -/* #define HAVE_GETPRIORITY 1 */ +#define HAVE_GETPRIORITY 1 /* Define to 1 if you have the `getpwent' function. */ #define HAVE_GETPWENT 1 +/* Define to 1 if you have the `getpwnam_r' function. */ +#define HAVE_GETPWNAM_R 1 + +/* Define to 1 if you have the `getpwuid_r' function. */ +#define HAVE_GETPWUID_R 1 + /* Define to 1 if the getrandom() function is available */ #define HAVE_GETRANDOM 1 /* Define to 1 if the Linux getrandom() syscall is available */ +/*UNIKRAFT*/ /* #define HAVE_GETRANDOM_SYSCALL 1 */ /* Define to 1 if you have the `getresgid' function. */ @@ -489,9 +559,6 @@ /* Define to 1 if you have the `getspnam' function. */ #define HAVE_GETSPNAM 1 -/* Define to 1 if you have the `gettimeofday' function. */ -#define HAVE_GETTIMEOFDAY 1 - /* Define to 1 if you have the `getwd' function. */ #define HAVE_GETWD 1 @@ -503,7 +570,10 @@ #define HAVE_GRP_H 1 /* Define if you have the 'hstrerror' function. */ -/* #define HAVE_HSTRERROR 1 */ +/*UNIKRAFT*/ +#if CONFIG_LIBMUSL +#define HAVE_HSTRERROR 1 +#endif /* Define this if you have le64toh() */ #define HAVE_HTOLE64 1 @@ -515,7 +585,10 @@ /* #undef HAVE_IEEEFP_H */ /* Define to 1 if you have the `if_nameindex' function. */ -//#define HAVE_IF_NAMEINDEX 1 +/*UNIKRAFT*/ +#if CONFIG_LIBMUSL +#define HAVE_IF_NAMEINDEX 1 +#endif /* Define if you have the 'inet_aton' function. */ #define HAVE_INET_ATON 1 @@ -548,9 +621,9 @@ #define HAVE_LANGINFO_H 1 /* Defined to enable large file support when an off_t is bigger than a long - and long long is available and at least as big as an off_t. You may need to - add some flags for configuration and compilation to enable this mode. (For - Solaris and Linux, the necessary defines are already defined.) */ + and long long is at least as big as an off_t. You may need to add some + flags for configuration and compilation to enable this mode. (For Solaris + and Linux, the necessary defines are already defined.) */ /* #undef HAVE_LARGEFILE_SUPPORT */ /* Define to 1 if you have the 'lchflags' function. */ @@ -575,9 +648,12 @@ /* #undef HAVE_LIBIEEE */ /* Define to 1 if you have the header file. */ -/* #define HAVE_LIBINTL_H 1 */ +/*UNIKRAFT*/ +#if CONFIG_LIBMUSL +#define HAVE_LIBINTL_H 1 +#endif -/* Define if you have the readline library (-lreadline). */ +/* Define to build the readline module. */ /* #undef HAVE_LIBREADLINE */ /* Define to 1 if you have the `resolv' library (-lresolv). */ @@ -589,38 +665,74 @@ /* Define to 1 if you have the header file. */ /* #undef HAVE_LIBUTIL_H */ +/* Define to 1 if you have the `uuid' library (-luuid). */ +/* #undef HAVE_LIBUUID */ + /* Define if you have the 'link' function. */ #define HAVE_LINK 1 /* Define to 1 if you have the `linkat' function. */ +/*UNIKRAFT*/ /* #define HAVE_LINKAT 1 */ +/* Define to 1 if you have the header file. */ +/*UNIKRAFT*/ +/* #define HAVE_LINUX_AUXVEC_H 1 */ + /* Define to 1 if you have the header file. */ -//#define HAVE_LINUX_CAN_BCM_H 1 +/*UNIKRAFT*/ +/* #define HAVE_LINUX_CAN_BCM_H 1 */ /* Define to 1 if you have the header file. */ -//#define HAVE_LINUX_CAN_H 1 +/*UNIKRAFT*/ +/* #define HAVE_LINUX_CAN_H 1 */ + +/* Define to 1 if you have the header file. */ +/*UNIKRAFT*/ +/* #define HAVE_LINUX_CAN_J1939_H 1 */ /* Define if compiling using Linux 3.6 or later. */ -//#define HAVE_LINUX_CAN_RAW_FD_FRAMES 1 +/*UNIKRAFT*/ +/* #define HAVE_LINUX_CAN_RAW_FD_FRAMES 1 */ /* Define to 1 if you have the header file. */ -//#define HAVE_LINUX_CAN_RAW_H 1 +/*UNIKRAFT*/ +/* #define HAVE_LINUX_CAN_RAW_H 1 */ + +/* Define if compiling using Linux 4.1 or later. */ +/*UNIKRAFT*/ +/* #define HAVE_LINUX_CAN_RAW_JOIN_FILTERS 1 */ + +/* Define to 1 if you have the header file. */ +/*UNIKRAFT*/ +/* #define HAVE_LINUX_MEMFD_H 1 */ /* Define to 1 if you have the header file. */ -//#define HAVE_LINUX_NETLINK_H 1 +/*UNIKRAFT*/ +/* #define HAVE_LINUX_NETLINK_H 1 */ + +/* Define to 1 if you have the header file. */ +/*UNIKRAFT*/ +/* #define HAVE_LINUX_QRTR_H 1 */ /* Define to 1 if you have the header file. */ +/*UNIKRAFT*/ /* #define HAVE_LINUX_RANDOM_H 1 */ /* Define to 1 if you have the header file. */ -//#define HAVE_LINUX_TIPC_H 1 +/*UNIKRAFT*/ +/* #define HAVE_LINUX_TIPC_H 1 */ /* Define to 1 if you have the header file. */ -//#define HAVE_LINUX_VM_SOCKETS_H 1 +/*UNIKRAFT*/ +/* #define HAVE_LINUX_VM_SOCKETS_H 1 */ + +/* Define to 1 if you have the header file. */ +/*UNIKRAFT*/ +/* #define HAVE_LINUX_WAIT_H 1 */ /* Define to 1 if you have the `lockf' function. */ -/* #define HAVE_LOCKF 1 */ +#define HAVE_LOCKF 1 /* Define to 1 if you have the `log1p' function. */ #define HAVE_LOG1P 1 @@ -628,14 +740,18 @@ /* Define to 1 if you have the `log2' function. */ #define HAVE_LOG2 1 -/* Define this if you have the type long double. */ +/* Define to 1 if the system has the type `long double'. */ #define HAVE_LONG_DOUBLE 1 /* Define to 1 if you have the `lstat' function. */ #define HAVE_LSTAT 1 /* Define to 1 if you have the `lutimes' function. */ -/* #define HAVE_LUTIMES 1 */ +#define HAVE_LUTIMES 1 + +/* Define to 1 if you have the `madvise' function. */ +/*UNIKRAFT*/ +/* #define HAVE_MADVISE 1 */ /* Define this if you have the makedev macro. */ #define HAVE_MAKEDEV 1 @@ -643,6 +759,10 @@ /* Define to 1 if you have the `mbrtowc' function. */ #define HAVE_MBRTOWC 1 +/* Define if you have the 'memfd_create' function. */ +/*UNIKRAFT*/ +/* #define HAVE_MEMFD_CREATE 1 */ + /* Define to 1 if you have the header file. */ #define HAVE_MEMORY_H 1 @@ -650,27 +770,30 @@ #define HAVE_MEMRCHR 1 /* Define to 1 if you have the `mkdirat' function. */ -/* #define HAVE_MKDIRAT 1 */ +#define HAVE_MKDIRAT 1 /* Define to 1 if you have the `mkfifo' function. */ +/*UNIKRAFT*/ /* #define HAVE_MKFIFO 1 */ /* Define to 1 if you have the `mkfifoat' function. */ +/*UNIKRAFT*/ /* #define HAVE_MKFIFOAT 1 */ /* Define to 1 if you have the `mknod' function. */ #define HAVE_MKNOD 1 /* Define to 1 if you have the `mknodat' function. */ -/* #define HAVE_MKNODAT 1 */ +#define HAVE_MKNODAT 1 /* Define to 1 if you have the `mktime' function. */ #define HAVE_MKTIME 1 /* Define to 1 if you have the `mmap' function. */ -/* #define HAVE_MMAP 1 */ +#define HAVE_MMAP 1 /* Define to 1 if you have the `mremap' function. */ +/*UNIKRAFT*/ /* #define HAVE_MREMAP 1 */ /* Define to 1 if you have the header file. */ @@ -680,7 +803,10 @@ /* #undef HAVE_NDIR_H */ /* Define to 1 if you have the header file. */ -//#define HAVE_NETPACKET_PACKET_H 1 +/*UNIKRAFT*/ +#if CONFIG_LIBMUSL +#define HAVE_NETPACKET_PACKET_H 1 +#endif /* Define to 1 if you have the header file. */ #define HAVE_NET_IF_H 1 @@ -688,6 +814,10 @@ /* Define to 1 if you have the `nice' function. */ #define HAVE_NICE 1 +/* Define if the internal form of wchar_t in non-Unicode locales is not + Unicode. */ +/* #undef HAVE_NON_UNICODE_WCHAR_T_REPRESENTATION */ + /* Define to 1 if you have the `openat' function. */ #define HAVE_OPENAT 1 @@ -701,25 +831,36 @@ #define HAVE_PAUSE 1 /* Define to 1 if you have the `pipe2' function. */ -/* #define HAVE_PIPE2 1 */ +#define HAVE_PIPE2 1 /* Define to 1 if you have the `plock' function. */ /* #undef HAVE_PLOCK */ /* Define to 1 if you have the `poll' function. */ -//#define HAVE_POLL 1 +#define HAVE_POLL 1 /* Define to 1 if you have the header file. */ -//#define HAVE_POLL_H 1 +#define HAVE_POLL_H 1 /* Define to 1 if you have the `posix_fadvise' function. */ -/* #define HAVE_POSIX_FADVISE 1 */ +/*UNIKRAFT*/ +#if CONFIG_LIBMUSL +#define HAVE_POSIX_FADVISE 1 +#endif /* Define to 1 if you have the `posix_fallocate' function. */ -/* #define HAVE_POSIX_FALLOCATE 1 */ +/*UNIKRAFT*/ +#if CONFIG_LIBMUSL +#define HAVE_POSIX_FALLOCATE 1 +#endif /* Define to 1 if you have the `posix_spawn' function. */ -#define HAVE_POSIX_SPAWN 1 +/*UNIKRAFT*/ +/* #define HAVE_POSIX_SPAWN 1 */ + +/* Define to 1 if you have the `posix_spawnp' function. */ +/*UNIKRAFT*/ +/* #define HAVE_POSIX_SPAWNP 1 */ /* Define to 1 if you have the `pread' function. */ #define HAVE_PREAD 1 @@ -728,10 +869,11 @@ #define HAVE_PREADV 1 /* Define to 1 if you have the `preadv2' function. */ +/*UNIKRAFT*/ /* #define HAVE_PREADV2 1 */ /* Define if you have the 'prlimit' functions. */ -/* #define HAVE_PRLIMIT 1 */ +#define HAVE_PRLIMIT 1 /* Define to 1 if you have the header file. */ /* #undef HAVE_PROCESS_H */ @@ -739,11 +881,20 @@ /* Define if your compiler supports function prototype */ #define HAVE_PROTOTYPES 1 +/* Define to 1 if you have the `pthread_condattr_setclock' function. */ +/*UNIKRAFT*/ +#if CONFIG_LIBMUSL +#define HAVE_PTHREAD_CONDATTR_SETCLOCK 1 +#endif + /* Defined for Solaris 2.6 bug in pthread header. */ /* #undef HAVE_PTHREAD_DESTRUCTOR */ /* Define to 1 if you have the `pthread_getcpuclockid' function. */ -/* #define HAVE_PTHREAD_GETCPUCLOCKID 1 */ +/*UNIKRAFT*/ +#if CONFIG_LIBMUSL +#define HAVE_PTHREAD_GETCPUCLOCKID 1 +#endif /* Define to 1 if you have the header file. */ #define HAVE_PTHREAD_H 1 @@ -752,17 +903,20 @@ /* #undef HAVE_PTHREAD_INIT */ /* Define to 1 if you have the `pthread_kill' function. */ -/* #define HAVE_PTHREAD_KILL 1 TODO */ +/*UNIKRAFT*/ +#if CONFIG_LIBMUSL +#define HAVE_PTHREAD_KILL 1 +#endif /* Define to 1 if you have the `pthread_sigmask' function. */ -/* #define HAVE_PTHREAD_SIGMASK 1 */ +/*UNIKRAFT*/ +#if CONFIG_LIBMUSL +#define HAVE_PTHREAD_SIGMASK 1 +#endif /* Define to 1 if you have the header file. */ #define HAVE_PTY_H 1 -/* Define to 1 if you have the `putenv' function. */ -#define HAVE_PUTENV 1 - /* Define to 1 if you have the `pwrite' function. */ #define HAVE_PWRITE 1 @@ -770,21 +924,27 @@ #define HAVE_PWRITEV 1 /* Define to 1 if you have the `pwritev2' function. */ +/*UNIKRAFT*/ /* #define HAVE_PWRITEV2 1 */ /* Define to 1 if you have the `readlink' function. */ #define HAVE_READLINK 1 /* Define to 1 if you have the `readlinkat' function. */ +/*UNIKRAFT*/ /* #define HAVE_READLINKAT 1 */ /* Define to 1 if you have the `readv' function. */ #define HAVE_READV 1 /* Define to 1 if you have the `realpath' function. */ -/* #define HAVE_REALPATH 1 */ +/*UNIKRAFT*/ +#if CONFIG_LIBMUSL +#define HAVE_REALPATH 1 +#endif /* Define to 1 if you have the `renameat' function. */ +/*UNIKRAFT*/ /* #define HAVE_RENAMEAT 1 */ /* Define if readline supports append_history */ @@ -814,6 +974,9 @@ /* Define to 1 if you have the `round' function. */ #define HAVE_ROUND 1 +/* Define to 1 if you have the `rtpSpawn' function. */ +/* #undef HAVE_RTPSPAWN */ + /* Define to 1 if you have the `sched_get_priority_max' function. */ #define HAVE_SCHED_GET_PRIORITY_MAX 1 @@ -827,25 +990,43 @@ #define HAVE_SCHED_SETAFFINITY 1 /* Define to 1 if you have the `sched_setparam' function. */ +/*UNIKRAFT*/ /* #define HAVE_SCHED_SETPARAM 1 */ /* Define to 1 if you have the `sched_setscheduler' function. */ +/*UNIKRAFT*/ /* #define HAVE_SCHED_SETSCHEDULER 1 */ +/* Define to 1 if you have the `sem_clockwait' function. */ +/*UNIKRAFT*/ +/* #define HAVE_SEM_CLOCKWAIT 1 */ + /* Define to 1 if you have the `sem_getvalue' function. */ +/*UNIKRAFT*/ +#if CONFIG_LIBMUSL #define HAVE_SEM_GETVALUE 1 +#endif /* Define to 1 if you have the `sem_open' function. */ +/*UNIKRAFT*/ +#if CONFIG_LIBMUSL #define HAVE_SEM_OPEN 1 +#endif /* Define to 1 if you have the `sem_timedwait' function. */ +/*UNIKRAFT*/ +#if CONFIG_LIBMUSL #define HAVE_SEM_TIMEDWAIT 1 +#endif /* Define to 1 if you have the `sem_unlink' function. */ +/*UNIKRAFT*/ +#if CONFIG_LIBMUSL #define HAVE_SEM_UNLINK 1 +#endif /* Define to 1 if you have the `sendfile' function. */ -/* #define HAVE_SENDFILE 1 */ +#define HAVE_SENDFILE 1 /* Define to 1 if you have the `setegid' function. */ #define HAVE_SETEGID 1 @@ -863,6 +1044,7 @@ #define HAVE_SETHOSTNAME 1 /* Define to 1 if you have the `setitimer' function. */ +/*UNIKRAFT*/ /* #define HAVE_SETITIMER 1 */ /* Define to 1 if you have the `setlocale' function. */ @@ -875,12 +1057,14 @@ #define HAVE_SETPGRP 1 /* Define to 1 if you have the `setpriority' function. */ +/*UNIKRAFT*/ /* #define HAVE_SETPRIORITY 1 */ /* Define to 1 if you have the `setregid' function. */ #define HAVE_SETREGID 1 /* Define to 1 if you have the `setresgid' function. */ +/*UNIKRAFT*/ /* #define HAVE_SETRESGID 1 */ /* Define to 1 if you have the `setresuid' function. */ @@ -901,41 +1085,82 @@ /* Define to 1 if you have the header file. */ #define HAVE_SHADOW_H 1 +/* Define to 1 if you have the `shm_open' function. */ +/*UNIKRAFT*/ +#if CONFIG_LIBMUSL +#define HAVE_SHM_OPEN 1 +#endif + +/* Define to 1 if you have the `shm_unlink' function. */ +/*UNIKRAFT*/ +#if CONFIG_LIBMUSL +#define HAVE_SHM_UNLINK 1 +#endif + /* Define to 1 if you have the `sigaction' function. */ -//#define HAVE_SIGACTION 1 +/*UNIKRAFT*/ +#define HAVE_SIGACTION 1 /* Define to 1 if you have the `sigaltstack' function. */ -//#define HAVE_SIGALTSTACK 1 +/*UNIKRAFT*/ +#if CONFIG_LIBMUSL +#define HAVE_SIGALTSTACK 1 +#endif + +/* Define to 1 if you have the `sigfillset' function. */ +#define HAVE_SIGFILLSET 1 /* Define to 1 if `si_band' is a member of `siginfo_t'. */ -//#define HAVE_SIGINFO_T_SI_BAND 1 +/*UNIKRAFT*/ +#if CONFIG_LIBMUSL +#define HAVE_SIGINFO_T_SI_BAND 1 +#endif /* Define to 1 if you have the `siginterrupt' function. */ -//#define HAVE_SIGINTERRUPT 1 +/*UNIKRAFT*/ +#if CONFIG_LIBMUSL +#define HAVE_SIGINTERRUPT 1 +#endif /* Define to 1 if you have the header file. */ #define HAVE_SIGNAL_H 1 /* Define to 1 if you have the `sigpending' function. */ -/* #define HAVE_SIGPENDING 1 */ // TODO +/*UNIKRAFT*/ +#if CONFIG_LIBMUSL +#define HAVE_SIGPENDING 1 +#endif /* Define to 1 if you have the `sigrelse' function. */ -/* #define HAVE_SIGRELSE 1 */ //TODO +/*UNIKRAFT*/ +#if CONFIG_LIBMUSL +#define HAVE_SIGRELSE 1 +#endif /* Define to 1 if you have the `sigtimedwait' function. */ -/* #define HAVE_SIGTIMEDWAIT 1 */// todo +/*UNIKRAFT*/ +#if CONFIG_LIBMUSL +#define HAVE_SIGTIMEDWAIT 1 +#endif /* Define to 1 if you have the `sigwait' function. */ -//#define HAVE_SIGWAIT 1 +/*UNIKRAFT*/ +#if CONFIG_LIBMUSL +#define HAVE_SIGWAIT 1 +#endif /* Define to 1 if you have the `sigwaitinfo' function. */ -//#define HAVE_SIGWAITINFO 1 +/*UNIKRAFT*/ +#if CONFIG_LIBMUSL +#define HAVE_SIGWAITINFO 1 +#endif /* Define to 1 if you have the `snprintf' function. */ -//#define HAVE_SNPRINTF 1 +#define HAVE_SNPRINTF 1 /* struct sockaddr_alg (linux/if_alg.h) */ -//#define HAVE_SOCKADDR_ALG 1 +/*UNIKRAFT*/ +/* #define HAVE_SOCKADDR_ALG 1 */ /* Define if sockaddr has sa_len member */ /* #undef HAVE_SOCKADDR_SA_LEN */ @@ -949,6 +1174,12 @@ /* Define to 1 if you have the header file. */ #define HAVE_SPAWN_H 1 +/* Define to 1 if you have the `splice' function. */ +/*UNIKRAFT*/ +#if CONFIG_LIBMUSL +#define HAVE_SPLICE 1 +#endif + /* Define if your compiler provides ssize_t */ #define HAVE_SSIZE_T 1 @@ -971,11 +1202,9 @@ /* Define to 1 if you have the header file. */ #define HAVE_STDLIB_H 1 -/* Has stdatomic.h with atomic_int */ -//#define HAVE_STD_ATOMIC 1 - -/* Define to 1 if you have the `strdup' function. */ -#define HAVE_STRDUP 1 +/* Has stdatomic.h with atomic_int and atomic_uintptr_t */ +/*UNIKRAFT*/ +/* #define HAVE_STD_ATOMIC 1 */ /* Define to 1 if you have the `strftime' function. */ #define HAVE_STRFTIME 1 @@ -990,7 +1219,10 @@ /* #undef HAVE_STRLCPY */ /* Define to 1 if you have the header file. */ -/* #define HAVE_STROPTS_H 1 */ +/* #undef HAVE_STROPTS_H */ + +/* Define to 1 if you have the `strsignal' function. */ +#define HAVE_STRSIGNAL 1 /* Define to 1 if `pw_gecos' is a member of `struct passwd'. */ #define HAVE_STRUCT_PASSWD_PW_GECOS 1 @@ -1017,13 +1249,19 @@ #define HAVE_STRUCT_STAT_ST_RDEV 1 /* Define to 1 if `tm_zone' is a member of `struct tm'. */ -/* #define HAVE_STRUCT_TM_TM_ZONE 1 */ +/*UNIKRAFT*/ +#if CONFIG_LIBMUSL +#define HAVE_STRUCT_TM_TM_ZONE 1 +#endif /* Define if you have the 'symlink' function. */ #define HAVE_SYMLINK 1 /* Define to 1 if you have the `symlinkat' function. */ -/* #define HAVE_SYMLINKAT 1 */ +/*UNIKRAFT*/ +#if CONFIG_LIBMUSL +#define HAVE_SYMLINKAT 1 +#endif /* Define to 1 if you have the `sync' function. */ #define HAVE_SYNC 1 @@ -1037,6 +1275,12 @@ /* Define to 1 if you have the header file. */ /* #undef HAVE_SYS_AUDIOIO_H */ +/* Define to 1 if you have the header file. */ +/*UNIKRAFT*/ +#if CONFIG_LIBMUSL +#define HAVE_SYS_AUXV_H 1 +#endif + /* Define to 1 if you have the header file. */ /* #undef HAVE_SYS_BSDTTY_H */ @@ -1051,7 +1295,10 @@ /* #undef HAVE_SYS_ENDIAN_H */ /* Define to 1 if you have the header file. */ -/* #define HAVE_SYS_EPOLL_H 1 */ +#define HAVE_SYS_EPOLL_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_EVENTFD_H 1 /* Define to 1 if you have the header file. */ /* #undef HAVE_SYS_EVENT_H */ @@ -1071,9 +1318,15 @@ /* Define to 1 if you have the header file. */ /* #undef HAVE_SYS_LOCK_H */ +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_MEMFD_H */ + /* Define to 1 if you have the header file. */ /* #undef HAVE_SYS_MKDEV_H */ +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_MMAN_H 1 + /* Define to 1 if you have the header file. */ /* #undef HAVE_SYS_MODEM_H */ @@ -1085,7 +1338,7 @@ #define HAVE_SYS_PARAM_H 1 /* Define to 1 if you have the header file. */ -//#define HAVE_SYS_POLL_H 1 +#define HAVE_SYS_POLL_H 1 /* Define to 1 if you have the header file. */ #define HAVE_SYS_RANDOM_H 1 @@ -1097,7 +1350,7 @@ #define HAVE_SYS_SELECT_H 1 /* Define to 1 if you have the header file. */ -/* #define HAVE_SYS_SENDFILE_H 1 */ +#define HAVE_SYS_SENDFILE_H 1 /* Define to 1 if you have the header file. */ #define HAVE_SYS_SOCKET_H 1 @@ -1198,10 +1451,10 @@ #define HAVE_UNISTD_H 1 /* Define to 1 if you have the `unlinkat' function. */ -/* #define HAVE_UNLINKAT 1 */ - -/* Define to 1 if you have the `unsetenv' function. */ -#define HAVE_UNSETENV 1 +/*UNIKRAFT*/ +#if CONFIG_LIBMUSL +#define HAVE_UNLINKAT 1 +#endif /* Define if you have a useable wchar_t type defined in wchar.h; useable means wchar_t must be an unsigned type with at least 16 bits. (see @@ -1212,7 +1465,10 @@ /* #undef HAVE_UTIL_H */ /* Define to 1 if you have the `utimensat' function. */ -/* #define HAVE_UTIMENSAT 1 */ +/*UNIKRAFT*/ +#if CONFIG_LIBMUSL +#define HAVE_UTIMENSAT 1 +#endif /* Define to 1 if you have the `utimes' function. */ #define HAVE_UTIMES 1 @@ -1230,6 +1486,7 @@ /* #undef HAVE_UUID_GENERATE_TIME_SAFE */ /* Define to 1 if you have the header file. */ +/*UNIKRAFT*/ #if CONFIG_LIBUUID #define HAVE_UUID_H 1 #endif @@ -1237,6 +1494,10 @@ /* Define to 1 if you have the header file. */ /* #undef HAVE_UUID_UUID_H */ +/* Define to 1 if you have the `vfork' function. */ +/*UNIKRAFT*/ +/* #define HAVE_VFORK 1 */ + /* Define to 1 if you have the `wait3' function. */ #define HAVE_WAIT3 1 @@ -1244,7 +1505,10 @@ #define HAVE_WAIT4 1 /* Define to 1 if you have the `waitid' function. */ -/* #define HAVE_WAITID 1 */ +/*UNIKRAFT*/ +#if CONFIG_LIBMUSL +#define HAVE_WAITID 1 +#endif /* Define to 1 if you have the `waitpid' function. */ #define HAVE_WAITPID 1 @@ -1271,18 +1535,12 @@ /* Define to 1 if you have the `writev' function. */ #define HAVE_WRITEV 1 -/* Define if libssl has X509_VERIFY_PARAM_set1_host and related function */ -/* #undef HAVE_X509_VERIFY_PARAM_SET1_HOST */ - /* Define if the zlib library has inflateCopy */ -/* #undef HAVE_ZLIB_COPY */ +#define HAVE_ZLIB_COPY 1 /* Define to 1 if you have the `_getpty' function. */ /* #undef HAVE__GETPTY */ -/* Define if log1p(-0.) is 0. rather than -0. */ -/* #undef LOG1P_DROPS_ZERO_SIGN */ - /* Define to 1 if `major', `minor', and `makedev' are declared in . */ /* #undef MAJOR_IN_MKDEV */ @@ -1316,7 +1574,7 @@ /* #undef POSIX_SEMAPHORES_NOT_ENABLED */ /* Define if pthread_key_t is compatible with int. */ -/* #define PTHREAD_KEY_T_IS_COMPATIBLE_WITH_INT 1 */ +#define PTHREAD_KEY_T_IS_COMPATIBLE_WITH_INT 1 /* Defined if PTHREAD_SCOPE_SYSTEM supported. */ #define PTHREAD_SYSTEM_SCHED_SUPPORTED 1 @@ -1324,8 +1582,12 @@ /* Define as the preferred size in bits of long digits */ /* #undef PYLONG_BITS_IN_DIGIT */ +/* enabled builtin hash modules */ +#define PY_BUILTIN_HASHLIB_HASHES "md5,sha1,sha256,sha512,sha3,blake2" + /* Define if you want to coerce the C locale to a UTF-8 based locale */ -/* #define PY_COERCE_C_LOCALE 1 */ //TODO +/*UNIKRAFT?*/ +#define PY_COERCE_C_LOCALE 1 /* Define to printf format modifier for Py_ssize_t */ #define PY_FORMAT_SIZE_T "z" @@ -1341,18 +1603,24 @@ /* #undef Py_DEBUG */ /* Defined if Python is built as a shared library. */ -#undef Py_ENABLE_SHARED +/* #undef Py_ENABLE_SHARED */ /* Define hash algorithm for str, bytes and memoryview. SipHash24: 1, FNV: 2, externally defined: 0 */ /* #undef Py_HASH_ALGORITHM */ +/* Define if you want to enable tracing references for debugging purpose */ +/* #undef Py_TRACE_REFS */ + /* assume C89 semantics that RETSIGTYPE is always void */ #define RETSIGTYPE void /* Define if setpgrp() must be called as setpgrp(0, 0). */ /* #undef SETPGRP_HAVE_ARG */ +/* Define to 1 if you must link with -lrt for shm_open(). */ +/* #undef SHM_NEEDS_LIBRT */ + /* Define if i>>j for signed int i does not extend the sign bit when i < 0 */ /* #undef SIGNED_RIGHT_SHIFT_ZERO_FILLS */ @@ -1417,8 +1685,8 @@ (which you can't on SCO ODT 3.0). */ #define SYS_SELECT_WITH_SYS_TIME 1 -/* Define if tanh(-0.) is -0., or if platform doesn't have signed zeros */ -#define TANH_PRESERVES_ZERO_SIGN 1 +/* Custom thread stack size depending on chosen sanitizer runtimes. */ +/* #undef THREAD_STACK_SIZE */ /* Library needed by timemodule.c: librt may be needed for clock_gettime() */ /* #undef TIMEMODULE_LIB */ @@ -1457,6 +1725,10 @@ /* Define if WINDOW in curses.h offers a field _flags. */ #define WINDOW_HAS_FLAGS 1 +/* Define if you want build the _decimal module using a coroutine-local rather + than a thread-local context */ +#define WITH_DECIMAL_CONTEXTVAR 1 + /* Define if you want documentation strings in extension modules */ #define WITH_DOC_STRINGS 1 @@ -1468,6 +1740,9 @@ Dyld is necessary to support frameworks. */ /* #undef WITH_DYLD */ +/* Define to build the readline module against Editline. */ +/* #undef WITH_EDITLINE */ + /* Define to 1 if libintl is needed for locale functions. */ /* #undef WITH_LIBINTL */ @@ -1540,7 +1815,8 @@ #define _PYTHONFRAMEWORK "" /* Define to force use of thread-safe errno, h_errno, and other functions */ -/* #undef _REENTRANT */ +/*UNIKRAFT?*/ +#define _REENTRANT 1 /* Define to the level of X/Open that your system supports */ #define _XOPEN_SOURCE 700 @@ -1551,11 +1827,6 @@ /* Define on FreeBSD to activate all library features */ #define __BSD_VISIBLE 1 -/* Define to 1 if type `char' is unsigned and you are not using gcc. */ -#ifndef __CHAR_UNSIGNED__ -/* # undef __CHAR_UNSIGNED__ */ -#endif - /* Define to 'long' if doesn't define. */ /* #undef clock_t */ diff --git a/main.c b/main.c index a79df2c..cb0f3cc 100644 --- a/main.c +++ b/main.c @@ -3,6 +3,6 @@ int main(int argc, char *argv[]) { - return _Py_UnixMain(argc, argv); + return Py_BytesMain(argc, argv); } diff --git a/modules_config.c b/modules_config.c index cfa2b42..1d3cb05 100644 --- a/modules_config.c +++ b/modules_config.c @@ -42,7 +42,6 @@ extern PyObject* PyInit_time(void); extern PyObject* PyInit__thread(void); extern PyObject* PyInit__locale(void); extern PyObject* PyInit__io(void); -extern PyObject* PyInit_zipimport(void); extern PyObject* PyInit_faulthandler(void); extern PyObject* PyInit__tracemalloc(void); extern PyObject* PyInit__symtable(void); @@ -60,6 +59,12 @@ extern PyObject* PyInit__bisect(void); extern PyObject* PyInit__blake2(void); extern PyObject* PyInit__bz2(void); extern PyObject* PyInit_cmath(void); +extern PyObject* PyInit__codecs_cn(void); +extern PyObject* PyInit__codecs_hk(void); +extern PyObject* PyInit__codecs_iso2022(void); +extern PyObject* PyInit__codecs_jp(void); +extern PyObject* PyInit__codecs_kr(void); +extern PyObject* PyInit__codecs_tw(void); extern PyObject* PyInit__codecs(void); extern PyObject* PyInit__collections(void); extern PyObject* PyInit__contextvars(void); @@ -102,8 +107,8 @@ extern PyObject* PyInit__opcode(void); extern PyObject* PyInit__operator(void); extern PyObject* PyInit_ossaudiodev(void); extern PyObject* PyInit__overlapped(void); -extern PyObject* PyInit_parser(void); extern PyObject* PyInit__pickle(void); +extern PyObject* PyInit__posixshmem(void); extern PyObject* PyInit__posixsubprocess(void); extern PyObject* PyInit_pwd(void); extern PyObject* PyInit_pyexpat(void); @@ -120,6 +125,7 @@ extern PyObject* PyInit__sha512(void); extern PyObject* PyInit__signal(void); extern PyObject* PyInit__socket(void); extern PyObject* PyInit_spwd(void); +extern PyObject* PyInit__statistics(void); extern PyObject* PyInit__ssl(void); extern PyObject* PyInit__stat(void); extern PyObject* PyInit__string(void); @@ -130,6 +136,8 @@ extern PyObject* PyInit_syslog(void); extern PyObject* PyInit_termios(void); extern PyObject* PyInit__testbuffer(void); extern PyObject* PyInit__testcapi(void); +extern PyObject* PyInit__testinternalcapi(void); +extern PyObject* PyInit__testimportmultiple(void); extern PyObject* PyInit__thread(void); extern PyObject* PyInit_time(void); extern PyObject* PyInit__tkinter(void); @@ -139,13 +147,11 @@ extern PyObject* PyInit__uuid(void); extern PyObject* PyInit__weakref(void); extern PyObject* PyInit__winapi(void); extern PyObject* PyInit_xxlimited(void); -extern PyObject* PyInit_xxsubtype(void); extern PyObject* PyInit__xxtestfuzz(void); extern PyObject* PyInit_xx(void); -extern PyObject* PyInit_zipimport(void); -#ifdef CONFIG_LIBZLIB extern PyObject* PyInit_zlib(void); -#endif +extern PyObject* PyInit__zoneinfo(void); + /* Unikraft Marker end */ /* -- ADDMODULE MARKER 1 -- */ @@ -176,7 +182,6 @@ struct _inittab _PyImport_Inittab[] = { {"_thread", PyInit__thread}, {"_locale", PyInit__locale}, {"_io", PyInit__io}, - {"zipimport", PyInit_zipimport}, {"faulthandler", PyInit_faulthandler}, {"_tracemalloc", PyInit__tracemalloc}, {"_symtable", PyInit__symtable}, @@ -220,7 +225,13 @@ struct _inittab _PyImport_Inittab[] = { {"_bz2", PyInit__bz2}, #endif {"cmath", PyInit_cmath}, + {"_codecs_cn", PyInit__codecs_cn}, + {"_codecs_hk", PyInit__codecs_hk}, + {"_codecs_iso2022", PyInit__codecs_iso2022}, + {"_codecs_jp", PyInit__codecs_jp}, + {"_codecs_kr", PyInit__codecs_kr}, {"_codecs", PyInit__codecs}, + {"_codecs_tw", PyInit__codecs_tw}, {"_collections", PyInit__collections}, {"_contextvars", PyInit__contextvars}, //TODO {"_crypt", PyInit__crypt}, @@ -270,8 +281,8 @@ struct _inittab _PyImport_Inittab[] = { {"_operator", PyInit__operator}, /* audio {"ossaudiodev", PyInit_ossaudiodev}, */ /* Windows {"_overlapped", PyInit__overlapped}, */ - {"parser", PyInit_parser}, {"_pickle", PyInit__pickle}, + {"_posixshmem", PyInit__posixshmem}, {"_posixsubprocess", PyInit__posixsubprocess}, {"pwd", PyInit_pwd}, #if CONFIG_LIBPYTHON3_EXTENSION_EXPAT @@ -291,11 +302,12 @@ struct _inittab _PyImport_Inittab[] = { {"_socket", PyInit__socket}, //TODO enable {"spwd", PyInit_spwd}, #if CONFIG_LIBPYTHON3_EXTENSION_SQLITE - {"sqlite3", PyInit__sqlite3}, + {"_sqlite3", PyInit__sqlite3}, #endif #if CONFIG_LIBPYTHON3_EXTENSION_SSL {"_ssl", PyInit__ssl}, #endif + {"_statistics", PyInit__statistics}, {"_stat", PyInit__stat}, {"_string", PyInit__string}, {"_struct", PyInit__struct}, @@ -305,6 +317,8 @@ struct _inittab _PyImport_Inittab[] = { // {"termios", PyInit_termios}, {"_testbuffer", PyInit__testbuffer}, {"_testcapi", PyInit__testcapi}, + {"_testinternalcapi", PyInit__testinternalcapi}, + {"_testimportmultiple", PyInit__testimportmultiple}, {"_thread", PyInit__thread}, {"time", PyInit_time}, // {"_tkinter", PyInit__tkinter}, @@ -316,13 +330,12 @@ struct _inittab _PyImport_Inittab[] = { {"_weakref", PyInit__weakref}, /* Windows {"_winapi", PyInit__winapi}, */ {"xxlimited", PyInit_xxlimited}, - {"xxsubtype", PyInit_xxsubtype}, {"_xxtestfuzz", PyInit__xxtestfuzz}, {"xx", PyInit_xx}, - {"zipimport", PyInit_zipimport}, #if CONFIG_LIBPYTHON3_EXTENSION_ZLIB {"zlib", PyInit_zlib}, #endif + {"_zoneinfo", PyInit__zoneinfo}, /* Unikraft Marker end */ /* Sentinel */ diff --git a/patches/0001-Undefine-HAVE_FORK-and-HAVE_EXECVE.patch b/patches/0000-Undefine-HAVE_FORK-and-HAVE_EXECVE.patch similarity index 55% rename from patches/0001-Undefine-HAVE_FORK-and-HAVE_EXECVE.patch rename to patches/0000-Undefine-HAVE_FORK-and-HAVE_EXECVE.patch index d4c8f3f..ca7c82a 100644 --- a/patches/0001-Undefine-HAVE_FORK-and-HAVE_EXECVE.patch +++ b/patches/0000-Undefine-HAVE_FORK-and-HAVE_EXECVE.patch @@ -9,18 +9,15 @@ Signed-off-by: Vlad-Andrei Badoiu 1 file changed, 2 deletions(-) diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c -index b758e76..aed9e22 100644 +index c0421a9..babcf2b 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c -@@ -175,8 +175,6 @@ corresponding Unix manual entries for more information on calls."); - #define fsync _commit - #else - /* Unix functions that the configure script doesn't check for */ --#define HAVE_EXECV 1 --#define HAVE_FORK 1 - #if defined(__USLC__) && defined(__SCO_VERSION__) /* SCO UDK Compiler */ - #define HAVE_FORK1 1 - #endif --- -2.20.1 - +@@ -326,8 +326,6 @@ corresponding Unix manual entries for more information on calls."); + # else + /* Unix functions that the configure script doesn't check for */ + # ifndef __VXWORKS__ +-# define HAVE_EXECV 1 +-# define HAVE_FORK 1 + # if defined(__USLC__) && defined(__SCO_VERSION__) /* SCO UDK Compiler */ + # define HAVE_FORK1 1 + # endif diff --git a/patches/0001-asyncio-Replace-unix-sockets-with-pipes.patch b/patches/0001-asyncio-Replace-unix-sockets-with-pipes.patch new file mode 100644 index 0000000..c5da811 --- /dev/null +++ b/patches/0001-asyncio-Replace-unix-sockets-with-pipes.patch @@ -0,0 +1,91 @@ +From 890b505b8eabc2313514dbcad3568bf66d3a3a36 Mon Sep 17 00:00:00 2001 +From: Andrei Tatar +Date: Mon, 12 Jun 2023 13:32:42 +0200 +Subject: [PATCH 1/5] asyncio: Replace unix sockets with pipes + +The default asyncio event loop for *nix systems uses a pair of connected +AF_UNIX sockets for internal synchronization. +Because AF_UNIX sockets are not (yet) supported in Unikraft, this patch +replaces them with pipes. + +Signed-off-by: Andrei Tatar +--- + Lib/asyncio/selector_events.py | 31 +++++++++++++++---------------- + 1 file changed, 15 insertions(+), 16 deletions(-) + +diff --git a/Lib/asyncio/selector_events.py b/Lib/asyncio/selector_events.py +index 8282f28..13afe38 100644 +--- a/Lib/asyncio/selector_events.py ++++ b/Lib/asyncio/selector_events.py +@@ -9,6 +9,8 @@ + import collections + import errno + import functools ++import io ++import os + import selectors + import socket + import warnings +@@ -91,20 +93,18 @@ def close(self): + self._selector = None + + def _close_self_pipe(self): +- self._remove_reader(self._ssock.fileno()) +- self._ssock.close() +- self._ssock = None +- self._csock.close() +- self._csock = None ++ self._remove_reader(self._spipe.fileno()) ++ self._spipe.close() ++ self._spipe = None ++ self._cpipe.close() ++ self._cpipe = None + self._internal_fds -= 1 + + def _make_self_pipe(self): +- # A self-socket, really. :-) +- self._ssock, self._csock = socket.socketpair() +- self._ssock.setblocking(False) +- self._csock.setblocking(False) ++ self._spipe, self._cpipe = map(io.FileIO, os.pipe2(os.O_NONBLOCK), ++ ('r', 'w')) + self._internal_fds += 1 +- self._add_reader(self._ssock.fileno(), self._read_from_self) ++ self._add_reader(self._spipe.fileno(), self._read_from_self) + + def _process_self_data(self, data): + pass +@@ -112,7 +112,7 @@ def _process_self_data(self, data): + def _read_from_self(self): + while True: + try: +- data = self._ssock.recv(4096) ++ data = self._spipe.read(4096) + if not data: + break + self._process_self_data(data) +@@ -127,17 +127,16 @@ def _write_to_self(self): + # running. Guard for self._csock being None or closed. When + # a socket is closed, send() raises OSError (with errno set to + # EBADF, but let's not rely on the exact error code). +- csock = self._csock +- if csock is None: ++ cpipe = self._cpipe ++ if cpipe is None: + return + + try: +- csock.send(b'\0') ++ cpipe.write(b'\0') + except OSError: + if self._debug: + logger.debug("Fail to write a null byte into the " +- "self-pipe socket", +- exc_info=True) ++ "self-pipe", exc_info=True) + + def _start_serving(self, protocol_factory, sock, + sslcontext=None, server=None, backlog=100, +-- +2.41.0 + diff --git a/patches/0002-Do-not-compile-py-files-on-library-install.patch b/patches/0002-Do-not-compile-py-files-on-library-install.patch new file mode 100644 index 0000000..2c804c4 --- /dev/null +++ b/patches/0002-Do-not-compile-py-files-on-library-install.patch @@ -0,0 +1,51 @@ +From fd2027e59261fe7ef5adfefded95a6c0d348722f Mon Sep 17 00:00:00 2001 +From: Andrei Tatar +Date: Thu, 6 Jul 2023 02:43:06 +0300 +Subject: [PATCH 2/5] Do not compile py files on library install + +Signed-off-by: Andrei Tatar +--- + Makefile.pre.in | 27 --------------------------- + 1 file changed, 27 deletions(-) + +diff --git a/Makefile.pre.in b/Makefile.pre.in +index 51c31b9..e0605e3 100644 +--- a/Makefile.pre.in ++++ b/Makefile.pre.in +@@ -1601,33 +1601,6 @@ libinstall: build_all $(srcdir)/Modules/xxmodule.c + $(INSTALL_DATA) $(srcdir)/Modules/xxmodule.c \ + $(DESTDIR)$(LIBDEST)/distutils/tests ; \ + fi +- -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ +- $(PYTHON_FOR_BUILD) -Wi $(DESTDIR)$(LIBDEST)/compileall.py \ +- -j0 -d $(LIBDEST) -f \ +- -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \ +- $(DESTDIR)$(LIBDEST) +- -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ +- $(PYTHON_FOR_BUILD) -Wi -O $(DESTDIR)$(LIBDEST)/compileall.py \ +- -j0 -d $(LIBDEST) -f \ +- -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \ +- $(DESTDIR)$(LIBDEST) +- -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ +- $(PYTHON_FOR_BUILD) -Wi -OO $(DESTDIR)$(LIBDEST)/compileall.py \ +- -j0 -d $(LIBDEST) -f \ +- -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \ +- $(DESTDIR)$(LIBDEST) +- -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ +- $(PYTHON_FOR_BUILD) -Wi $(DESTDIR)$(LIBDEST)/compileall.py \ +- -j0 -d $(LIBDEST)/site-packages -f \ +- -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages +- -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ +- $(PYTHON_FOR_BUILD) -Wi -O $(DESTDIR)$(LIBDEST)/compileall.py \ +- -j0 -d $(LIBDEST)/site-packages -f \ +- -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages +- -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ +- $(PYTHON_FOR_BUILD) -Wi -OO $(DESTDIR)$(LIBDEST)/compileall.py \ +- -j0 -d $(LIBDEST)/site-packages -f \ +- -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages + -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ + $(PYTHON_FOR_BUILD) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/Grammar.txt + -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ +-- +2.41.0 + diff --git a/patches/0002-Use-pthread_t-to-unsigned-long-conversion.patch b/patches/0002-Use-pthread_t-to-unsigned-long-conversion.patch deleted file mode 100644 index 2858395..0000000 --- a/patches/0002-Use-pthread_t-to-unsigned-long-conversion.patch +++ /dev/null @@ -1,40 +0,0 @@ -From 81399f6373ea09bfed792b477f5a55e721ba4b8b Mon Sep 17 00:00:00 2001 -From: Vlad-Andrei Badoiu -Date: Sat, 12 Oct 2019 16:28:02 +0300 -Subject: [PATCH] Use pthread_t to unsigned long conversion - -Signed-off-by: Vlad-Andrei Badoiu -Signed-off-by: Costin Lupu ---- - Python/thread_pthread.h | 7 ++++++- - 1 file changed, 6 insertions(+), 1 deletion(-) - -diff --git a/Python/thread_pthread.h b/Python/thread_pthread.h -index f79f9b9..55d4c70 100644 ---- a/Python/thread_pthread.h -+++ b/Python/thread_pthread.h -@@ -241,7 +241,7 @@ PyThread_start_new_thread(void (*func)(void *), void *arg) - #if SIZEOF_PTHREAD_T <= SIZEOF_LONG - return (unsigned long) th; - #else -- return (unsigned long) *(unsigned long *) &th; -+ return pthread_to_unsigned_long(&th); - #endif - } - -@@ -258,7 +258,12 @@ PyThread_get_thread_ident(void) - if (!initialized) - PyThread_init_thread(); - threadid = pthread_self(); -+ -+#if SIZEOF_PTHREAD_T <= SIZEOF_LONG - return (unsigned long) threadid; -+#else -+ return pthread_to_unsigned_long((pthread_t *) &threadid); -+#endif - } - - void --- -2.20.1 - diff --git a/patches/0003-Do-not-compile-C-files-on-library-install.patch b/patches/0003-Do-not-compile-C-files-on-library-install.patch new file mode 100644 index 0000000..609e32b --- /dev/null +++ b/patches/0003-Do-not-compile-C-files-on-library-install.patch @@ -0,0 +1,26 @@ +From 8108ed2679695de44e237fe8eea2dc5d62fc5482 Mon Sep 17 00:00:00 2001 +From: Andrei Tatar +Date: Thu, 6 Jul 2023 02:51:55 +0300 +Subject: [PATCH 3/5] Do not compile C files on library install + +Signed-off-by: Andrei Tatar +--- + Makefile.pre.in | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Makefile.pre.in b/Makefile.pre.in +index e0605e3..e416601 100644 +--- a/Makefile.pre.in ++++ b/Makefile.pre.in +@@ -1529,7 +1529,7 @@ TESTSUBDIRS= ctypes/test \ + unittest/test unittest/test/testmock + + TEST_MODULES=@TEST_MODULES@ +-libinstall: build_all $(srcdir)/Modules/xxmodule.c ++libinstall: $(srcdir)/Modules/xxmodule.c + @for i in $(SCRIPTDIR) $(LIBDEST); \ + do \ + if test ! -d $(DESTDIR)$$i; then \ +-- +2.41.0 + diff --git a/patches/0003-Do-not-use-SOCK_CLOEXEC.patch b/patches/0003-Do-not-use-SOCK_CLOEXEC.patch deleted file mode 100644 index 9272f68..0000000 --- a/patches/0003-Do-not-use-SOCK_CLOEXEC.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 74f063268b19fe3654799eea48cc4d9aa805c13f Mon Sep 17 00:00:00 2001 -From: Vlad Badoiu -Date: Tue, 18 Jan 2022 22:53:47 +0200 -Subject: [PATCH 1/1] Do not use SOCK_CLOEXEC - -We do not use SOCK_CLOEXEC in the socketmodule because it -is not available undr lwip. - -Signed-off-by: Vlad Badoiu ---- - Modules/socketmodule.c | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c -index 72b122c..e262694 100644 ---- a/Modules/socketmodule.c -+++ b/Modules/socketmodule.c -@@ -574,6 +574,10 @@ select_error(void) - # define SOCK_INPROGRESS_ERR EINPROGRESS - #endif - -+#ifdef SOCK_CLOEXEC -+#undef SOCK_CLOEXEC -+#endif -+ - #ifdef _MSC_VER - # define SUPPRESS_DEPRECATED_CALL __pragma(warning(suppress: 4996)) - #else --- -2.25.1 - -- 2.39.5