Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 538956 | Differences between
and this patch

Collapse All | Expand All

(-)a/app-editors/emacs/Manifest (+10 lines)
Line 0 Link Here
1
AUX emacs-24.3-alloc-invalid-frees.patch 1312 SHA256 f9d44c64663d546bfd1010230f8f7cdfdbce1d7320bf166d86045ff00ec6d498 SHA512 197c2146a2c6a820b8d01fa48e306c8ee083c2407d83589e0b18be8453e03438be1c64a010c06b9d68f2393ae4cccf86780ce8b17cd42335847f91f671ffaf2d WHIRLPOOL 2eb68ff289594b56117a26001b556c808336805771d62344183f9387aa459cb549e90476ae3f0216f0d42cdc1610b5de729d9cb8d19fb2cce679b39c196c7603
2
AUX emacs-24.3-stderr.patch 277 SHA256 1fc337fac4e28cf20eed65f88cfcf94b46339408cceadc8a0d17bce969ae6d3a SHA512 370cb1d053530824050eec6b9f02f0eed0e91270940551712f7308ffd4657bba39513d9ab94d47306bbac1e507283a97326e6f366e47f64d093e794a25684b56 WHIRLPOOL 8ad5ab8c6cdaea01fcd784ef3993fbdd9c8e00d2f6aa12c70fc63a8da0e7e1513be45f74aa7b415c1b488cc73c9a1d2fc1f5c0283bfc0ad0a3417bd183bbb92d
3
AUX emacs-24.4-configure.patch 334 SHA256 696710ea84e88a364bd89c9c66393b01b2b8782d2bd0fc08166e64b67b24b0fe SHA512 d75df3a772713e08b45759b58c92944a1719ce291069f111d296b15c7de86f7a9a89d023fa3ccd191390d8a79a671d0a60116f039cf6f57ebeeb7baa14f7af29 WHIRLPOOL 6420f6a5f8009096aa71f2e64d920dec6a1436bbb83c26c2a0d4180555b6e251ebfa92be801ddcf70bd840cb9afd56f99a84ad50be7361289baefe83e35ca52b
4
AUX emacs-24.4-lisp.patch 421 SHA256 da45d30d4e305ba5220749d3ac884aaeac395bc896839a5e7a24fb112912cbff SHA512 7dda7632f7af4207c94bf2b4384d07bb13ef4562ade02393c668b35ff48d7b64d95a9c05d8700c2ba272abf69e8b9c38a690b10afa86b8857a2ba34cb344f3a3 WHIRLPOOL 28e3346a1b47f8421d56ec37005a806828f1f6995cd4dc213ac8a6011457a7d1d0524f8418a2801e176c5ea09cb5910cd6432a55c592d679f7752c3df23ca339
5
AUX emacs-24.4-preload-hack.patch 343 SHA256 289febdc960bee609514fe5291fb3d60cc9b505345853370aa94b9bd9ccb5fd2 SHA512 ee765cc9f3a84b48c00a0c8a36934af6da737fa6b9f9d993e0e5e1c8b9f05cf7b1f96c260daba10e4b4df149abcf8ea125cf8d6ebbe5e2c0d508007e381ecd6b WHIRLPOOL f5c1c6313392325949edc955d9f1b3dc74395ff18cd214f5bef6f8f77ce1975233c870101a03d5218da007a61f3107474ef461d129313b00b07da762970b749a
6
AUX preload.c 1868 SHA256 3498abf641e809c06bf6a265d54880e93ee31f7abf81210856b6dbef7d267129 SHA512 6268255b7afa8455ad7ce63ef6f01a7d114b53fbb3dc557b187de0ee6514b33b3419d70b8d7984dc289f5eed075a30b508133147821f77c4345df5cbd62e616e WHIRLPOOL 0c72d97de94cf5e1cf6a8ee4f8f42800d63f35465ea22f8c409857620ecc37e304ff6c2c4670659a063e5f275488fcdd1b45226d9d0130c4506480df7708bff6
7
DIST emacs-24.4-patches-3.tar.xz 3780 SHA256 2dd1ba1e9cca9121731d14da30ecf3eb720c07e9644a7b9d75e3f02ebc2089d7 SHA512 dde60b26a7dffca1f80937af406ec8a7b4dd8c2563f57c290629acc4767ef38075fcc42ca62c5f172c972fc3cb6c2c0539d3db641386edc68a842bc6cf81237c WHIRLPOOL 3da7034ac9ce495f57ad5bd82f6f8a4d8a4baddd4126b6753423f5cf58aa01873838e22b2908b8c2e4cd48590dd7fb7ea3a520e1bf43be7d0eaf02583bdc9f6f
8
DIST emacs-24.4.tar.xz 39733124 SHA256 47e391170db4ca0a3c724530c7050655f6d573a711956b4cd84693c194a9d4fd SHA512 f51f88a4736a3f153ef01f3ad710571e967cd3d0c0112b066169a4040725d370ec29b14a4ca8fa3e3f4c657c726ba8e64c3ac4e390b8e911ea47a3afb5ac755c WHIRLPOOL eae38c2382731fecf0ccf8f717f8c96cc130d01a893ff560caecde903294eb843660492761ea8cce9920b79bfc55e821921924e27c040f25355110f56cd2255b
9
EBUILD emacs-24.4-r99.ebuild 10874 SHA256 d916009ab08d1a0524cde4dcc1952040153b9cdc103c180851474a7aa2c2d41b SHA512 3ce45d8df2eccbbdd9965dff8f1859fd6a7eb8eee4ee12d9688dbb78632bb428f34a8faaa52f7169feff3e654ae4b0365b0213f1c6a01e783661670915586d59 WHIRLPOOL cfaf1a03f7c02f184ae091a5d19fe1ffb0e207901c6fd18519bbf78a6f58399f618bd0e2961832025e63f7ba94823f1cdbfb138a74e22e63831a8b1d3177962b
10
MISC metadata.xml 2489 SHA256 21b3602d37aa25bca31b05ea810b37ee2192f4e53b8f8daeb814d9dca59d03d7 SHA512 4f3d663cd61253ae3390c55c5974dd3cc22dbf1306a823c3cb71794d09eaf28d7727c7e24f66f02dbd8d3845894f3a8cafa5ddaf330c1bbb7f99d8130ece077c WHIRLPOOL bcefdded503fa9cebea943952d3f56847002cb5ddc10f5adbd774301b648d1b12a09da7e493694f9cbbb19e8b53b66132cbd2e0141ded41b226415cfdbbcf8f6
(-)a/app-editors/emacs/emacs-24.4-r99.ebuild (+348 lines)
Line 0 Link Here
1
# Copyright 1999-2015 Gentoo Foundation
2
# Distributed under the terms of the GNU General Public License v2
3
# $Header: /var/cvsroot/gentoo-x86/app-editors/emacs/emacs-24.4-r2.ebuild,v 1.1 2015/01/23 20:38:44 ulm Exp $
4
5
EAPI=5
6
7
inherit elisp-common eutils flag-o-matic multilib readme.gentoo
8
9
DESCRIPTION="The extensible, customizable, self-documenting real-time display editor"
10
HOMEPAGE="http://www.gnu.org/software/emacs/"
11
SRC_URI="mirror://gnu/emacs/${P}.tar.xz
12
	http://dev.gentoo.org/~ulm/emacs/${P}-patches-3.tar.xz"
