Skip to content

Commit 863cfcb

Browse files
committed
Add zlib as a build-dep of Tcl/Tk
This allows the shared libraries to statically link libz.a. I think we were previously picking up the zlib headers from the OS, and we were previously building static libraries so that was okay - they got linked into CPython itself which had the zlib symbols. But now that we're building shared libraries, they're picking up a dependency on libz.so.1, presumably because we don't have a static zlib installed from the OS.
1 parent e39bf03 commit 863cfcb

File tree

3 files changed

+14
-3
lines changed

3 files changed

+14
-3
lines changed

cpython-unix/Makefile

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,13 @@ $(OUTDIR)/patchelf-$(PATCHELF_VERSION)-$(PACKAGE_SUFFIX).tar: $(PYTHON_DEP_DEPEN
192192
$(OUTDIR)/sqlite-$(SQLITE_VERSION)-$(PACKAGE_SUFFIX).tar: $(PYTHON_DEP_DEPENDS) $(HERE)/build-sqlite.sh
193193
$(RUN_BUILD) --docker-image $(DOCKER_IMAGE_BUILD) sqlite
194194

195-
$(OUTDIR)/tcl-$(TCL_VERSION)-$(PACKAGE_SUFFIX).tar: $(PYTHON_DEP_DEPENDS) $(HERE)/build-tcl.sh
195+
TCL_DEPENDS = \
196+
$(PYTHON_DEP_DEPENDS) \
197+
$(HERE)/build-tcl.sh \
198+
$(OUTDIR)/zlib-$(ZLIB_VERSION)-$(PACKAGE_SUFFIX).tar \
199+
$(NULL)
200+
201+
$(OUTDIR)/tcl-$(TCL_VERSION)-$(PACKAGE_SUFFIX).tar: $(TCL_DEPENDS)
196202
$(RUN_BUILD) --docker-image $(DOCKER_IMAGE_BUILD) tcl
197203

198204
TK_DEPENDS = \

cpython-unix/build-tcl.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,9 @@ rm -rf pkgs/sqlite* pkgs/tdbc*
4949
pushd unix
5050

5151
CFLAGS="${EXTRA_TARGET_CFLAGS} -fPIC -I${TOOLS_PATH}/deps/include"
52+
LDFLAGS="${EXTRA_TARGET_CFLAGS} -L${TOOLS_PATH}/deps/lib"
5253

53-
CFLAGS="${CFLAGS}" CPPFLAGS="${CFLAGS}" LDFLAGS="${EXTRA_TARGET_LDFLAGS}" ./configure \
54+
CFLAGS="${CFLAGS}" CPPFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}" ./configure \
5455
--build=${BUILD_TRIPLE} \
5556
--host=${TARGET_TRIPLE} \
5657
--prefix=/tools/deps \

cpython-unix/build.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1121,6 +1121,9 @@ def main():
11211121
"zstd",
11221122
):
11231123
tools_path = "host" if action in ("m4", "patchelf") else "deps"
1124+
extra_archives = {
1125+
"tcl": {"zlib"},
1126+
}.get(action)
11241127

11251128
simple_build(
11261129
settings,
@@ -1131,6 +1134,7 @@ def main():
11311134
target_triple=target_triple,
11321135
build_options=build_options,
11331136
dest_archive=dest_archive,
1137+
extra_archives=extra_archives,
11341138
tools_path=tools_path,
11351139
)
11361140

@@ -1195,7 +1199,7 @@ def main():
11951199
)
11961200

11971201
elif action == "tk":
1198-
extra_archives = {"tcl"}
1202+
extra_archives = {"tcl", "zlib"}
11991203
if not host_platform.startswith("macos_"):
12001204
extra_archives |= {
12011205
"libX11",

0 commit comments

Comments
 (0)