public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: sys-libs/musl/files/, sys-libs/musl/
@ 2015-09-08 19:46 Anthony G. Basile
  0 siblings, 0 replies; 7+ messages in thread
From: Anthony G. Basile @ 2015-09-08 19:46 UTC (permalink / raw
  To: gentoo-commits

commit:     2a098330a77d2daec0f55e838782805ef4cd3de3
Author:     Anthony G. Basile <blueness <AT> gentoo <DOT> org>
AuthorDate: Tue Sep  8 19:50:14 2015 +0000
Commit:     Anthony G. Basile <blueness <AT> gentoo <DOT> org>
CommitDate: Tue Sep  8 19:50:29 2015 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2a098330

sys-libs/musl: add fix for codeset.

See http://www.openwall.com/lists/musl/2015/09/01/3

Package-Manager: portage-2.2.20.1

 sys-libs/musl/files/musl-1.1.11-fix-codeset.patch |  12 ++
 sys-libs/musl/musl-1.1.11-r1.ebuild               | 129 ++++++++++++++++++++++
 2 files changed, 141 insertions(+)

diff --git a/sys-libs/musl/files/musl-1.1.11-fix-codeset.patch b/sys-libs/musl/files/musl-1.1.11-fix-codeset.patch
new file mode 100644
index 0000000..e846f5f
--- /dev/null
+++ b/sys-libs/musl/files/musl-1.1.11-fix-codeset.patch
@@ -0,0 +1,12 @@
+diff -Naur musl-1.1.11.orig/src/locale/langinfo.c musl-1.1.11/src/locale/langinfo.c
+--- musl-1.1.11.orig/src/locale/langinfo.c	2015-08-30 00:15:56.000000000 -0400
++++ musl-1.1.11/src/locale/langinfo.c	2015-09-08 15:46:26.717980251 -0400
+@@ -34,7 +34,7 @@
+ 	const char *str;
+ 
+ 	if (item == CODESET)
+-		return MB_CUR_MAX==1 ? "UTF-8-CODE-UNITS" : "UTF-8";
++		return "UTF-8";
+ 	
+ 	switch (cat) {
+ 	case LC_NUMERIC:

diff --git a/sys-libs/musl/musl-1.1.11-r1.ebuild b/sys-libs/musl/musl-1.1.11-r1.ebuild
new file mode 100644
index 0000000..011baca
--- /dev/null
+++ b/sys-libs/musl/musl-1.1.11-r1.ebuild
@@ -0,0 +1,129 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils flag-o-matic multilib toolchain-funcs
+if [[ ${PV} == "9999" ]] ; then
+	EGIT_REPO_URI="git://git.musl-libc.org/musl"
+	inherit git-2
+fi
+
+export CBUILD=${CBUILD:-${CHOST}}
+export CTARGET=${CTARGET:-${CHOST}}
+if [[ ${CTARGET} == ${CHOST} ]] ; then
+	if [[ ${CATEGORY} == cross-* ]] ; then
+		export CTARGET=${CATEGORY#cross-}
+	fi
+fi
+
+DESCRIPTION="Lightweight, fast and simple C library focused on standards-conformance and safety"
+HOMEPAGE="http://www.musl-libc.org/"
+if [[ ${PV} != "9999" ]] ; then
+	PATCH_VER=""
+	SRC_URI="http://www.musl-libc.org/releases/${P}.tar.gz"
+	KEYWORDS="-* ~amd64 ~arm ~mips ~ppc ~x86"
+fi
+
+LICENSE="MIT LGPL-2 GPL-2"
+SLOT="0"
+IUSE="crosscompile_opts_headers-only"
+
+RDEPEND="!sys-apps/getent"
+
+is_crosscompile() {
+	[[ ${CHOST} != ${CTARGET} ]]
+}
+
+just_headers() {
+	use crosscompile_opts_headers-only && is_crosscompile
+}
+
+musl_endian() {
+	# XXX: this wont work for bi-endian, but we dont have any
+	touch "${T}"/endian.s
+	$(tc-getAS ${CTARGET}) "${T}"/endian.s -o "${T}"/endian.o
+	case $(file "${T}"/endian.o) in
+		*" MSB "*) echo "";;
+		*" LSB "*) echo "el";;
+		*)         echo "nfc";; # We shouldn't be here
+	esac
+}
+
+pkg_setup() {
+	if [ ${CTARGET} == ${CHOST} ] ; then
+		case ${CHOST} in
+		*-musl*) ;;
+		*) die "Use sys-devel/crossdev to build a musl toolchain" ;;
+		esac
+	fi
+}
+
+src_prepare() {
+	epatch "${FILESDIR}"/${P}-fix-codeset.patch
+	epatch_user
+}
+
+src_configure() {
+	tc-getCC ${CTARGET}
+	just_headers && export CC=true
+
+	local sysroot
+	is_crosscompile && sysroot=/usr/${CTARGET}
+	./configure \
+		--target=${CTARGET} \
+		--prefix=${sysroot}/usr \
+		--syslibdir=${sysroot}/lib \
+		--disable-gcc-wrapper
+}
+
+src_compile() {
+	emake include/bits/alltypes.h || die
+	just_headers && return 0
+
+	emake || die
+}
+
+src_install() {
+	local target="install"
+	just_headers && target="install-headers"
+	emake DESTDIR="${D}" ${target} || die
+	just_headers && return 0
+
+	# musl provides ldd via a sym link to its ld.so
+	local sysroot
+	is_crosscompile && sysroot=/usr/${CTARGET}
+	local ldso=$(basename "${D}"${sysroot}/lib/ld-musl-*)
+	dosym ${sysroot}/lib/${ldso} ${sysroot}/usr/bin/ldd
+
+	if [[ ${CATEGORY} != cross-* ]] ; then
+		local target=$(tc-arch) arch
+		local endian=$(musl_endian)
+		case ${target} in
+			amd64) arch="x86_64";;
+			arm)   arch="armhf";; # We only have hardfloat right now
+			mips)  arch="mips${endian}";;
+			ppc)   arch="powerpc";;
+			x86)   arch="i386";;
+		esac
+		cp "${FILESDIR}"/ldconfig.in "${T}"
+		sed -e "s|@@ARCH@@|${arch}|" "${T}"/ldconfig.in > "${T}"/ldconfig
+		into /
+		dosbin "${T}"/ldconfig
+		into /usr
+		dobin "${FILESDIR}"/getent
+		echo 'LDPATH="include ld.so.conf.d/*.conf"' > "${T}"/00musl
+		doenvd "${T}"/00musl || die
+	fi
+}
+
+pkg_postinst() {
+	is_crosscompile && return 0
+
+	[ "${ROOT}" != "/" ] && return 0
+
+	ldconfig
+	# reload init ...
+	/sbin/telinit U 2>/dev/null
+}


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: sys-libs/musl/files/, sys-libs/musl/
@ 2015-10-21 19:20 Anthony G. Basile
  0 siblings, 0 replies; 7+ messages in thread