13
14
LICENSE="GPL-3+ FDL-1.3+ BSD HPND MIT W3C unicode PSF-2"
15
SLOT="24"
16
KEYWORDS="amd64 ~arm ~mips ~ppc ~x86"
17
IUSE="acl alsa aqua athena dbus games gconf gfile gif gnutls gpm gsettings gtk +gtk3 gzip-el hesiod imagemagick +inotify jpeg kerberos libxml2 livecd m17n-lib motif pax_kernel png selinux sound source svg tiff toolkit-scroll-bars wide-int X Xaw3d xft +xpm zlib"
18
REQUIRED_USE="?? ( aqua X )"
19
20
RDEPEND="sys-libs/ncurses
21
	>=app-admin/eselect-emacs-1.16
22
	>=app-emacs/emacs-common-gentoo-1.4-r1[games?,X?]
23
	net-libs/liblockfile
24
	acl? ( virtual/acl )
25
	alsa? ( media-libs/alsa-lib )
26
	dbus? ( sys-apps/dbus )
27
	gfile? ( >=dev-libs/glib-2.28.6 )
28
	gnutls? ( net-libs/gnutls )
29
	gpm? ( sys-libs/gpm )
30
	hesiod? ( net-dns/hesiod )
31
	kerberos? ( virtual/krb5 )
