From: Shubham Chakraborty <chakrabortyshubham66@gmail.com>
To: buildroot@buildroot.org
Cc: Shubham Chakraborty <chakrabortyshubham66@gmail.com>,
James Hilliard <james.hilliard1@gmail.com>,
Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Subject: [Buildroot] [PATCH] package/python3: fix build in static-only configurations
Date: Fri, 3 Apr 2026 14:21:51 +0530 [thread overview]
Message-ID: <20260403085152.511498-1-chakrabortyshubham66@gmail.com> (raw)
When BR2_STATIC_LIBS=y is enabled, python3 does not produce shared
libraries (.so files). The target installation hook
PYTHON3_ENSURE_LIBPYTHON_STRIPPED fails because it tries to chmod
non-existent .so files.
Wrap the chmod command in a conditional check to ensure it only runs if
the shared libraries are actually present.
Signed-off-by: Shubham Chakraborty <chakrabortyshubham66@gmail.com>
---
package/python3/python3.mk | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/package/python3/python3.mk b/package/python3/python3.mk
index 07cba7c02d..2514dea5b0 100644
--- a/package/python3/python3.mk
+++ b/package/python3/python3.mk
@@ -229,7 +229,9 @@ PYTHON3_POST_INSTALL_TARGET_HOOKS += PYTHON3_REMOVE_USELESS_FILES
# Make sure libpython gets stripped out on target
#
define PYTHON3_ENSURE_LIBPYTHON_STRIPPED
- chmod u+w $(TARGET_DIR)/usr/lib/libpython$(PYTHON3_VERSION_MAJOR)*.so
+ if [ -e $(TARGET_DIR)/usr/lib/libpython$(PYTHON3_VERSION_MAJOR)*.so ]; then \
+ chmod u+w $(TARGET_DIR)/usr/lib/libpython$(PYTHON3_VERSION_MAJOR)*.so; \
+ fi
endef
PYTHON3_POST_INSTALL_TARGET_HOOKS += PYTHON3_ENSURE_LIBPYTHON_STRIPPED
--
2.53.0
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
next reply other threads:[~2026-04-03 8:52 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-03 8:51 Shubham Chakraborty [this message]
2026-04-10 13:54 ` [Buildroot] [PATCH] package/python3: fix build in static-only configurations Marcus Hoffmann via buildroot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260403085152.511498-1-chakrabortyshubham66@gmail.com \
--to=chakrabortyshubham66@gmail.com \
--cc=buildroot@buildroot.org \
--cc=james.hilliard1@gmail.com \
--cc=thomas.petazzoni@bootlin.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox