Mail archive
alpine-aports

[alpine-aports] [PATCH] community/tcsh: fix sysmalloc bug

From: Alec Posney <aposney_at_atlassian.com>
Date: Wed, 31 Jan 2018 14:05:36 +1100

The current binary fails for tcsh since it is using
tcsh's build in allocator, which does not work with
musl. This adds a patch, similar to the one used
in openwrt [1], what enforced use by the alpine
system allocator.

[1](https://github.com/openwrt/packages/blob/master/utils/tcsh/patches/
001-sysmalloc.patch)
---
 testing/tcsh/10-sysmalloc.patch | 18 ++++++++++++++++++
 testing/tcsh/APKBUILD           | 13 +++++++++----
 2 files changed, 27 insertions(+), 4 deletions(-)
 create mode 100644 testing/tcsh/10-sysmalloc.patch
 mode change 100644 => 100755 testing/tcsh/APKBUILD
diff --git a/testing/tcsh/10-sysmalloc.patch b/testing/tcsh/10-
sysmalloc.patch
new file mode 100644
index 0000000000..e93015297b
--- /dev/null
+++ b/testing/tcsh/10-sysmalloc.patch
_at_@ -0,0 +1,18 @@
+diff --git a/config_f.h b/config_f.h
+index 1ceef7a..f8de049 100644
+--- a/config_f.h
++++ b/config_f.h
+_at_@ -138,11 +138,8 @@
+  *             This can be much slower and no memory statistics will
be
+  *             provided.
+  */
+-#if defined(__MACHTEN__) || defined(PURIFY) || defined(MALLOC_TRACE)
|| defined(_OSD_POSIX) || defined(__MVS__) || defined (__CYGWIN__) ||
defined(__GLIBC__) || defined(__OpenBSD__) || defined(__APPLE__) ||
defined (__ANDROID__)
++
+ # define SYSMALLOC
+-#else
+-# undef SYSMALLOC
+-#endif
+ 
+ /*
+  * USE_ACCESS  Use access(2) rather than stat(2) when POSIX is
defined.
+
diff --git a/testing/tcsh/APKBUILD b/testing/tcsh/APKBUILD
old mode 100644
new mode 100755
index 95d031a220..7dbdfe373d
--- a/testing/tcsh/APKBUILD
+++ b/testing/tcsh/APKBUILD
_at_@ -11,9 +11,15 @@ depends=""
 makedepends="ncurses-dev"
 install=""
 subpackages="$pkgname-doc"
-source="ftp://ftp.astron.com/pub/tcsh/${pkgname}-${pkgver}.tar.gz"
+source="ftp://ftp.astron.com/pub/tcsh/${pkgname}-${pkgver}.tar.gz
+	10-sysmalloc.patch
+	"
 builddir="$srcdir/tcsh-$pkgver"
 
+prepare() {
+	default_prepare
+}
+
 build() {
 	cd "$builddir"
 	./configure \
_at_@ -33,6 +39,5 @@ package() {
 	rm -rf "$pkgdir"/usr/share/locale
 }
 
-md5sums="59d40ef40a68e790d95e182069431834  tcsh-6.20.00.tar.gz"
-sha256sums="b89de7064ab54dac454a266cfe5d8bf66940cb5ed048d0c30674ea62e7
ecef9d  tcsh-6.20.00.tar.gz"
-sha512sums="c5635393c22341e62fb9a0b953ddf8871a876ab09deb08c98237f93afa
9257b4a3381d1db65eefe769e22ef845db29ab7bc78773f1f609d73c8205689a6683e9 
 tcsh-6.20.00.tar.gz"
+sha512sums="c5635393c22341e62fb9a0b953ddf8871a876ab09deb08c98237f93afa
9257b4a3381d1db65eefe769e22ef845db29ab7bc78773f1f609d73c8205689a6683e9 
 tcsh-6.20.00.tar.gz
+5539436be6d340a2888e4d47101bee4799b30f04c42a8b4840f2a4588be272ba8ef591
9f309a9e43cb74db7d3028f6962b434d16a813c4ca3ebe4c3660c58c2e  10-
sysmalloc.patch"
---
Unsubscribe:  alpine-aports+unsubscribe_at_lists.alpinelinux.org
Help:         alpine-aports+help_at_lists.alpinelinux.org
---
Received on Wed Jan 31 2018 - 14:05:36 GMT