32
	libxml2? ( >=dev-libs/libxml2-2.2.0 )
33
	selinux? ( sys-libs/libselinux )
34
	zlib? ( sys-libs/zlib )
35
	X? (
36
		x11-libs/libXmu
37
		x11-libs/libXt
38
		x11-misc/xbitmaps
39
		gconf? ( >=gnome-base/gconf-2.26.2 )
40
		gsettings? ( >=dev-libs/glib-2.28.6 )
41
		gif? ( media-libs/giflib )
42
		jpeg? ( virtual/jpeg:0= )
43
		png? ( >=media-libs/libpng-1.4:0= )
44
		svg? ( >=gnome-base/librsvg-2.0 )
45
		tiff? ( media-libs/tiff )
46
		xpm? ( x11-libs/libXpm )
47
		imagemagick? ( >=media-gfx/imagemagick-6.6.2 )
48
		xft? (
49
			media-libs/fontconfig
50
			media-libs/freetype
51
			x11-libs/libXft
52
			m17n-lib? (
53
				>=dev-libs/libotf-0.9.4
54
				>=dev-libs/m17n-lib-1.5.1
55
			)
56
		)
57
		gtk? (
58
			gtk3? ( x11-libs/gtk+:3 )
59
			!gtk3? ( x11-libs/gtk+:2 )
60
		)
61
		!gtk? (
62
			motif? ( >=x11-libs/motif-2.3:0 )
63
			!motif? (
64
				Xaw3d? ( x11-libs/libXaw3d )
65
				!Xaw3d? ( athena? ( x11-libs/libXaw ) )
66
			)
67
		)
68
	)"
69
70
DEPEND="${RDEPEND}
71
	virtual/pkgconfig
72
	gzip-el? ( app-arch/gzip )
73
	pax_kernel? (
74
		sys-apps/attr
75
		sys-apps/paxctl
76
	)"
77
78
RDEPEND="${RDEPEND}
79
	!<app-editors/emacs-vcs-${PV}"
