Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 1 addition & 10 deletions Makefile.nanvix
Original file line number Diff line number Diff line change
Expand Up @@ -156,15 +156,7 @@ CONFIGURE_ENV = \
CFLAGS="-L$(SYSROOT_PATH)/lib -I$(SYSROOT_PATH)/include" \
CFLAGS_NODIST="-fno-semantic-interposition" \
LDFLAGS="-T$(SYSROOT_PATH)/lib/user.ld -Wl,--allow-multiple-definition -Wl,-pie -Wl,--export-dynamic -Wl,--no-dynamic-linker" \
LIBS="-Wl,--start-group $(LIBPOSIX) $(LIBC) $(LIBM) -lsqlite3 -lssl -lcrypto -lz -lbz2 -lffi -Wl,--end-group" \
LIBSQLITE3_LIBS="-L$(SYSROOT_PATH)/lib -lsqlite3" \
LIBSQLITE3_CFLAGS="-I$(SYSROOT_PATH)/include" \
ZLIB_LIBS="-L$(SYSROOT_PATH)/lib -lz" \
ZLIB_CFLAGS="-I$(SYSROOT_PATH)/include" \
BZIP2_LIBS="-L$(SYSROOT_PATH)/lib -lbz2" \
BZIP2_CFLAGS="-I$(SYSROOT_PATH)/include" \
LIBFFI_LIBS="-L$(SYSROOT_PATH)/lib -lffi" \
LIBFFI_CFLAGS="-I$(SYSROOT_PATH)/include"
LIBS="-Wl,--start-group $(LIBPOSIX) $(LIBC) $(LIBM) -Wl,--end-group"

# Configure options for Nanvix
CONFIGURE_OPTS = \
Expand All @@ -180,7 +172,6 @@ CONFIGURE_OPTS = \
--exec-prefix="$(INSTALL_PREFIX)" \
--with-ensurepip=no \
--with-pkg-config=no \
--with-openssl="$(SYSROOT_PATH)" \
--disable-ipv6 \
ac_cv_file__dev_ptmx=no \
ac_cv_file__dev_ptc=no \
Expand Down
48 changes: 48 additions & 0 deletions Modules/Setup.local
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Disable non-essential C extension modules to reduce binary size.
# All stdlib .py files remain in the sysroot; only the C accelerators
# are excluded from the statically-linked binary.

*disabled*
_decimal
unicodedata
_ctypes
_sqlite3
_ssl
_codecs_cn
_codecs_hk
_codecs_iso2022
_codecs_jp
_codecs_kr
_codecs_tw
_multibytecodec
pyexpat
_elementtree
_posixsubprocess
select
_socket
_asyncio
_pickle
_json
math

Copilot AI Apr 4, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Disabling math removes the only implementation of the math module (there is no pure-Python fallback). This will cause imports like random and statistics to fail (e.g., Lib/random.py does from math import ... unconditionally). If the goal is to keep a functional stdlib, math should not be in *disabled* (or a compatible replacement needs to be provided).

This issue also appears in the following locations of the same file:

  • line 31
  • line 32
  • line 38
  • line 40
  • line 43
Suggested change
math

Copilot uses AI. Check for mistakes.
cmath
_statistics
_datetime
_bz2
binascii
array
_bisect
_contextvars
_csv
_heapq
_opcode
_queue
_random
_struct
_zoneinfo
_md5
_sha1
_sha256
_sha512
_sha3
_blake2
zlib
Loading