From: Anthony G. Basile @ 2015-10-21 19:20 UTC (permalink / raw
  To: gentoo-commits

commit:     25b0aefa56557cbb4fc6e1e17b9776f9611cfeb6
Author:     Anthony G. Basile <blueness <AT> gentoo <DOT> org>
AuthorDate: Wed Oct 21 19:26:34 2015 +0000
Commit:     Anthony G. Basile <blueness <AT> gentoo <DOT> org>
CommitDate: Wed Oct 21 19:26:59 2015 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=25b0aefa

sys-libs/musl: remove older stable versions.

Package-Manager: portage-2.2.20.1

 sys-libs/musl/Manifest                             |   1 -
 .../musl/files/musl-1.1.10-uselocale-0-fix.diff    |  25 ----
 sys-libs/musl/musl-1.1.10-r1.ebuild                | 129 ---------------------
 sys-libs/musl/musl-1.1.11.ebuild                   | 128 --------------------
 4 files changed, 283 deletions(-)

diff --git a/sys-libs/musl/Manifest b/sys-libs/musl/Manifest
index 86e2f73..d896113 100644
--- a/sys-libs/musl/Manifest
+++ b/sys-libs/musl/Manifest
@@ -1,3 +1,2 @@
-DIST musl-1.1.10.tar.gz 907181 SHA256 45bbe9b1c7f7a0f743477af1e103b6889bfe4dd9815e16f6c89f6c90831c8b7c SHA512 183a66a8cc9cd056a8387a1602dd44b502d8976642a21dd0dcef51165fa0dec8a4a124fda6c1918f402b20ad2d6037fcc188a8b174b07a0cbedf11fc2e011141 WHIRLPOOL b69737c22a77da0ff59886d8233b9b1d43228e75bfdf857a5a74ab26f4699564c5b54390bcf171a4f4d9c8fc211f4c6e9c6d4dd6802cc01a5dfe5369bbdd8158
 DIST musl-1.1.11.tar.gz 915244 SHA256 bb9e6da51b7b12641f5d1abb39705c6c6c1b2fbd20002362948aa736a0aa353f SHA512 573131fe7a2c5a9c9bf796a5fc02e6ec093148648b9b43dc13d9c85e5777b1691499af6f673075a0d2b4b36c788b4dd7d72eb450c6ec3a586901bd410ee1ea6d WHIRLPOOL 17d5299b7554124ec49c2309f9385313cffe0f2126812bbcce87a142b2138153b5634579a33554edba6b76aab87f96ef2bb5dc0773cc9b930356b7da6e0b61fb
 DIST musl-1.1.12.tar.gz 918757 SHA256 720b83c7e276b4b679c0bffe9509340d5f81fd601508e607e708177df0d31c0e SHA512 7cabbe2665e32bd3408c8865f89f474106e982b4e5de81d0cdeea19e19e20b4d2496faf1adc6b2811d996f30f39258184ba347e8eb5f3811eab89179e8f52d70 WHIRLPOOL cd500c3457be42d8dd927420d2352bda87e7b424fabf19fbd387858b913636793a7ff8d0e249bcc292e58c6d0d3889738c8790f3a6409d6df2da81408a77238c

diff --git a/sys-libs/musl/files/musl-1.1.10-uselocale-0-fix.diff b/sys-libs/musl/files/musl-1.1.10-uselocale-0-fix.diff
deleted file mode 100644
index 2785195..0000000
--- a/sys-libs/musl/files/musl-1.1.10-uselocale-0-fix.diff
+++ /dev/null
@@ -1,25 +0,0 @@
->From 63f4b9f18f3674124d8bcb119739fec85e6da005 Mon Sep 17 00:00:00 2001
-From: Timo Teräs <timo.teras@iki.fi>
-Date: Fri, 05 Jun 2015 07:39:42 +0000
-Subject: fix uselocale((locale_t)0) not to modify locale
-
-commit 68630b55c0c7219fe9df70dc28ffbf9efc8021d8 made the new locale to
-be assigned unconditonally resulting in crashes later on.
----
-diff --git a/src/locale/uselocale.c b/src/locale/uselocale.c
-index b70a0c1..0fc5ecb 100644
---- a/src/locale/uselocale.c
-+++ b/src/locale/uselocale.c
-@@ -8,9 +8,7 @@ locale_t __uselocale(locale_t new)
- 	locale_t old = self->locale;
- 	locale_t global = &libc.global_locale;
- 
--	if (new == LC_GLOBAL_LOCALE) new = global;
--
--	self->locale = new;
-+	if (new) self->locale = new == LC_GLOBAL_LOCALE ? global : new;
- 
- 	return old == global ? LC_GLOBAL_LOCALE : old;
- }
---
-cgit v0.9.0.3-65-g4555

diff --git a/sys-libs/musl/musl-1.1.10-r1.ebuild b/sys-libs/musl/musl-1.1.10-r1.ebuild
deleted file mode 100644
index d6830e2..0000000
--- a/sys-libs/musl/musl-1.1.10-r1.ebuild
+++ /dev/null
@@ -1,129 +0,0 @@
-# Copyright 1999-2015 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id$
-
-EAPI=5
-
-inherit eutils flag-o-matic multilib toolchain-funcs
-if [[ ${PV} == "9999" ]] ; then
-	EGIT_REPO_URI="git://git.musl-libc.org/musl"
-	inherit git-2
-fi
-
-export CBUILD=${CBUILD:-${CHOST}}
-export CTARGET=${CTARGET:-${CHOST}}
-if [[ ${CTARGET} == ${CHOST} ]] ; then
-	if [[ ${CATEGORY} == cross-* ]] ; then
-		export CTARGET=${CATEGORY#cross-}
-	fi
-fi
-
-DESCRIPTION="Lightweight, fast and simple C library focused on standards-conformance and safety"
-HOMEPAGE="http://www.musl-libc.org/"
-if [[ ${PV} != "9999" ]] ; then
-	PATCH_VER=""
-	SRC_URI="http://www.musl-libc.org/releases/${P}.tar.gz"
-	KEYWORDS="-* amd64 arm ~mips ppc x86"
-fi
-
-LICENSE="MIT LGPL-2 GPL-2"
-SLOT="0"
-IUSE="crosscompile_opts_headers-only"
-
-RDEPEND="!sys-apps/getent"
-
-is_crosscompile() {
-	[[ ${CHOST} != ${CTARGET} ]]
-}
-
-just_headers() {
-	use crosscompile_opts_headers-only && is_crosscompile
-}
-
-musl_endian() {
-	# XXX: this wont work for bi-endian, but we dont have any
-	touch "${T}"/endian.s
-	$(tc-getAS ${CTARGET}) "${T}"/endian.s -o "${T}"/endian.o
-	case $(file "${T}"/endian.o) in
-		*" MSB "*) echo "";;
-		*" LSB "*) echo "el";;
-		*)         echo "nfc";; # We shouldn't be here
-	esac
-}
-
-pkg_setup() {
-	if [ ${CTARGET} == ${CHOST} ] ; then
-		case ${CHOST} in
-		*-musl*) ;;
-		*) die "Use sys-devel/crossdev to build a musl toolchain" ;;
-		esac
-	fi
-}
-
-src_prepare() {
-	epatch "${FILESDIR}"/${P}-uselocale-0-fix.diff
-	epatch_user
-}
-
-src_configure() {
-	tc-getCC ${CTARGET}
-	just_headers && export CC=true
-
-	local sysroot
-	is_crosscompile && sysroot=/usr/${CTARGET}
-	./configure \
-		--target=${CTARGET} \
-		--prefix=${sysroot}/usr \
-		--syslibdir=${sysroot}/lib \
-		--disable-gcc-wrapper
-}
-
-src_compile() {
-	emake include/bits/alltypes.h || die
-	just_headers && return 0
-
-	emake || die
-}
-
-src_install() {
-	local target="install"
-	just_headers && target="install-headers"
-	emake DESTDIR="${D}" ${target} || die
-	just_headers && return 0
-
-	# musl provides ldd via a sym link to its ld.so
-	local sysroot
-	is_crosscompile && sysroot=/usr/${CTARGET}
-	local ldso=$(basename "${D}"${sysroot}/lib/ld-musl-*)
-	dosym ${sysroot}/lib/${ldso} ${sysroot}/usr/bin/ldd
-
-	if [[ ${CATEGORY} != cross-* ]] ; then
-		local target=$(tc-arch) arch
-		local endian=$(musl_endian)
-		case ${target} in
-			amd64) arch="x86_64";;
-			arm)   arch="armhf";; # We only have hardfloat right now
-			mips)  arch="mips${endian}";;
-			ppc)   arch="powerpc";;
-			x86)   arch="i386";;
-		esac
-		cp "${FILESDIR}"/ldconfig.in "${T}"
-		sed -e "s|@@ARCH@@|${arch}|" "${T}"/ldconfig.in > "${T}"/ldconfig
-		into /
-		dosbin "${T}"/ldconfig
-		into /usr
-		dobin "${FILESDIR}"/getent
-		echo 'LDPATH="include ld.so.conf.d/*.conf"' > "${T}"/00musl
-		doenvd "${T}"/00musl || die
-	fi
-}
-
-pkg_postinst() {
-	is_crosscompile && return 0
-
-	[ "${ROOT}" != "/" ] && return 0
-
-	ldconfig
-	# reload init ...
-	/sbin/telinit U 2>/dev/null
-}

