Signed-off-by: Khem Raj <[email protected]> --- ...-fall-back-to-VERSION-when-git-descr.patch | 43 +++++++++++++++++++ meta/recipes-core/musl/musl_git.bb | 1 + 2 files changed, 44 insertions(+) create mode 100644 meta/recipes-core/musl/musl/0003-tools-version.sh-fall-back-to-VERSION-when-git-descr.patch
diff --git a/meta/recipes-core/musl/musl/0003-tools-version.sh-fall-back-to-VERSION-when-git-descr.patch b/meta/recipes-core/musl/musl/0003-tools-version.sh-fall-back-to-VERSION-when-git-descr.patch new file mode 100644 index 0000000000..d77b29179e --- /dev/null +++ b/meta/recipes-core/musl/musl/0003-tools-version.sh-fall-back-to-VERSION-when-git-descr.patch @@ -0,0 +1,43 @@ +From 97bb653022ed04c076040ebe899c89d19ddab6bd Mon Sep 17 00:00:00 2001 +From: Khem Raj <[email protected]> +Date: Sun, 27 Sep 2026 17:15:34 -0700 +Subject: [PATCH] tools/version.sh: fall back to VERSION when git describe + finds nothing + +When building from a git checkout, version.sh uses "git describe" and +only falls back to the VERSION file when git itself is missing. In a +clone that has no tags, such as the one a build system fetches at a +fixed revision, git describe prints nothing and libc is built with an +empty VERSION, so the dynamic linker reports just "Version ". Tools +that identify musl by that string, e.g. Python's packaging (musllinux +platform tags), then no longer recognise the system as musl. + +Use VERSION, suffixed with -git as before, whenever git describe gives +no result. + +Upstream-Status: Submitted [https://www.openwall.com/lists/musl/2026/09/28/1] +Signed-off-by: Khem Raj <[email protected]> +--- + tools/version.sh | 9 +++++++-- + 1 file changed, 7 insertions(+), 2 deletions(-) + +diff --git a/tools/version.sh b/tools/version.sh +index f1cc594..578ff46 100644 +--- a/tools/version.sh ++++ b/tools/version.sh +@@ -2,8 +2,13 @@ + + if test -d .git ; then + if type git >/dev/null 2>&1 ; then +-git describe --tags --match 'v[0-9]*' 2>/dev/null \ +-| sed -e 's/^v//' -e 's/-/-git-/' ++v=$(git describe --tags --match 'v[0-9]*' 2>/dev/null \ ++| sed -e 's/^v//' -e 's/-/-git-/') ++fi ++# git describe finds nothing in a clone without tags (e.g. a build ++# system checkout); fall back to the VERSION file then too. ++if test -n "$v" ; then ++echo "$v" + else + sed 's/$/-git/' < VERSION + fi diff --git a/meta/recipes-core/musl/musl_git.bb b/meta/recipes-core/musl/musl_git.bb index 057113bf16..849b9e46ee 100644 --- a/meta/recipes-core/musl/musl_git.bb +++ b/meta/recipes-core/musl/musl_git.bb @@ -13,6 +13,7 @@ PV = "${BASEVER}+git" SRC_URI = "git://git.musl-libc.org/musl;branch=master \ file://0001-Make-dynamic-linker-a-relative-symlink-to-libc.patch \ file://0002-ldso-Use-syslibdir-and-libdir-as-default-pathes-to-l.patch \ + file://0003-tools-version.sh-fall-back-to-VERSION-when-git-descr.patch \ " PROVIDES += "virtual/libc virtual/libiconv virtual/libintl virtual/crypt"
-=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#246716): https://lists.openembedded.org/g/openembedded-core/message/246716 Mute This Topic: https://lists.openembedded.org/mt/121464223/21656 Group Owner: [email protected] Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]] -=-=-=-=-=-=-=-=-=-=-=-