80
81
EMACS_SUFFIX="${PN/emacs/emacs-${SLOT}}"
82
SITEFILE="20${PN}-${SLOT}-gentoo.el"
83
# FULL_VERSION keeps the full version number, which is needed in
84
# order to determine some path information correctly for copy/move
85
# operations later on
86
FULL_VERSION="${PV%%_*}"
87
S="${WORKDIR}/emacs-${FULL_VERSION}"
88
89
src_prepare() {
90
	EPATCH_SUFFIX=patch epatch
91
92
	epatch "${FILESDIR}/${PN}-24.3-stderr.patch"
93
	epatch "${FILESDIR}/${PN}-24.3-alloc-invalid-frees.patch"
94
	epatch "${FILESDIR}/${PN}-24.4-configure.patch"
95
	epatch "${FILESDIR}/${PN}-24.4-preload-hack.patch"
96
	epatch "${FILESDIR}/${PN}-24.4-lisp.patch"
97
98
	epatch_user
99
100
	# Fix filename reference in redirected man page
101
	sed -i -e "/^\\.so/s/etags/&-${EMACS_SUFFIX}/" doc/man/ctags.1 \
102
		|| die "unable to sed ctags.1"
103
104
	#AT_M4DIR=m4 eautoreconf
105
}
106
107
src_configure() {
108
	strip-flags
109
	filter-flags -pie					#526948
110
111
	if use sh; then
112
		replace-flags "-O[1-9]" -O0		#262359
113
	elif use ia64; then
114
		replace-flags "-O[2-9]" -O1		#325373
115
	else
116
		replace-flags "-O[3-9]" -O2
117
	fi
118
119
	local myconf
120
121
	if use alsa; then
122
		use sound || ewarn \
123
			"USE flag \"alsa\" overrides \"-sound\"; enabling sound support."
124
		myconf+=" --with-sound=alsa"
125
	else
126
		myconf+=" --with-sound=$(usex sound oss)"
127
	fi
128
129
	if use X; then
130
		myconf+=" --with-x --without-ns"
131
		myconf+=" $(use_with gconf)"
132
		myconf+=" $(use_with gsettings)"
133
		myconf+=" $(use_with toolkit-scroll-bars)"
134
		myconf+=" $(use_with gif)"
135
		myconf+=" $(use_with jpeg)"
136
		myconf+=" $(use_with png)"
137
		myconf+=" $(use_with svg rsvg)"
138
		myconf+=" $(use_with tiff)"
139
		myconf+=" $(use_with xpm)"
140
		myconf+=" $(use_with imagemagick)"
141
142
		if use xft; then
143
			myconf+=" --with-xft"
144
			myconf+=" $(use_with m17n-lib libotf)"
145
			myconf+=" $(use_with m17n-lib m17n-flt)"
146
		else
147
			myconf+=" --without-xft"
148
			myconf+=" --without-libotf --without-m17n-flt"
149
			use m17n-lib && ewarn \
150
				"USE flag \"m17n-lib\" has no effect if \"xft\" is not set."
151
		fi
152
153
		local f
154
		if use gtk; then
155
			einfo "Configuring to build with GIMP Toolkit (GTK+)"
156
			myconf+=" --with-x-toolkit=$(usex gtk3 gtk3 gtk2)"
157
			for f in motif Xaw3d athena; do
158
				use ${f} && ewarn \
159
					"USE flag \"${f}\" has no effect if \"gtk\" is set."
160
			done
161
		elif use motif; then
162
			einfo "Configuring to build with Motif toolkit"
163
			myconf+=" --with-x-toolkit=motif"
164
			for f in Xaw3d athena; do
165
				use ${f} && ewarn \
166
					"USE flag \"${f}\" has no effect if \"motif\" is set."
167
			done
168
		elif use athena || use Xaw3d; then
169
			einfo "Configuring to build with Athena/Lucid toolkit"
170
			myconf+=" --with-x-toolkit=lucid $(use_with Xaw3d xaw3d)"
171
		else
172
			einfo "Configuring to build with no toolkit"
173
			myconf+=" --with-x-toolkit=no"
174
		fi
175
	elif use aqua; then
176
		einfo "Configuring to build with Nextstep (Cocoa) support"
177
		myconf+=" --with-ns --disable-ns-self-contained"
178
		myconf+=" --without-x"
179
	else
180
		myconf+=" --without-x --without-ns"
181
	fi
182
183
	# Save version information in the Emacs binary. It will be available
184
	# in variable "system-configuration-options".
185
	myconf+=" GENTOO_PACKAGE=${CATEGORY}/${PF}"
186
187
	econf \
188
		--program-suffix="-${EMACS_SUFFIX}" \
189
		--infodir="${EPREFIX}"/usr/share/info/${EMACS_SUFFIX} \
190
		--localstatedir="${EPREFIX}"/var \
191
		--enable-locallisppath="${EPREFIX}/etc/emacs:${EPREFIX}${SITELISP}" \
192
		--with-gameuser="${GAMES_USER_DED:-games}" \
193
		--without-compress-install \
194
		--with-file-notification=$(usev gfile || usev inotify || echo no) \
195
		$(use_enable acl) \
196
		$(use_with dbus) \
197
		$(use_with gnutls) \
198
		$(use_with gpm) \
199
		$(use_with hesiod) \
200
		$(use_with kerberos) $(use_with kerberos kerberos5) \
201
		$(use_with libxml2 xml2) \
202
		$(use_with selinux) \
203
		$(use_with wide-int) \
204
		$(use_with zlib) \
205
		${myconf}
206
}
207
208
src_compile() {
209
	echo $S
210
	$(tc-getCC) -shared -fPIC -o preload.so "${FILESDIR}/preload.c" || die
211
212
	export SANDBOX_ON=0			# for the unbelievers, see Bug #131505
213
	emake
214
}
215
216
src_install () {
217
	emake DESTDIR="${D}" NO_BIN_LINK=t install
218
219
	mv "${ED}"/usr/bin/{emacs-${FULL_VERSION}-,}${EMACS_SUFFIX} \
220
		|| die "moving emacs executable failed"
221
	mv "${ED}"/usr/share/man/man1/{emacs-,}${EMACS_SUFFIX}.1 \
222
		|| die "moving emacs man page failed"
223
224
	# move info dir to avoid collisions with the dir file generated by portage
225
	mv "${ED}"/usr/share/info/${EMACS_SUFFIX}/dir{,.orig} \
226
		|| die "moving info dir failed"
227
	touch "${ED}"/usr/share/info/${EMACS_SUFFIX}/.keepinfodir
228
	docompress -x /usr/share/info/${EMACS_SUFFIX}/dir.orig
229
230
	# avoid collision between slots, see bug #169033 e.g.
231
	rm "${ED}"/usr/share/emacs/site-lisp/subdirs.el
232
	rm -rf "${ED}"/usr/share/{applications,icons}
233
	rm -rf "${ED}"/var
234
235
	# remove unused <version>/site-lisp dir
236
	rm -rf "${ED}"/usr/share/emacs/${FULL_VERSION}/site-lisp
237
238
	# remove COPYING file (except for etc/COPYING used by describe-copying)
239
	rm "${ED}"/usr/share/emacs/${FULL_VERSION}/lisp/COPYING
240
241
	if use gzip-el; then
242
		# compress .el files when a corresponding .elc exists
243
		find "${ED}"/usr/share/emacs/${FULL_VERSION}/lisp -type f \
244
			-name "*.elc" -print | sed 's/\.elc$/.el/' | xargs gzip -9n
245
		assert "gzip .el failed"
246
	fi
247
248
	local cdir
249
	if use source; then
250
		cdir="/usr/share/emacs/${FULL_VERSION}/src"
251
		insinto "${cdir}"
252
		# This is not meant to install all the source -- just the
253
		# C source you might find via find-function
254
		doins src/*.{c,h,m}
255
	elif has installsources ${FEATURES}; then
256
		cdir="/usr/src/debug/${CATEGORY}/${PF}/${S#"${WORKDIR}/"}/src"
257
	fi
258
259
	sed -e "${cdir:+#}/^Y/d" -e "s/^[XY]//" >"${T}/${SITEFILE}" <<-EOF
260
	X
261
	;;; ${PN}-${SLOT} site-lisp configuration
262
	X
263
	(when (string-match "\\\\\`${FULL_VERSION//./\\\\.}\\\\>" emacs-version)
264
	Y  (setq find-function-C-source-directory
265
	Y	"${EPREFIX}${cdir}")
266
	X  (let ((path (getenv "INFOPATH"))
267
	X	(dir "${EPREFIX}/usr/share/info/${EMACS_SUFFIX}")
268
	X	(re "\\\\\`${EPREFIX}/usr/share/info\\\\>"))
269
	X    (and path
270
	X	 ;; move Emacs Info dir before anything else in /usr/share/info
271
	X	 (let* ((p (cons nil (split-string path ":" t))) (q p))
272
	X	   (while (and (cdr q) (not (string-match re (cadr q))))
273
	X	     (setq q (cdr q)))
274
	X	   (setcdr q (cons dir (delete dir (cdr q))))
275
	X	   (setq Info-directory-list (prune-directory-list (cdr p)))))))
276
	EOF
277
	elisp-site-file-install "${T}/${SITEFILE}" || die
278
279
	dodoc README BUGS
280
281
	if use aqua; then
282
		dodir /Applications/Gentoo
283
		rm -rf "${ED}"/Applications/Gentoo/Emacs${EMACS_SUFFIX#emacs}.app
284
		mv nextstep/Emacs.app \
285
			"${ED}"/Applications/Gentoo/Emacs${EMACS_SUFFIX#emacs}.app || die
286
	fi
287
288
	DOC_CONTENTS="You can set the version to be started by /usr/bin/emacs
289
		through the Emacs eselect module, which also redirects man and info
290
		pages. Therefore, several Emacs versions can be installed at the
291
		same time. \"man emacs.eselect\" for details.
292
		\\n\\nIf you upgrade from Emacs version 24.2 or earlier, then it is
293
		strongly recommended that you use app-admin/emacs-updater to rebuild
294
		all byte-compiled elisp files of the installed Emacs packages."
295
	use X && DOC_CONTENTS+="\\n\\nYou need to install some fonts for Emacs.
296
		Installing media-fonts/font-adobe-{75,100}dpi on the X server's
297
		machine would satisfy basic Emacs requirements under X11.
298
		See also https://wiki.gentoo.org/wiki/Xft_support_for_GNU_Emacs
299
		for how to enable anti-aliased fonts."
300
	use aqua && DOC_CONTENTS+="\\n\\nEmacs${EMACS_SUFFIX#emacs}.app is in
301
		\"${EPREFIX}/Applications/Gentoo\". You may want to copy or symlink
302
		it into /Applications by yourself."
303
	readme.gentoo_create_doc
304
}
305
306
pkg_preinst() {
307
	# move Info dir file to correct name
308
	local infodir=/usr/share/info/${EMACS_SUFFIX} f
309
	if [[ -f ${ED}${infodir}/dir.orig ]]; then
310
		mv "${ED}"${infodir}/dir{.orig,} || die "moving info dir failed"
311
	elif [[ -d "${ED}"${infodir} ]]; then
312
		# this should not happen in EAPI 4
313
		ewarn "Regenerating Info directory index in ${infodir} ..."
314
		rm -f "${ED}"${infodir}/dir{,.*}
315
		for f in "${ED}"${infodir}/*; do
316
			if [[ ${f##*/} != *-[0-9]* && -e ${f} ]]; then
