build: remove unused static library dependencies (sqlite3, openssl, bzip2)#315
build: remove unused static library dependencies (sqlite3, openssl, bzip2)#315ppenna wants to merge 1 commit into
Conversation
…zip2) Drop sqlite3, openssl, and bzip2 from the Nanvix cross-compilation build: - Remove from .nanvix/nanvix.toml dependency list - Remove link flags (-lsqlite3, -lssl, -lcrypto, -lbz2) from LIBS - Remove LIBSQLITE3_*, BZIP2_*, LIBSSL, LIBCRYPTO variable definitions - Remove --with-openssl from CONFIGURE_OPTS These libraries are unused at runtime and removing them shrinks the final binary significantly. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Removes unused sqlite3/openssl/bzip2 static library dependencies from the Nanvix cross-compilation build configuration to significantly shrink the produced CPython binary.
Changes:
- Drop
sqlite,openssl, andbzip2from Nanvix dependency manifest. - Simplify
Makefile.nanvixlink/configure settings by removing-lsqlite3 -lssl -lcrypto -lbz2and associated variables/options.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
Makefile.nanvix |
Removes sqlite/openssl/bzip2 library paths/flags from the Nanvix configure environment and drops --with-openssl. |
.nanvix/nanvix.toml |
Updates Nanvix dependency list to no longer fetch sqlite/openssl/bzip2 via nanvix-zutil. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| LIBC := $(DOCKER_TOOLCHAIN_PATH)/i686-nanvix/lib/libc.a | ||
| LIBM := $(DOCKER_TOOLCHAIN_PATH)/i686-nanvix/lib/libm.a | ||
| LIBPOSIX := $(DOCKER_SYSROOT_PATH)/lib/libposix.a | ||
| LIBZ := $(DOCKER_SYSROOT_PATH)/lib/libz.a | ||
| LIBSQLITE3 := $(DOCKER_SYSROOT_PATH)/lib/libsqlite3.a | ||
| LIBSSL := $(DOCKER_SYSROOT_PATH)/lib/libssl.a | ||
| LIBCRYPTO := $(DOCKER_SYSROOT_PATH)/lib/libcrypto.a | ||
| BUILD_PYTHON := $(DOCKER_TOOLCHAIN_PATH)/bin/python3 |
There was a problem hiding this comment.
LIBZ is still defined in both the Docker and native toolchain branches, but it’s no longer referenced anywhere in this Makefile (the link flags use -lz directly). Either remove the unused LIBZ assignments, or use $(LIBZ) in LIBS for consistency with LIBC/LIBM/LIBPOSIX and to make the zlib archive choice deterministic.
| 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" |
There was a problem hiding this comment.
The Nanvix build documentation is now inconsistent with the build configuration: Makefile.nanvix (header comment) and NANVIX.md still list SQLite/OpenSSL/bzip2 as required dependencies and describe copying libsqlite3.a, libssl.a, libcrypto.a, and libbz2.a into the sysroot, but this change removes them from LIBS/CONFIGURE_OPTS and .nanvix/nanvix.toml. Please update those dependency lists/instructions to match the new minimal dependency set and (if intended) note that ssl, sqlite3, and bz2 modules won’t be built for Nanvix.
|
This change is invalid. |
Summary
Drop sqlite3, openssl, and bzip2 from the Nanvix cross-compilation build. These libraries are unused at runtime and removing them shrinks the final binary significantly (47 MB → ~12 MB).
Changes
.nanvix/nanvix.toml: Removesqlite,openssl,bzip2from[dependencies]Makefile.nanvix:-lsqlite3 -lssl -lcrypto -lbz2fromLIBSLIBSQLITE3_*,BZIP2_*,LIBSSL,LIBCRYPTOvariable definitions--with-opensslfromCONFIGURE_OPTSSplit from #314.