diff --git a/sys-libs/musl/musl-1.1.11.ebuild b/sys-libs/musl/musl-1.1.11.ebuild
deleted file mode 100644
index 8fe6feb..0000000
--- a/sys-libs/musl/musl-1.1.11.ebuild
+++ /dev/null
@@ -1,128 +0,0 @@
-# Copyright 1999-2015 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id$
-
-EAPI=5
-
-inherit eutils flag-o-matic multilib toolchain-funcs
-if [[ ${PV} == "9999" ]] ; then
-	EGIT_REPO_URI="git://git.musl-libc.org/musl"
-	inherit git-2
-fi
-
-export CBUILD=${CBUILD:-${CHOST}}
-export CTARGET=${CTARGET:-${CHOST}}
-if [[ ${CTARGET} == ${CHOST} ]] ; then
-	if [[ ${CATEGORY} == cross-* ]] ; then
-		export CTARGET=${CATEGORY#cross-}
-	fi
-fi
-
-DESCRIPTION="Lightweight, fast and simple C library focused on standards-conformance and safety"
-HOMEPAGE="http://www.musl-libc.org/"
-if [[ ${PV} != "9999" ]] ; then
-	PATCH_VER=""
-	SRC_URI="http://www.musl-libc.org/releases/${P}.tar.gz"
-	KEYWORDS="-* amd64 arm ~mips ppc x86"
-fi
-
-LICENSE="MIT LGPL-2 GPL-2"
-SLOT="0"
-IUSE="crosscompile_opts_headers-only"
-
-RDEPEND="!sys-apps/getent"
-
-is_crosscompile() {
-	[[ ${CHOST} != ${CTARGET} ]]
-}
-
-just_headers() {
-	use crosscompile_opts_headers-only && is_crosscompile
-}
-
-musl_endian() {
-	# XXX: this wont work for bi-endian, but we dont have any
-	touch "${T}"/endian.s
-	$(tc-getAS ${CTARGET}) "${T}"/endian.s -o "${T}"/endian.o
-	case $(file "${T}"/endian.o) in
-		*" MSB "*) echo "";;
-		*" LSB "*) echo "el";;
-		*)         echo "nfc";; # We shouldn't be here
-	esac
-}
-
-pkg_setup() {
-	if [ ${CTARGET} == ${CHOST} ] ; then
-		case ${CHOST} in
-		*-musl*) ;;
-		*) die "Use sys-devel/crossdev to build a musl toolchain" ;;
-		esac
-	fi
-}
-
-src_prepare() {
-	epatch_user
-}
-
-src_configure() {
-	tc-getCC ${CTARGET}
-	just_headers && export CC=true
-
-	local sysroot
-	is_crosscompile && sysroot=/usr/${CTARGET}
-	./configure \
-		--target=${CTARGET} \
-		--prefix=${sysroot}/usr \
-		--syslibdir=${sysroot}/lib \
-		--disable-gcc-wrapper
-}
-
-src_compile() {
-	emake include/bits/alltypes.h || die
-	just_headers && return 0
-
-	emake || die
-}
-
-src_install() {
-	local target="install"
-	just_headers && target="install-headers"
-	emake DESTDIR="${D}" ${target} || die
-	just_headers && return 0
-
-	# musl provides ldd via a sym link to its ld.so
-	local sysroot
-	is_crosscompile && sysroot=/usr/${CTARGET}
-	local ldso=$(basename "${D}"${sysroot}/lib/ld-musl-*)
-	dosym ${sysroot}/lib/${ldso} ${sysroot}/usr/bin/ldd
-
-	if [[ ${CATEGORY} != cross-* ]] ; then
-		local target=$(tc-arch) arch
-		local endian=$(musl_endian)
-		case ${target} in
-			amd64) arch="x86_64";;
-			arm)   arch="armhf";; # We only have hardfloat right now
-			mips)  arch="mips${endian}";;
-			ppc)   arch="powerpc";;
-			x86)   arch="i386";;
-		esac
-		cp "${FILESDIR}"/ldconfig.in "${T}"
-		sed -e "s|@@ARCH@@|${arch}|" "${T}"/ldconfig.in > "${T}"/ldconfig
-		into /
-		dosbin "${T}"/ldconfig
-		into /usr
-		dobin "${FILESDIR}"/getent
-		echo 'LDPATH="include ld.so.conf.d/*.conf"' > "${T}"/00musl
-		doenvd "${T}"/00musl || die
-	fi
-}
-
-pkg_postinst() {
-	is_crosscompile && return 0
-
-	[ "${ROOT}" != "/" ] && return 0
-
-	ldconfig
-	# reload init ...
-	/sbin/telinit U 2>/dev/null
-}


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: sys-libs/musl/files/, sys-libs/musl/
@ 2016-02-16 23:22 Anthony G. Basile
  0 siblings, 0 replies; 7+ messages in thread
