Skip to content
Closed
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
3 changes: 0 additions & 3 deletions .nanvix/nanvix.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,4 @@ nanvix-version = "latest"

[dependencies]
zlib = "1.3.1"
sqlite = "3.49.0"
openssl = "3.5.0"
bzip2 = "1.0.8"
libffi = "3.4.6"
31 changes: 24 additions & 7 deletions Makefile.nanvix
Original file line number Diff line number Diff line change
Expand Up @@ -136,13 +136,9 @@ 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" \
LIBS="-Wl,--start-group $(LIBPOSIX) $(LIBC) $(LIBM) -lz -lffi -Wl,--end-group" \
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"

Expand All @@ -160,15 +156,32 @@ 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 \
ac_cv_pthread_is_default=yes \
ac_cv_pthread=yes \
ac_cv_kthread=no \
ac_cv_func_dlopen=yes \
ac_cv_header_dlfcn_h=yes
ac_cv_header_dlfcn_h=yes \
ac_cv_sizeof_double=8 \
ac_cv_sizeof_float=4 \
ac_cv_sizeof_fpos_t=4 \
ac_cv_sizeof_int=4 \
ac_cv_sizeof_long=4 \
ac_cv_sizeof_long_double=12 \
ac_cv_sizeof_long_long=8 \
ac_cv_sizeof_off_t=8 \
ac_cv_sizeof_pid_t=4 \
ac_cv_sizeof_pthread_key_t=4 \
ac_cv_sizeof_pthread_t=4 \
ac_cv_sizeof_short=2 \
ac_cv_sizeof_size_t=4 \
ac_cv_sizeof_time_t=8 \
ac_cv_sizeof_uintptr_t=4 \
ac_cv_sizeof_void_p=4 \
ac_cv_sizeof_wchar_t=4 \
ac_cv_sizeof__bool=1

# Marker file to track if configure has been run
CONFIGURED_MARKER = .nanvix-configured
Expand All @@ -192,6 +205,10 @@ endif
build: $(CONFIGURED_MARKER)
ifdef CONFIG_NANVIX_DOCKER
@echo "Building inside Docker..."
@# Compile nanvix snapshot helper (outside LTO, so it survives optimization)
$(DOCKER_RUN) $(DOCKER_TOOLCHAIN_PATH)/bin/i686-nanvix-gcc -c Modules/nanvix_snapshot.S -o Modules/nanvix_snapshot.o
@# Inject the snapshot object into the generated Makefile's link objects
$(DOCKER_RUN) sh -c 'grep -q "nanvix_snapshot.o" Makefile || sed -i "/Modules\/main\.o/s|$$| Modules/nanvix_snapshot.o|" Makefile'
$(DOCKER_RUN) make -j$$(nproc) all
Comment on lines +208 to 212

Copilot AI Mar 29, 2026

Copy link

Choose a reason for hiding this comment

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

The snapshot object is only compiled/linked in the Docker build path, and it’s injected into the generated Makefile via a sed edit. If Modules/main.c ends up calling nanvix_snapshot(), the non-Docker build will fail to link, and the sed injection is brittle if the Makefile layout changes. Consider adding Modules/nanvix_snapshot.o via a supported make variable/configure mechanism (or apply the same logic to both build paths and fail the build if the injection pattern doesn’t match).

Copilot uses AI. Check for mistakes.
@# Rename python to python.elf for consistency (always use the latest build)
@if [ -f python ]; then mv -f python python$(EXE); fi
Expand Down
Loading
Loading