diff --git a/main/python3/APKBUILD b/main/python3/APKBUILD
index 573abcdbffc39be47297456198bad3e48075051e..0730a5c456bdea290d480fe1bea7047db93e08f4 100644
--- a/main/python3/APKBUILD
+++ b/main/python3/APKBUILD
@@ -4,7 +4,7 @@ pkgname=python3
 # the python3-tkinter's pkgver needs to be synchronized with this.
 pkgver=3.12.7
 _basever="${pkgver%.*}"
-pkgrel=0
+pkgrel=1
 pkgdesc="High-level scripting language"
 url="https://www.python.org/"
 arch="all"
@@ -108,7 +108,7 @@ build() {
 	# we want -O2 here for more speed for such a large interpreter.
 	export CFLAGS_NODIST="$CFLAGS -O2 -DTHREAD_STACK_SIZE=$stacksize"
 	export CXXFLAGS_NODIST="$CXXFLAGS -O2"
-	export LDFLAGS_NODIST="$LDFLAGS"
+	export LDFLAGS_NODIST="$LDFLAGS -Wl,-z,stack-size=$stacksize"
 
 	case "$CARCH" in
 	ppc64le)
@@ -120,6 +120,7 @@ build() {
 		;;
 	esac
 
+
 	# we set them via NODIST to not propagate them and duplicate them to modules
 	unset LDFLAGS CFLAGS CXXFLAGS CPPFLAGS