From: Anthony G. Basile @ 2016-02-16 23:22 UTC (permalink / raw
  To: gentoo-commits

commit:     a77db1ace19e04f6da7ac180cc035ccf567c0ff2
Author:     Anthony G. Basile <blueness <AT> gentoo <DOT> org>
AuthorDate: Tue Feb 16 23:30:40 2016 +0000
Commit:     Anthony G. Basile <blueness <AT> gentoo <DOT> org>
CommitDate: Tue Feb 16 23:31:29 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a77db1ac

sys-libs/musl: version bump to 1.1.13

Package-Manager: portage-2.2.26

 sys-libs/musl/Manifest                                 |  1 +
 sys-libs/musl/files/musl-1.1.11-fix-codeset.patch      | 12 ------------
 sys-libs/musl/musl-1.1.12.ebuild                       |  4 ++--
 sys-libs/musl/{musl-9999.ebuild => musl-1.1.13.ebuild} |  4 ++--
 sys-libs/musl/musl-9999.ebuild                         |  4 ++--
 5 files changed, 7 insertions(+), 18 deletions(-)

diff --git a/sys-libs/musl/Manifest b/sys-libs/musl/Manifest
index a4d3803..6b764e3 100644
--- a/sys-libs/musl/Manifest
+++ b/sys-libs/musl/Manifest
@@ -1 +1,2 @@
 DIST musl-1.1.12.tar.gz 918757 SHA256 720b83c7e276b4b679c0bffe9509340d5f81fd601508e607e708177df0d31c0e SHA512 7cabbe2665e32bd3408c8865f89f474106e982b4e5de81d0cdeea19e19e20b4d2496faf1adc6b2811d996f30f39258184ba347e8eb5f3811eab89179e8f52d70 WHIRLPOOL cd500c3457be42d8dd927420d2352bda87e7b424fabf19fbd387858b913636793a7ff8d0e249bcc292e58c6d0d3889738c8790f3a6409d6df2da81408a77238c
+DIST musl-1.1.13.tar.gz 894640 SHA256 bbacdc64f557d0c4857f7d2daf592c32c29aec1babbb94fcf01a2e05bed15013 SHA512 d5f4a6fdb6a2cdbd7ab1ad5a8d91b1c690b3bd31d9049dfc022067019bba11952e375374eed982a0ddac7347d17f9ff2300178c4d5f27bdd8480933cc6e67802 WHIRLPOOL 4e419cebdb4deef4f0828d2b762783e40b1292048c6ba94ba70c48ef5277a1410fe1724ef242e8cab6db51e167e87496de3a8e7c4c016dcd17eadff8d3b3b7fe

diff --git a/sys-libs/musl/files/musl-1.1.11-fix-codeset.patch b/sys-libs/musl/files/musl-1.1.11-fix-codeset.patch
deleted file mode 100644
index e846f5f..0000000
--- a/sys-libs/musl/files/musl-1.1.11-fix-codeset.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff -Naur musl-1.1.11.orig/src/locale/langinfo.c musl-1.1.11/src/locale/langinfo.c
---- musl-1.1.11.orig/src/locale/langinfo.c	2015-08-30 00:15:56.000000000 -0400
-+++ musl-1.1.11/src/locale/langinfo.c	2015-09-08 15:46:26.717980251 -0400
-@@ -34,7 +34,7 @@
- 	const char *str;
- 
- 	if (item == CODESET)
--		return MB_CUR_MAX==1 ? "UTF-8-CODE-UNITS" : "UTF-8";
-+		return "UTF-8";
- 	
- 	switch (cat) {
- 	case LC_NUMERIC:

diff --git a/sys-libs/musl/musl-1.1.12.ebuild b/sys-libs/musl/musl-1.1.12.ebuild
index 239a045..574b31f 100644
--- a/sys-libs/musl/musl-1.1.12.ebuild
+++ b/sys-libs/musl/musl-1.1.12.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2015 Gentoo Foundation
+# Copyright 1999-2016 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 # $Id$
 
@@ -18,7 +18,7 @@ if [[ ${CTARGET} == ${CHOST} ]] ; then
 	fi
 fi
 
-DESCRIPTION="Lightweight, fast and simple C library focused on standards-conformance and safety"
+DESCRIPTION="Light, fast and simple C library focused on standards-conformance and safety"
 HOMEPAGE="http://www.musl-libc.org/"
 if [[ ${PV} != "9999" ]] ; then
 	PATCH_VER=""

diff --git a/sys-libs/musl/musl-9999.ebuild b/sys-libs/musl/musl-1.1.13.ebuild
similarity index 95%
copy from sys-libs/musl/musl-9999.ebuild
copy to sys-libs/musl/musl-1.1.13.ebuild
index 016d210..e480468 100644
--- a/sys-libs/musl/musl-9999.ebuild
+++ b/sys-libs/musl/musl-1.1.13.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2015 Gentoo Foundation
+# Copyright 1999-2016 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 # $Id$
 
@@ -18,7 +18,7 @@ if [[ ${CTARGET} == ${CHOST} ]] ; then
 	fi
 fi
 
-DESCRIPTION="Lightweight, fast and simple C library focused on standards-conformance and safety"
+DESCRIPTION="Light, fast and simple C library focused on standards-conformance and safety"
 HOMEPAGE="http://www.musl-libc.org/"
 if [[ ${PV} != "9999" ]] ; then
 	PATCH_VER=""

diff --git a/sys-libs/musl/musl-9999.ebuild b/sys-libs/musl/musl-9999.ebuild
index 016d210..e480468 100644
--- a/sys-libs/musl/musl-9999.ebuild
+++ b/sys-libs/musl/musl-9999.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2015 Gentoo Foundation
+# Copyright 1999-2016 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 # $Id$
 
@@ -18,7 +18,7 @@ if [[ ${CTARGET} == ${CHOST} ]] ; then
 	fi
 fi
 
-DESCRIPTION="Lightweight, fast and simple C library focused on standards-conformance and safety"
+DESCRIPTION="Light, fast and simple C library focused on standards-conformance and safety"
 HOMEPAGE="http://www.musl-libc.org/"
 if [[ ${PV} != "9999" ]] ; then
 	PATCH_VER=""


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: sys-libs/musl/files/, sys-libs/musl/
@ 2020-11-24 15:00 Sam James
  0 siblings, 0 replies; 7+ messages in thread
From: Sam James @ 2020-11-24 15:00 UTC (permalink / raw
  To: gentoo-commits

commit:     8a8e70b0165c61ec95464968205a8cf06859e607
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Tue Nov 24 14:59:52 2020 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Tue Nov 24 14:59:59 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8a8e70b0

sys-libs/musl: security bump for CVE-2020-28928

Acked-by: Anthony G. Basile <blueness <AT> gentoo.org>
Bug: https://bugs.gentoo.org/755695
Package-Manager: Portage-3.0.9, Repoman-3.0.2
Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../musl/files/musl-1.2.1-CVE-2020-28928.patch     | 114 ++++++++++++++++++
 sys-libs/musl/musl-1.2.1-r1.ebuild                 | 133 +++++++++++++++++++++
 2 files changed, 247 insertions(+)

diff --git a/sys-libs/musl/files/musl-1.2.1-CVE-2020-28928.patch b/sys-libs/musl/files/musl-1.2.1-CVE-2020-28928.patch
new file mode 100644
index 00000000000..9797e92ec42
--- /dev/null
+++ b/sys-libs/musl/files/musl-1.2.1-CVE-2020-28928.patch
@@ -0,0 +1,114 @@
+https://bugs.gentoo.org/755695
+https://git.musl-libc.org/cgit/musl/patch/?id=3ab2a4e02682df1382955071919d8aa3c3ec40d4
+From 3ab2a4e02682df1382955071919d8aa3c3ec40d4 Mon Sep 17 00:00:00 2001
+From: Rich Felker <dalias@aerifal.cx>
+Date: Thu, 19 Nov 2020 17:12:43 -0500
+Subject: rewrite wcsnrtombs to fix buffer overflow and other bugs
+
+the original wcsnrtombs implementation, which has been largely
+untouched since 0.5.0, attempted to build input-length-limiting
+conversion on top of wcsrtombs, which only limits output length. as
+best I recall, this choice was made out of a mix of disdain over
+having yet another variant function to implement (added in POSIX 2008;
+not standard C) and preference not to switch things around and
+implement the wcsrtombs in terms of the more general new function,
+probably over namespace issues. the strategy employed was to impose
+output limits that would ensure the input limit wasn't exceeded, then
+finish up the tail character-at-a-time. unfortunately, none of that
+worked correctly.
+
+first, the logic in the wcsrtombs loop was wrong in that it could
+easily get stuck making no forward progress, by imposing an output
+limit too small to convert even one character.
+
+the character-at-a-time loop that followed was even worse. it made no
+effort to ensure that the converted multibyte character would fit in
+the remaining output space, only that there was a nonzero amount of
+output space remaining. it also employed an incorrect interpretation
+of wcrtomb's interface contract for converting the null character,
+thereby failing to act on end of input, and remaining space accounting
+was subject to unsigned wrap-around. together these errors allow
+unbounded overflow of the destination buffer, controlled by input
+length limit and input wchar_t string contents.
+
+given the extent to which this function was broken, it's plausible
+that most applications that would have been rendered exploitable were
+sufficiently broken not to be usable in the first place. however, it's
+also plausible that common (especially ASCII-only) inputs succeeded in
+the wcsrtombs loop, which mostly worked, while leaving the wildly
+erroneous code in the second loop exposed to particular non-ASCII
+inputs.
+
+CVE-2020-28928 has been assigned for this issue.
+---
+ src/multibyte/wcsnrtombs.c | 46 +++++++++++++++++++---------------------------
+ 1 file changed, 19 insertions(+), 27 deletions(-)
+
+diff --git a/src/multibyte/wcsnrtombs.c b/src/multibyte/wcsnrtombs.c
+index 676932b5..95e25e70 100644
+--- a/src/multibyte/wcsnrtombs.c
++++ b/src/multibyte/wcsnrtombs.c
+@@ -1,41 +1,33 @@
+ #include <wchar.h>
++#include <limits.h>
++#include <string.h>
+ 
+ size_t wcsnrtombs(char *restrict dst, const wchar_t **restrict wcs, size_t wn, size_t n, mbstate_t *restrict st)
+ {
+-	size_t l, cnt=0, n2;
+-	char *s, buf[256];
+ 	const wchar_t *ws = *wcs;
+-	const wchar_t *tmp_ws;
+-
+-	if (!dst) s = buf, n = sizeof buf;
+-	else s = dst;
+-
+-	while ( ws && n && ( (n2=wn)>=n || n2>32 ) ) {
+-		if (n2>=n) n2=n;
+-		tmp_ws = ws;
+-		l = wcsrtombs(s, &ws, n2, 0);
+-		if (!(l+1)) {
+-			cnt = l;
+-			n = 0;
++	size_t cnt = 0;
++	if (!dst) n=0;
++	while (ws && wn) {
++		char tmp[MB_LEN_MAX];
++		size_t l = wcrtomb(n<MB_LEN_MAX ? tmp : dst, *ws, 0);
++		if (l==-1) {
++			cnt = -1;
+ 			break;
+ 		}
+-		if (s != buf) {
+-			s += l;
++		if (dst) {
++			if (n<MB_LEN_MAX) {
++				if (l>n) break;
++				memcpy(dst, tmp, l);
++			}
++			dst += l;
+ 			n -= l;
+ 		}
+-		wn = ws ? wn - (ws - tmp_ws) : 0;
+-		cnt += l;
+-	}
+-	if (ws) while (n && wn) {
+-		l = wcrtomb(s, *ws, 0);
+-		if ((l+1)<=1) {
+-			if (!l) ws = 0;
+-			else cnt = l;
++		if (!*ws) {
++			ws = 0;
+ 			break;
+ 		}
+-		ws++; wn--;
+-		/* safe - this loop runs fewer than sizeof(buf) times */
+-		s+=l; n-=l;
++		ws++;
++		wn--;
+ 		cnt += l;
+ 	}
+ 	if (dst) *wcs = ws;
+-- 
+cgit v1.2.1
+

diff --git a/sys-libs/musl/musl-1.2.1-r1.ebuild b/sys-libs/musl/musl-1.2.1-r1.ebuild
new file mode 100644
index 00000000000..05a55e96e2d
--- /dev/null
+++ b/sys-libs/musl/musl-1.2.1-r1.ebuild
@@ -0,0 +1,133 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit eutils flag-o-matic multilib toolchain-funcs
+if [[ ${PV} == "9999" ]] ; then
+	EGIT_REPO_URI="git://git.musl-libc.org/musl"
+	inherit git-r3
+	SRC_URI="
+	https://dev.gentoo.org/~blueness/musl-misc/getconf.c
+	https://dev.gentoo.org/~blueness/musl-misc/getent.c
+	https://dev.gentoo.org/~blueness/musl-misc/iconv.c"
+	KEYWORDS=""
+else
+	SRC_URI="http://www.musl-libc.org/releases/${P}.tar.gz
+	https://dev.gentoo.org/~blueness/musl-misc/getconf.c
+	https://dev.gentoo.org/~blueness/musl-misc/getent.c
+	https://dev.gentoo.org/~blueness/musl-misc/iconv.c"
+	KEYWORDS="-* ~amd64 ~arm ~arm64 ~mips ~ppc ~ppc64 ~x86"
+fi
+
+export CBUILD=${CBUILD:-${CHOST}}
+export CTARGET=${CTARGET:-${CHOST}}
+if [[ ${CTARGET} == ${CHOST} ]] ; then
+	if [[ ${CATEGORY} == cross-* ]] ; then
+		export CTARGET=${CATEGORY#cross-}
+	fi
+fi
+
+DESCRIPTION="Light, fast and simple C library focused on standards-conformance and safety"
+HOMEPAGE="http://www.musl-libc.org/"
+LICENSE="MIT LGPL-2 GPL-2"
+SLOT="0"
+IUSE="headers-only"
+
+QA_SONAME="/usr/lib/libc.so"
+QA_DT_NEEDED="/usr/lib/libc.so"
+
+PATCHES=(
+	"${FILESDIR}/${P}-CVE-2020-28928.patch"
+)
+
+is_crosscompile() {
+	[[ ${CHOST} != ${CTARGET} ]]
+}
+
+just_headers() {
+	use headers-only && is_crosscompile
+}
+
+pkg_setup() {
+	if [ ${CTARGET} == ${CHOST} ] ; then
+		case ${CHOST} in
+		*-musl*) ;;
+		*) die "Use sys-devel/crossdev to build a musl toolchain" ;;
+		esac
+	fi
+
+	# fix for #667126, copied from glibc ebuild
+	# make sure host make.conf doesn't pollute us
+	if is_crosscompile || tc-is-cross-compiler ; then
+		CHOST=${CTARGET} strip-unsupported-flags
+	fi
+}
+
+src_configure() {
+	tc-getCC ${CTARGET}
+	just_headers && export CC=true
+
+	local sysroot
+	is_crosscompile && sysroot=/usr/${CTARGET}
+	./configure \
+		--target=${CTARGET} \
+		--prefix=${sysroot}/usr \
+		--syslibdir=${sysroot}/lib \
+		--disable-gcc-wrapper || die
+}
+
+src_compile() {
+	emake obj/include/bits/alltypes.h
+	just_headers && return 0
+
+	emake
+	if [[ ${CATEGORY} != cross-* ]] ; then
+		emake -C "${T}" getconf getent iconv \
+			CC="$(tc-getCC)" \
+			CFLAGS="${CFLAGS}" \
+			CPPFLAGS="${CPPFLAGS}" \
+			LDFLAGS="${LDFLAGS}" \
+			VPATH="${DISTDIR}"
+	fi
+}
+
+src_install() {
+	local target="install"
+	just_headers && target="install-headers"
+	emake DESTDIR="${D}" ${target}
+	just_headers && return 0
+
+	# musl provides ldd via a sym link to its ld.so
+	local sysroot
+	is_crosscompile && sysroot=/usr/${CTARGET}
+	local ldso=$(basename "${D}"${sysroot}/lib/ld-musl-*)
+	dosym ${sysroot}/lib/${ldso} ${sysroot}/usr/bin/ldd
+
+	if [[ ${CATEGORY} != cross-* ]] ; then
+		# Fish out of config:
+		#   ARCH = ...
+		#   SUBARCH = ...
+		# and print $(ARCH)$(SUBARCH).
+		local arch=$(awk '{ k[$1] = $3 } END { printf("%s%s", k["ARCH"], k["SUBARCH"]); }' config.mak)
+		[[ -e "${D}"/lib/ld-musl-${arch}.so.1 ]] || die
+		cp "${FILESDIR}"/ldconfig.in "${T}" || die
+		sed -e "s|@@ARCH@@|${arch}|" "${T}"/ldconfig.in > "${T}"/ldconfig || die
+		into /
+		dosbin "${T}"/ldconfig
+		into /usr
+		dobin "${T}"/getconf
+		dobin "${T}"/getent
+		dobin "${T}"/iconv
+		echo 'LDPATH="include ld.so.conf.d/*.conf"' > "${T}"/00musl || die
+		doenvd "${T}"/00musl
+	fi
+}
+
+pkg_postinst() {
+	is_crosscompile && return 0
+
+	[ "${ROOT}" != "/" ] && return 0
+
+	ldconfig || die
+}


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: sys-libs/musl/files/, sys-libs/musl/
@ 2021-08-16  0:59 Jory Pratt
  0 siblings, 0 replies; 7+ messages in thread
From: Jory Pratt @ 2021-08-16  0:59 UTC (permalink / raw
  To: gentoo-commits

commit:     2dab1e0a3d9d88883019be43fa70b85d29c30338
Author:     Jory Pratt <anarchy <AT> gentoo <DOT> org>
AuthorDate: Mon Aug 16 00:55:49 2021 +0000
Commit:     Jory Pratt <anarchy <AT> gentoo <DOT> org>
CommitDate: Mon Aug 16 00:59:09 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2dab1e0a

sys-libs/musl: extend gethostid for zfs users

Package-Manager: Portage-3.0.20, Repoman-3.0.3
Signed-off-by: Jory Pratt <anarchy <AT> gentoo.org>

 sys-libs/musl/files/musl-1.2.2-gethostid.patch     | 43 ++++++++++++++++++++++
 .../{musl-1.2.2-r2.ebuild => musl-1.2.2-r3.ebuild} |  7 ++++
 2 files changed, 50 insertions(+)

diff --git a/sys-libs/musl/files/musl-1.2.2-gethostid.patch b/sys-libs/musl/files/musl-1.2.2-gethostid.patch
new file mode 100644
index 00000000000..96c799cfca2
--- /dev/null
+++ b/sys-libs/musl/files/musl-1.2.2-gethostid.patch
@@ -0,0 +1,43 @@
+Subject: [musl] [PATCH] extend gethostid beyond a stub
+Archived-At: <https://inbox.vuxu.org/musl/20210420191519.23822-3-ericonr@disroot.org/>
+List-Archive: <https://inbox.vuxu.org/musl/>
+List-Post: <mailto:musl@inbox.vuxu.org>
+
+From: Érico Rolim <erico.erc@gmail.com>
+
+Implement part of the glibc behavior, where the 32-bit identifier stored
+in /etc/hostid, if the file exists, is returned. If this file doesn't
+contain at least 32 bits or can't be opened for some reason, return 0.
+---
+ src/misc/gethostid.c | 15 ++++++++++++++-
+ 1 file changed, 14 insertions(+), 1 deletion(-)
+
+diff --git a/src/misc/gethostid.c b/src/misc/gethostid.c
+index 25bb35db..d529de9c 100644
+--- a/src/misc/gethostid.c
++++ b/src/misc/gethostid.c
+@@ -1,6 +1,19 @@
+ #include <unistd.h>
++#include <stdio.h>
++#include <stdint.h>
+ 
+ long gethostid()
+ {
+-	return 0;
++	FILE *f;
++	int32_t rv = 0;
++
++	f = fopen("/etc/hostid", "reb");
++	if (f) {
++		if (fread(&rv, sizeof(rv), 1, f) == 0) {
++			rv = 0;
++		}
++		fclose(f);
++	}
++
++	return rv;
+ }
+-- 
+2.31.1
+
+

diff --git a/sys-libs/musl/musl-1.2.2-r2.ebuild b/sys-libs/musl/musl-1.2.2-r3.ebuild
similarity index 96%
rename from sys-libs/musl/musl-1.2.2-r2.ebuild
rename to sys-libs/musl/musl-1.2.2-r3.ebuild
index 905348ba854..465a763222d 100644
--- a/sys-libs/musl/musl-1.2.2-r2.ebuild
+++ b/sys-libs/musl/musl-1.2.2-r3.ebuild
@@ -71,6 +71,13 @@ src_unpack() {
 	cp "${DISTDIR}"/iconv.c misc/iconv.c || die
 }
 
+src_prepare() {
+	default
+
+	# Expand gethostid instead of being just a stub
+	eapply "${FILESDIR}/${PN}-1.2.2-gethostid.patch"
+}	
+
 src_configure() {
 	tc-getCC ${CTARGET}
 	just_headers && export CC=true


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: sys-libs/musl/files/, sys-libs/musl/
@ 2021-11-19  3:03 Sam James
  0 siblings, 0 replies; 7+ messages in thread
From: Sam James @ 2021-11-19  3:03 UTC (permalink / raw
  To: gentoo-commits

commit:     06610095bb404e85cbfcac2d8dda452f7b4a3f37
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Thu Nov 18 01:06:04 2021 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Nov 19 03:02:42 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=06610095

sys-libs/musl: use ebuild-like Bash style in ldconfig

Signed-off-by: Sam James <sam <AT> gentoo.org>
Closes: https://github.com/gentoo/gentoo/pull/22984
Signed-off-by: Sam James <sam <AT> gentoo.org>

 sys-libs/musl/files/ldconfig.in-r1 | 90 +++++++++++++++++++-------------------
 sys-libs/musl/musl-9999.ebuild     |  2 +-
 2 files changed, 46 insertions(+), 46 deletions(-)

diff --git a/sys-libs/musl/files/ldconfig.in-r1 b/sys-libs/musl/files/ldconfig.in-r1
index 14aa7c3466b8..1b565baf9eed 100644
--- a/sys-libs/musl/files/ldconfig.in-r1
+++ b/sys-libs/musl/files/ldconfig.in-r1
@@ -17,38 +17,38 @@ get_options() {
 			VERBOSE=1
 			;;
 		r)
-			ROOT=$OPTARG
-			LDSO_CONF=$ROOT$LDSO_CONF
-			LDSO_CONF_DIR=$(dirname $LDSO_CONF)
+			ROOT=${OPTARG}
+			LDSO_CONF=${ROOT}${LDSO_CONF}
+			LDSO_CONF_DIR=$(dirname ${LDSO_CONF})
 			;;
 		f)
-			LDSO_CONF=$OPTARG
+			LDSO_CONF=${OPTARG}
 			;;
 		X)
 			UPDATE_LINKS=0
 			;;
 		\?)
-			echo "Invalid option: -$opt" >&2
+			echo "Invalid option: -${opt}" >&2
 			exit 1
 			;;
 		n|N|C|p)
-			echo "Unimplemented option: -$opt" >&2
+			echo "Unimplemented option: -${opt}" >&2
 			exit 1
 			;;
 		esac
 	done
 
-	if [[ $UPDATE_LINKS == 1 ]]; then
+	if [[ ${UPDATE_LINKS} == 1 ]]; then
 		echo "Updating links is not implemented."
 	fi
 }
 
 
 repeated() {
-	local l=$1
+	local l=${1}
 	local drs="${@:2}"
-	for m in $drs; do
-		[[ $m == $l ]] && return 0
+	for m in ${drs}; do
+		[[ ${m} == ${l} ]] && return 0
 	done
 	return 1
 }
@@ -56,24 +56,24 @@ repeated() {
 expand() {
 	# We are assuming the ld.so.conf's 'include' is not recursive
 	local f line l
-	local glob="$LDSO_CONF_DIR/$1"
+	local glob="${LDSO_CONF_DIR}/${1}"
 	local drs="${@:2} "
 
-	for f in $glob; do
-		[[ ! -f $f ]] && continue
+	for f in ${glob}; do
+		[[ ! -f ${f} ]] && continue
 		while read line; do
 			line=${line%%#*}
 			line=${line//:/ }
 			line=${line//,/ }
-			for l in $line; do
-				#We must add this whether or not the directory exists
-				repeated $l $drs && continue
-				drs+=" $l "
+			for l in ${line}; do
+				# We must add this whether or not the directory exists
+				repeated ${l} ${drs} && continue
+				drs+=" ${l} "
 			done
-		done < $f
+		done < ${f}
 	done
 
-	echo $drs
+	echo ${drs}
 }
 
 read_ldso_conf() {
@@ -88,60 +88,60 @@ read_ldso_conf() {
 		line=${line//,/ }  # Change comma delimiter to space
 
 		next=0
-		for l in $line; do
-			if [[ $next == 1 ]]; then
+		for l in ${line}; do
+			if [[ ${next} == 1 ]]; then
 				next=0
-				drs=$(expand $l $drs)
-			elif [[ $l == "include" ]]; then
+				drs=$(expand ${l} ${drs})
+			elif [[ ${l} == "include" ]]; then
 				next=1
 			else
 				# glibc's ldconfig silently skips non directories
-				if [[ -d $l ]]; then
-					repeated $l $drs && continue
-					drs+=" $l "
+				if [[ -d ${l} ]]; then
+					repeated ${l} ${drs} && continue
+					drs+=" ${l} "
 				fi
 			fi
 		done
-	done < $1
+	done < ${1}
 
-	echo $drs
+	echo ${drs}
 }
 
 sanitize() {
 	local drs=$@
 
-	repeated "/lib" $drs || drs="/lib $drs"
-	repeated "/usr/lib" $drs || drs="/usr/lib $drs"
+	repeated "/lib" ${drs} || drs="/lib ${drs}"
+	repeated "/usr/lib" ${drs} || drs="/usr/lib ${drs}"
 
-	echo $drs
+	echo ${drs}
 }
 
 get_options "$@"
 
-if [[ ! -e $LDSO_CONF ]]; then
-        echo "$LDSO_CONF not found" >&2
+if [[ ! -e ${LDSO_CONF} ]]; then
+        echo "${LDSO_CONF} not found" >&2
         exit 1
 fi
 
-LDSO_CONF_DIR=$(dirname $LDSO_CONF)
+LDSO_CONF_DIR=$(dirname ${LDSO_CONF})
 
-drs=$(read_ldso_conf "$LDSO_CONF")
-drs=$(sanitize $drs)
+drs=$(read_ldso_conf "${LDSO_CONF}")
+drs=$(sanitize ${drs})
 
 ARCH=@@ARCH@@
-LDSO_PATH="$ROOT/lib/ld-musl-${ARCH}.so.1"
-if [[ ! -e $LDSO_PATH ]]; then
-	echo "$LDSO_PATH not found" >&2
+LDSO_PATH="${ROOT}/lib/ld-musl-${ARCH}.so.1"
+if [[ ! -e ${LDSO_PATH} ]]; then
+	echo "${LDSO_PATH} not found" >&2
 	exit 1
 fi
 
-LDSO_ARCH=$(basename $LDSO_PATH)
+LDSO_ARCH=$(basename ${LDSO_PATH})
 LDSO_NAME=${LDSO_ARCH%.so.1}
-ETC_LDSO_PATH="$ROOT/etc/${LDSO_NAME}.path"
+ETC_LDSO_PATH="${ROOT}/etc/${LDSO_NAME}.path"
 
 X=$(mktemp -p /tmp ${LDSO_NAME}.XXXXXX)
-for d in $drs; do
-	echo $d >> $X
+for d in ${drs}; do
+	echo ${d} >> ${X}
 done
-chmod 644 $X
-mv $X $ETC_LDSO_PATH
+chmod 644 ${X}
+mv ${X} ${ETC_LDSO_PATH}

diff --git a/sys-libs/musl/musl-9999.ebuild b/sys-libs/musl/musl-9999.ebuild
index 0d528e720587..6a5e2688dd5a 100644
--- a/sys-libs/musl/musl-9999.ebuild
+++ b/sys-libs/musl/musl-9999.ebuild
@@ -137,7 +137,7 @@ src_install() {
 			[[ -e "${ED}"/lib/ld-musl-${arch}.so.1 ]] || die
 		fi
 
-		cp "${FILESDIR}"/ldconfig.in "${T}"/ldconfig.in || die
+		cp "${FILESDIR}"/ldconfig.in-r1 "${T}"/ldconfig.in || die
 		sed -e "s|@@ARCH@@|${arch}|" "${T}"/ldconfig.in > "${T}"/ldconfig || die
 		into /
 		dosbin "${T}"/ldconfig


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: sys-libs/musl/files/, sys-libs/musl/
@ 2021-11-22 13:58 Sam James
  0 siblings, 0 replies; 7+ messages in thread
From: Sam James @ 2021-11-22 13:58 UTC (permalink / raw
  To: gentoo-commits

commit:     e5996958687948b4693324073f5114f19fd38b0e
Author:     Jonathan Davies <jpds <AT> protonmail <DOT> com>
AuthorDate: Mon Nov 22 13:38:31 2021 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Nov 22 13:58:14 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e5996958

sys-libs/musl: fix ldconfig on SELinux

Replaced mv in ldconfig with cp/rm dance so that the correct
SELinux label is applied to the resulting file and the system doesn't
brick itself instantly.

Bug: https://bugs.gentoo.org/663990
Closes: https://bugs.gentoo.org/696818
Signed-off-by: Jonathan Davies <jpds <AT> protonmail.com>
Closes: https://github.com/gentoo/gentoo/pull/23037
Signed-off-by: Sam James <sam <AT> gentoo.org>

 sys-libs/musl/files/ldconfig.in-r2 | 157 ++++++++++++++++++++++++++++++++++
 sys-libs/musl/musl-1.2.2-r7.ebuild | 167 +++++++++++++++++++++++++++++++++++++
 2 files changed, 324 insertions(+)

diff --git a/sys-libs/musl/files/ldconfig.in-r2 b/sys-libs/musl/files/ldconfig.in-r2
new file mode 100644
index 000000000000..72a2f58bc744
--- /dev/null
+++ b/sys-libs/musl/files/ldconfig.in-r2
@@ -0,0 +1,157 @@
+#!/bin/bash -e
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+ROOT="/"
+LDSO_CONF="/etc/ld.so.conf"
+
+VERBOSE=0
+
+UPDATE_LINKS=1
+
+get_options() {
+	while getopts "vnNXf:C:r:p" opt "$@"; do
+		case $opt in
+		v)
+			echo "ldconfig for musl in Gentoo"
+			VERBOSE=1
+			;;
+		r)
+			ROOT=${OPTARG}
+			LDSO_CONF=${ROOT}${LDSO_CONF}
+			LDSO_CONF_DIR=$(dirname ${LDSO_CONF})
+			;;
+		f)
+			LDSO_CONF=${OPTARG}
+			;;
+		X)
+			UPDATE_LINKS=0
+			;;
+		\?)
+			echo "Invalid option: -${opt}" >&2
+			exit 1
+			;;
+		n|N|C|p)
+			echo "Unimplemented option: -${opt}" >&2
+			exit 1
+			;;
+		esac
+	done
+
+	if [[ ${UPDATE_LINKS} == 1 ]]; then
+		echo "Updating links is not implemented."
+	fi
+}
+
+
+repeated() {
+	local l=${1}
+	local drs="${@:2}"
+	for m in ${drs}; do
+		[[ ${m} == ${l} ]] && return 0
+	done
+	return 1
+}
+
+expand() {
+	# We are assuming the ld.so.conf's 'include' is not recursive
+	local f line l
+	local glob="${LDSO_CONF_DIR}/${1}"
+	local drs="${@:2} "
+
+	for f in ${glob}; do
+		[[ ! -f ${f} ]] && continue
+		while read line; do
+			line=${line%%#*}
+			line=${line//:/ }
+			line=${line//,/ }
+			for l in ${line}; do
+				# We must add this whether or not the directory exists
+				repeated ${l} ${drs} && continue
+				drs+=" ${l} "
+			done
+		done < ${f}
+	done
+
+	echo ${drs}
+}
+
+read_ldso_conf() {
+	local drs=" "
+
+	while read line; do
+		# Sanitize the line - see ldconfig(8) for delimiters
+		# Note: bash read turns tabs into spaces and read already
+		# delimits on newlines with the default $IFS
+		line=${line%%#*}   # Remove comments
+		line=${line//:/ }  # Change colon delimiter to space
+		line=${line//,/ }  # Change comma delimiter to space
+
+		next=0
+		for l in ${line}; do
+			if [[ ${next} == 1 ]]; then
+				next=0
+				drs=$(expand ${l} ${drs})
+			elif [[ ${l} == "include" ]]; then
+				next=1
+			else
+				# glibc's ldconfig silently skips non directories
+				if [[ -d ${l} ]]; then
+					repeated ${l} ${drs} && continue
+					drs+=" ${l} "
+				fi
+			fi
+		done
+	done < ${1}
+
+	echo ${drs}
+}
+
+sanitize() {
+	local drs=$@
+
+	repeated "/lib" ${drs} || drs="/lib ${drs}"
+	repeated "/usr/lib" ${drs} || drs="/usr/lib ${drs}"
+
+	echo ${drs}
+}
+
+changed() {
+	[[ -f ${ETC_LDSO_PATH} ]] || return 0
+	local current=$(<${ETC_LDSO_PATH})
+	current=${current//$'\n'/ }
+	[[ ${current} != ${drs} ]] || return 1
+}
+
+get_options "$@"
+
+if [[ ! -e ${LDSO_CONF} ]]; then
+        echo "${LDSO_CONF} not found" >&2
+        exit 1
+fi
+
+LDSO_CONF_DIR=$(dirname ${LDSO_CONF})
+
+drs=$(read_ldso_conf "${LDSO_CONF}")
+drs=$(sanitize ${drs})
+
+ARCH=@@ARCH@@
+LDSO_PATH="${ROOT}/lib/ld-musl-${ARCH}.so.1"
+if [[ ! -e ${LDSO_PATH} ]]; then
+	echo "${LDSO_PATH} not found" >&2
+	exit 1
+fi
+
+LDSO_ARCH=$(basename ${LDSO_PATH})
+LDSO_NAME=${LDSO_ARCH%.so.1}
+ETC_LDSO_PATH="${ROOT}/etc/${LDSO_NAME}.path"
+
+changed || exit 0
+X=$(mktemp -p /tmp ${LDSO_NAME}.XXXXXX)
+for d in ${drs}; do
+	echo ${d} >> ${X}
+done
+chmod 644 ${X}
+# busybox doesn't support mz -Z
+cp ${X} ${ETC_LDSO_PATH}
+rm ${X}

diff --git a/sys-libs/musl/musl-1.2.2-r7.ebuild b/sys-libs/musl/musl-1.2.2-r7.ebuild
new file mode 100644
index 000000000000..dac76c213424
--- /dev/null
+++ b/sys-libs/musl/musl-1.2.2-r7.ebuild
@@ -0,0 +1,167 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit eapi8-dosym flag-o-matic toolchain-funcs
+if [[ ${PV} == "9999" ]] ; then
+	EGIT_REPO_URI="git://git.musl-libc.org/musl"
+	inherit git-r3
+else
+	SRC_URI="http://www.musl-libc.org/releases/${P}.tar.gz"
+	KEYWORDS="-* ~amd64 ~arm ~arm64 ~mips ~ppc ~ppc64 ~x86"
+fi
+GETENT_COMMIT="93a08815f8598db442d8b766b463d0150ed8e2ab"
+GETENT_FILE="musl-getent-${GETENT_COMMIT}.c"
+SRC_URI+="
+	https://dev.gentoo.org/~blueness/musl-misc/getconf.c
+	https://gitlab.alpinelinux.org/alpine/aports/-/raw/${GETENT_COMMIT}/main/musl/getent.c -> ${GETENT_FILE}
+	https://dev.gentoo.org/~blueness/musl-misc/iconv.c
+"
+
+export CBUILD=${CBUILD:-${CHOST}}
+export CTARGET=${CTARGET:-${CHOST}}
+if [[ ${CTARGET} == ${CHOST} ]] ; then
+	if [[ ${CATEGORY} == cross-* ]] ; then
+		export CTARGET=${CATEGORY#cross-}
+	fi
+fi
+
+DESCRIPTION="Light, fast and simple C library focused on standards-conformance and safety"
+HOMEPAGE="https://musl.libc.org"
+LICENSE="MIT LGPL-2 GPL-2"
+SLOT="0"
+IUSE="headers-only"
+
+QA_SONAME="/usr/lib/libc.so"
+QA_DT_NEEDED="/usr/lib/libc.so"
+
+is_crosscompile() {
+	[[ ${CHOST} != ${CTARGET} ]]
+}
+
+just_headers() {
+	use headers-only && is_crosscompile
+}
+
+pkg_setup() {
+	if [ ${CTARGET} == ${CHOST} ] ; then
+		case ${CHOST} in
+		*-musl*) ;;
+		*) die "Use sys-devel/crossdev to build a musl toolchain" ;;
+		esac
+	fi
+
+	# fix for #667126, copied from glibc ebuild
+	# make sure host make.conf doesn't pollute us
+	if is_crosscompile || tc-is-cross-compiler ; then
+		CHOST=${CTARGET} strip-unsupported-flags
+	fi
+}
+
+src_unpack() {
+	if [[ ${PV} == 9999 ]]; then
+		git-r3_src_unpack
+	else
+		unpack "${P}.tar.gz"
+	fi
+	mkdir misc || die
+	cp "${DISTDIR}"/getconf.c misc/getconf.c || die
+	cp "${DISTDIR}/${GETENT_FILE}" misc/getent.c || die
+	cp "${DISTDIR}"/iconv.c misc/iconv.c || die
+}
+
+src_prepare() {
+	default
+
+	# Expand gethostid instead of being just a stub
+	eapply "${FILESDIR}/${PN}-1.2.2-gethostid.patch"
+}
+
+src_configure() {
+	tc-getCC ${CTARGET}
+	just_headers && export CC=true
+
+	local sysroot
+	is_crosscompile && sysroot="${EPREFIX}"/usr/${CTARGET}
+	./configure \
+		--target=${CTARGET} \
+		--prefix=${sysroot}/usr \
+		--syslibdir=${sysroot}/lib \
+		--disable-gcc-wrapper || die
+}
+
+src_compile() {
+	emake obj/include/bits/alltypes.h
+	just_headers && return 0
+
+	emake
+	if [[ ${CATEGORY} != cross-* ]] ; then
+		emake -C "${T}" getconf getent iconv \
+			CC="$(tc-getCC)" \
+			CFLAGS="${CFLAGS}" \
+			CPPFLAGS="${CPPFLAGS}" \
+			LDFLAGS="${LDFLAGS}" \
+			VPATH="${WORKDIR}/misc"
+	fi
+
+	$(tc-getCC) ${CFLAGS} -c -o libssp_nonshared.o  "${FILESDIR}"/stack_chk_fail_local.c || die
+	$(tc-getAR) -rcs libssp_nonshared.a libssp_nonshared.o || die
+}
+
+src_install() {
+	local target="install"
+	just_headers && target="install-headers"
+	emake DESTDIR="${D}" ${target}
+	just_headers && return 0
+
+	# musl provides ldd via a sym link to its ld.so
+	local sysroot
+	is_crosscompile && sysroot=/usr/${CTARGET}
+	local ldso=$(basename "${D}"${sysroot}/lib/ld-musl-*)
+	dosym ${sysroot}/lib/${ldso} ${sysroot}/usr/bin/ldd
+
+	if [[ ${CATEGORY} != cross-* ]] ; then
+		# Fish out of config:
+		#   ARCH = ...
+		#   SUBARCH = ...
+		# and print $(ARCH)$(SUBARCH).
+		local arch=$(awk '{ k[$1] = $3 } END { printf("%s%s", k["ARCH"], k["SUBARCH"]); }' config.mak)
+
+		if [[ ! -e "${ED}"/lib/ld-musl-${arch}.so.1 ]] ; then
+			# During cross (using crossdev), when emerging sys-libs/musl,
+			# if /usr/lib/libc.so.1 doesn't exist on the system, installation
+			# would fail.
+			#
+			# The musl build system seems to create a symlink:
+			# ${D}/lib/ld-musl-${arch}.so.1 -> /usr/lib/libc.so.1 (absolute)
+			# During cross, there's no guarantee that the host is using musl
+			# so that file may not exist. Use a relative symlink within ${D}
+			# instead.
+			dosym8 -r /usr/lib/libc.so /lib/ld-musl-${arch}.so.1
+
+			# If it's still a dead symlnk, OK, we really do need to abort.
+			[[ -e "${ED}"/lib/ld-musl-${arch}.so.1 ]] || die
+		fi
+
+		cp "${FILESDIR}"/ldconfig.in-r2 "${T}"/ldconfig.in || die
+		sed -e "s|@@ARCH@@|${arch}|" "${T}"/ldconfig.in > "${T}"/ldconfig || die
+		into /
+		dosbin "${T}"/ldconfig
+		into /usr
+		dobin "${T}"/getconf
+		dobin "${T}"/getent
+		dobin "${T}"/iconv
+		echo 'LDPATH="include ld.so.conf.d/*.conf"' > "${T}"/00musl || die
+		doenvd "${T}"/00musl
+		dolib.a libssp_nonshared.a
+	fi
+}
+
+pkg_postinst() {
+	is_crosscompile && return 0
+
+	[ "${ROOT}" != "/" ] && return 0
+
+	ldconfig || die
+}


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-11-22 13:58 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-21 19:20 [gentoo-commits] repo/gentoo:master commit in: sys-libs/musl/files/, sys-libs/musl/ Anthony G. Basile
  -- strict thread matches above, loose matches on Subject: below --
2021-11-22 13:58 Sam James
2021-11-19  3:03 Sam James
2021-08-16  0:59 Jory Pratt
2020-11-24 15:00 Sam James
2016-02-16 23:22 Anthony G. Basile
2015-09-08 19:46 Anthony G. Basile

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox