From c3f25a35664cfe0d06ff946157e2302fed763710 Mon Sep 17 00:00:00 2001 From: David Seifert Date: Fri, 12 Feb 2016 22:17:21 +0100 Subject: media-sound/linuxsampler: Fix undefined behaviour in NPTL test Gentoo-Bug: 537516 * EAPI=6 * Replace PTHREAD_CANCEL_ASYNCHRONOUS, which is undefined behaviour when used for a non-pure function Package-Manager: portage-2.2.27 --- .../files/linuxsampler-2.0.0-nptl-hardened.patch | 15 ++++++ .../linuxsampler/linuxsampler-2.0.0-r1.ebuild | 58 ++++++++++++++++++++++ 2 files changed, 73 insertions(+) create mode 100644 media-sound/linuxsampler/files/linuxsampler-2.0.0-nptl-hardened.patch create mode 100644 media-sound/linuxsampler/linuxsampler-2.0.0-r1.ebuild (limited to 'media-sound') diff --git a/media-sound/linuxsampler/files/linuxsampler-2.0.0-nptl-hardened.patch b/media-sound/linuxsampler/files/linuxsampler-2.0.0-nptl-hardened.patch new file mode 100644 index 000000000000..0c61f096c213 --- /dev/null +++ b/media-sound/linuxsampler/files/linuxsampler-2.0.0-nptl-hardened.patch @@ -0,0 +1,15 @@ +Fix breakage caused by undefined behaviour. Using PTHREAD_CANCEL_ASYNCHRONOUS +is only allowed in pure functions. +See also: https://bugs.gentoo.org/show_bug.cgi?id=537516 + +--- linuxsampler-2.0.0/m4/nptl_bug.m4 ++++ linuxsampler-2.0.0/m4/nptl_bug.m4 +@@ -47,7 +47,7 @@ + void* __pthread_launcher(void* p) { + // let the thread be killable under any circumstances + // (without this function call, this test always succeeds !) +- pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, NULL); ++ pthread_setcanceltype(PTHREAD_CANCEL_DEFERRED, NULL); + + // this will block this 2nd thread, since we already + // locked this mutex by the main thread diff --git a/media-sound/linuxsampler/linuxsampler-2.0.0-r1.ebuild b/media-sound/linuxsampler/linuxsampler-2.0.0-r1.ebuild new file mode 100644 index 000000000000..4806c00cf796 --- /dev/null +++ b/media-sound/linuxsampler/linuxsampler-2.0.0-r1.ebuild @@ -0,0 +1,58 @@ +# Copyright 1999-2016 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +EAPI=6 + +inherit autotools eutils + +DESCRIPTION="LinuxSampler is a software audio sampler engine with professional grade features" +HOMEPAGE="http://www.linuxsampler.org/" +SRC_URI="http://download.linuxsampler.org/packages/${P}.tar.bz2" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="doc jack sqlite static-libs" + +RDEPEND="sqlite? ( >=dev-db/sqlite-3.3 ) + >=media-libs/libgig-4.0.0 + media-libs/alsa-lib + jack? ( media-sound/jack-audio-connection-kit )" +DEPEND="${RDEPEND} + virtual/pkgconfig + doc? ( app-doc/doxygen )" +PATCHES=( + "${FILESDIR}/${P}-nptl-hardened.patch" +) + +src_prepare() { + default + # Force regeneration of the file to let it build with all bison + # versions, bug #556204 + rm src/network/lscpparser.cpp || die + eautoreconf +} + +src_configure() { + econf \ + --enable-alsa-driver \ + --disable-arts-driver \ + $(use_enable jack jack-driver) \ + $(use_enable sqlite instruments-db) \ + $(use_enable static-libs static) +} + +src_compile() { + default + use doc && emake docs +} + +src_install() { + default + + docinto html + use doc && dodoc -r doc/html/* + + prune_libtool_files +} -- cgit v1.2.3-65-gdbad