317
				install-info --info-dir="${ED}"${infodir} "${f}" \
318
					|| die "install-info failed"
319
			fi
320
		done
321
	fi
322
}
323
324
pkg_postinst() {
325
	elisp-site-regen
326
327
	local pvr
328
	for pvr in ${REPLACING_VERSIONS}; do
329
		[[ ${pvr%%[-_]*} = 24.[12] ]] && FORCE_PRINT_ELOG=1
330
	done
331
	readme.gentoo_print_elog
332
333
	if use livecd; then
334
		# force an update of the emacs symlink for the livecd/dvd,
335
		# because some microemacs packages set it with USE=livecd
336
		eselect emacs update
337
	elif [[ $(readlink "${EROOT}"/usr/bin/emacs) = ${EMACS_SUFFIX} ]]; then
338
		# refresh symlinks in case any installed files have changed
339
		eselect emacs set ${EMACS_SUFFIX}
340
	else
341
		eselect emacs update ifunset
342
	fi
343
}
344
345
pkg_postrm() {
346
	elisp-site-regen
347
	eselect emacs update ifunset
348
}
(-)a/app-editors/emacs/files/emacs-24.3-alloc-invalid-frees.patch (+58 lines)
Line 0 Link Here
1
From http://www.openwall.com/lists/musl/2015/02/03/1
2
3
--- emacs-24.3.orig/src/alloc.c
4
+++ emacs-24.3/src/alloc.c
5
@@ -47,6 +47,13 @@
6
 
7
 #include <verify.h>
8
 
9
+static void *initial_brk;
10
+__attribute__((__constructor__))
11
+static void init()
12
+{
13
+	initial_brk = sbrk(0);
14
+}
15
+
16
 /* GC_CHECK_MARKED_OBJECTS means do sanity checks on allocated objects.
17
    Doable only if GC_MARK_STACK.  */
18
 #if ! GC_MARK_STACK
19
@@ -699,6 +706,14 @@
20
 {
21
   void *val;
22
 
23
+  if (block && block < initial_brk) {
24
+    size_t len = (char *)initial_brk - (char *)block;
25
+    if (len > size) len = size;
26
+    void *p = xmalloc(size);
27
+    memcpy(p, block, len);
28
+    return p;
29
+  }
30
+
31
   MALLOC_BLOCK_INPUT;
32
   /* We must call malloc explicitly when BLOCK is 0, since some
33
      reallocs don't do this.  */
34
@@ -720,6 +735,7 @@
35
 void
36
 xfree (void *block)
37
 {
38
+  if (block < initial_brk) return;
39
   if (!block)
40
     return;
41
   MALLOC_BLOCK_INPUT;
42
@@ -910,6 +926,7 @@
43
 static void
44
 lisp_free (void *block)
45
 {
46
+  if (block < initial_brk) return;
47
   MALLOC_BLOCK_INPUT;
48
   free (block);
49
 #if GC_MARK_STACK && !defined GC_MALLOC_CHECK
50
@@ -1117,6 +1134,8 @@
51
 {
52
   struct ablock *ablock = block;
53
   struct ablocks *abase = ABLOCK_ABASE (ablock);
54
+
55
+  if (block < initial_brk) return;
56
 
57
   MALLOC_BLOCK_INPUT;
58
 #if GC_MARK_STACK && !defined GC_MALLOC_CHECK
(-)a/app-editors/emacs/files/emacs-24.3-stderr.patch (+11 lines)
Line 0 Link Here
1
--- a/emacs-24.3/src/print.c
2
+++ b/emacs-24.3/src/print.c
3
@@ -733,7 +733,7 @@
4
   print_output_debug_flag = x;
5
 }
6
 
7
-#if defined (GNU_LINUX)
8
+#if 0
9
 
10
 /* This functionality is not vitally important in general, so we rely on
11
    non-portable ability to use stderr as lvalue.  */
(-)a/app-editors/emacs/files/preload.c (+91 lines)
Line 0 Link Here
1
--- a/configure.ac	2015-02-03 20:27:53.649248696 -0100
Line 0 Link Here
1
--- a/src/lisp.h	2015-02-03 20:42:39.233177373 -0100
Line 0 Link Here
1
--- a/src/Makefile.in	2014-05-26 16:50:55.000000000 -0100
Line 0 Link Here
1
// http://www.openwall.com/lists/musl/2015/02/03/1
2
#include <pthread.h>
3
#include <stdint.h>
4
#include <stdlib.h>
5
#include <string.h>
6
#include <dlfcn.h>
7
#include <unistd.h>
8
#include <stdio.h>
9
10
static void *(*real_malloc)(size_t);
11
static void *initial_brk;
12
13
static pthread_once_t once_control[1];
14
static void once_func()
15
{
16
	real_malloc = dlsym(RTLD_NEXT, "malloc");
17
	initial_brk = sbrk(0);
18
}
19
20
static int cmp(const void *a, const void *b)
21
{
22
	void *aa = *(void **)a, *bb = *(void **)b;
23
	return aa < bb ? -1 : aa > bb ? 1 : 0;
24
}
25
26
void *malloc(size_t n)
27
{
28
	size_t i, j, k;
29
	pthread_once(once_control, once_func);
30
	if (n < 100000 || n > (size_t)-1/2) {
31
		void *p;
32
		do p = real_malloc(n);
33
		while (p > sbrk(0) || (p && p < initial_brk));
34
		return p;
35
	}
36
	size_t cnt = n/16384;
37
	void **list = real_malloc(sizeof *list * cnt);
38
	if (!list) return 0;
39
	for (i=0; i<cnt; i++) list[i] = 0;
40
	for (i=0; i<cnt; i++) {
41
		list[i] = real_malloc(65536 - 2*sizeof(size_t));
42
		if (!list[i]) goto fail;
43
		if (i<cnt/4) continue;
44
		size_t base = 0;
45
		qsort(list, i+1, sizeof(void *), cmp);
46
		for (j=0; j<i; j++) {
47
			char *p = list[base];
48
			char *s = list[j];
49
			char *z = list[j+1];
50
			if (z-s > 65536) {
51
				base = j+1;
52
				continue;
53
			}
54
			if (z-p < n+64) {
55
				continue;
56
			}
57
			for (k=0; k<base; k++) free(list[k]);
58
			*(size_t *)(p-sizeof(size_t)) = z-p | 1;
59
			*(size_t *)(z-2*sizeof(size_t)) = z-p | 1;
60
			for (k=j+1; k<i+1; k++) free(list[k]);
61
			free(list);
62
			return p;
63
		}
64
	}
65
fail:
66
	for (i=0; i<cnt; i++) free(list[i]);
67
	free(list);
68
	return 0;
69
}
70
71
void *calloc(size_t n, size_t m)
72
{
73
	if ((size_t)-1/n <= m) n *= m;
74
	else n = (size_t)-1;
75
	void *p = malloc(n);
76
	if (p) memset(p, 0, n);
77
	return p;
78
}
79
80
void *realloc(void *p, size_t n)
81
{
82
	void *q = malloc(n);
83
	if (!q) return 0;
84
	size_t l = *(size_t *)((char *)p - sizeof(size_t)) & -8;
85
	memcpy(q, p, l<n ? l : n);
86
	free(p);
87
	return q;
88
}
(-)a/app-editors/emacs/metadata.xml (-1 / +46 lines)
Line 0 Link Here
0
- 
1
<?xml version="1.0" encoding="UTF-8"?>
2
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
3
<pkgmetadata>
4
<herd>emacs</herd>
5
<longdescription>
6
  GNU Emacs is an extensible, customizable text editor - and more. At its core
7
  is an interpreter for Emacs Lisp, a dialect of the Lisp programming language
8
  with extensions to support text editing. The features of GNU Emacs include:
9
   * Content-sensitive editing modes, including syntax coloring, for a variety
10
     of file types including plain text, source code, and HTML.
11
   * Complete built-in documentation, including a tutorial for new users.
12
   * Full Unicode support for nearly all human languages and their scripts.
13
   * Highly customizable, using Emacs Lisp code or a graphical interface.
14
   * A large number of extensions that add other functionality, including a
15
     project planner, mail and news reader, debugger interface, calendar, and
16
     more. Many of these extensions are distributed with GNU Emacs; others are
17
     available separately.
18
</longdescription>
19
<use>
20
  <flag name='athena'>Enable the MIT Athena widget set
21
    (<pkg>x11-libs/libXaw</pkg>)</flag>
22
  <flag name='games'>Support shared score files for games</flag>
23
  <flag name='gconf'>Use <pkg>gnome-base/gconf</pkg> to read the system
24
    font name</flag>
25
  <flag name='gfile'>Use gfile (<pkg>dev-libs/glib</pkg>) for file
26
    notification</flag>
27
  <flag name='gsettings'>Use gsettings (<pkg>dev-libs/glib</pkg>) to read the
28
    system font name</flag>
29
  <flag name='gtk3'>Link against version 3 of the GIMP Toolkit instead of
30
    version 2 (<pkg>x11-libs/gtk+</pkg>)</flag>
31
  <flag name='gzip-el'>Compress bundled Emacs Lisp source</flag>
32
  <flag name='hesiod'>Enable support for <pkg>net-dns/hesiod</pkg></flag>
33
  <flag name='imagemagick'>Use <pkg>media-gfx/imagemagick</pkg> for image
34
    processing</flag>
35
  <flag name='libxml2'>Use <pkg>dev-libs/libxml2</pkg> to parse XML instead
36
    of the internal Lisp implementations</flag>
37
  <flag name='pax_kernel'>Enable building under a PaX enabled kernel</flag>
38
  <flag name='source'>Install C source files and make them available for
39
    find-function</flag>
40
  <flag name='toolkit-scroll-bars'>Use the selected toolkit's scrollbars in
41
    preference to Emacs' own scrollbars</flag>
42
  <flag name='wide-int'>Prefer wide Emacs integers (typically 62-bit).
43
    This option has an effect only on architectures where "long" and
44
    "long long" types have different size.</flag>
45
</use>
46
</pkgmetadata>

Return to bug 538956