summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--experimental/qt5-qtwebkit/APKBUILD4
-rw-r--r--experimental/qt5-qtwebkit/jsc-port-to-musl.patch81
-rw-r--r--experimental/qt5-qtwebkit/musl-thread-stacksize.patch12
-rw-r--r--system/easy-kernel/APKBUILD4
-rw-r--r--system/easy-kernel/futex-cmpxchg.patch12
-rw-r--r--user/alsa-plugins/APKBUILD58
-rw-r--r--user/alsa-utils/APKBUILD49
-rw-r--r--user/alsa-utils/alsa.confd15
-rw-r--r--user/alsa-utils/alsa.initd88
-rw-r--r--user/alsa-utils/alsaconf.patch12
-rw-r--r--user/bind/APKBUILD11
-rw-r--r--user/bzflag/APKBUILD6
-rw-r--r--user/bzflag/defineAddrLen.patch6
-rw-r--r--user/chrony/APKBUILD6
-rw-r--r--user/chrony/chrony-include-util.patch10
-rw-r--r--user/clang/APKBUILD4
-rw-r--r--user/clang/secure-plt.patch70
-rw-r--r--user/cups-filters/APKBUILD2
-rw-r--r--user/fluxbox/APKBUILD34
-rw-r--r--user/freeglut/APKBUILD33
-rw-r--r--user/fuse/APKBUILD45
-rw-r--r--user/fuse/fix-realpath.patch28
-rw-r--r--user/i3wm/APKBUILD49
-rw-r--r--user/i3wm/i3wm-musl-glob-tilde.patch73
-rw-r--r--user/i3wm/i3wm-test-disable-branch-check.patch10
-rw-r--r--user/i3wm/i3wm-test-fix-off_t.patch26
-rw-r--r--user/imake/APKBUILD27
-rw-r--r--user/iperf3/APKBUILD57
-rw-r--r--user/iperf3/build-fixes.patch20
-rw-r--r--user/iperf3/iperf.confd3
-rw-r--r--user/iperf3/iperf.initd18
-rw-r--r--user/iperf3/remove-pg-flags.patch29
-rw-r--r--user/ipmiutil/APKBUILD37
-rw-r--r--user/ipmiutil/ipmiutil-3.0.7-fix-sha256.patch68
-rw-r--r--user/libxdg-basedir/APKBUILD43
-rw-r--r--user/llvm6/APKBUILD4
-rw-r--r--user/llvm6/secure-plt.patch208
-rw-r--r--user/lua-lgi/APKBUILD35
-rw-r--r--user/mesa-demos/APKBUILD30
-rw-r--r--user/minicom/APKBUILD39
-rw-r--r--user/minicom/fix-includes.patch24
-rw-r--r--user/ncftp/APKBUILD46
-rw-r--r--user/ntfs-3g/APKBUILD40
-rw-r--r--user/perl-inline-c/APKBUILD35
-rw-r--r--user/perl-ipc-run/APKBUILD34
-rw-r--r--user/perl-x11-xcb/APKBUILD11
-rw-r--r--user/screen/APKBUILD43
-rw-r--r--user/screen/utmpx.patch21
-rw-r--r--user/sdl_mixer/APKBUILD44
-rw-r--r--user/sdl_net/APKBUILD46
-rw-r--r--user/tcpdump/APKBUILD38
-rw-r--r--user/tcsh/001-sysmalloc.patch15
-rw-r--r--user/tcsh/002-test_123-posix_fix.patch34
-rw-r--r--user/tcsh/APKBUILD47
-rw-r--r--user/tcsh/tcsh.post-install3
l---------user/tcsh/tcsh.post-upgrade1
-rw-r--r--user/tcsh/tcsh.pre-deinstall3
-rw-r--r--user/valgrind/0001-Ensure-ELFv2-is-supported-on-PPC64.patch817
-rw-r--r--user/valgrind/APKBUILD10
-rw-r--r--user/valgrind/coregrind-elfv2.patch443
-rw-r--r--user/vlc/APKBUILD2
-rw-r--r--user/xinput/APKBUILD33
62 files changed, 2680 insertions, 476 deletions
diff --git a/experimental/qt5-qtwebkit/APKBUILD b/experimental/qt5-qtwebkit/APKBUILD
index 440956b14..fb6c39631 100644
--- a/experimental/qt5-qtwebkit/APKBUILD
+++ b/experimental/qt5-qtwebkit/APKBUILD
@@ -18,6 +18,7 @@ makedepends="$depends_dev ninja sqlite-dev icu-dev ruby perl bison flex gperf
libxrender-dev gst-plugins-base-dev hyphen-dev libexecinfo-dev"
subpackages="$pkgname-dev $pkgname-doc"
source="https://github.com/annulen/webkit/releases/download/$_realname-$_realver/$_realname-$_realver.tar.xz
+ jsc-port-to-musl.patch
musl-thread-stacksize.patch
"
builddir="$srcdir"/$_realname-$_realver
@@ -89,4 +90,5 @@ package() {
}
sha512sums="b15985aab20c5618dc1f71a0d91f02dbed993516272090a4a12990714bf4c9554ccbdcf9d6a143bf46fcc2c170f691e571114d61686fe49791f8d5c540785758 qtwebkit-5.212.0-alpha2.tar.xz
-2b778d55a00107f226231d00f13efb3064f539e2b9b690e3c542ee8b6be975b06b673efa27ececf09e0707c8319cb00f72177d9487ca1c36be5a98ab9eb33124 musl-thread-stacksize.patch"
+19efd97c5f628108d30cc0e5e53f689725cc480ffe1ea90577e5f961d7f35a6a434dda5a03c73c0fb74a30c46ced32bcf580340a2eaf4e72960e61c28ed34dba jsc-port-to-musl.patch
+a8df6d20346882e49745dbdf9bdf2eddf2f3e1ac3301e9fd826397fa746d1d9228deaf2eab0316fa977a85032d6c091559cd5404b7a576e3adc0bec64a5a4ad9 musl-thread-stacksize.patch"
diff --git a/experimental/qt5-qtwebkit/jsc-port-to-musl.patch b/experimental/qt5-qtwebkit/jsc-port-to-musl.patch
new file mode 100644
index 000000000..0b2d7dfce
--- /dev/null
+++ b/experimental/qt5-qtwebkit/jsc-port-to-musl.patch
@@ -0,0 +1,81 @@
+diff -Naur qtwebkit-5.212.0-alpha2-original/Source/JavaScriptCore/heap/MachineStackMarker.cpp qtwebkit-5.212.0-alpha2/Source/JavaScriptCore/heap/MachineStackMarker.cpp
+--- qtwebkit-5.212.0-alpha2-original/Source/JavaScriptCore/heap/MachineStackMarker.cpp 2017-06-04 20:16:05.000000000 +0000
++++ qtwebkit-5.212.0-alpha2/Source/JavaScriptCore/heap/MachineStackMarker.cpp 2018-09-26 02:13:44.660000000 +0000
+@@ -566,7 +566,7 @@
+ #error Unknown Architecture
+ #endif
+
+-#elif defined(__GLIBC__) && ENABLE(JIT)
++#elif defined(__linux__) && ENABLE(JIT)
+
+ #if CPU(X86)
+ return reinterpret_cast<void*>((uintptr_t) regs.machineContext.gregs[REG_ESP]);
+@@ -665,7 +665,7 @@
+ #error Unknown Architecture
+ #endif
+
+-#elif defined(__GLIBC__)
++#elif defined(__linux__)
+
+ // The following sequence depends on glibc's sys/ucontext.h.
+ #if CPU(X86)
+@@ -747,7 +747,7 @@
+ #error Unknown Architecture
+ #endif
+
+-#elif defined(__GLIBC__)
++#elif defined(__linux__)
+
+ // The following sequence depends on glibc's sys/ucontext.h.
+ #if CPU(X86)
+@@ -838,7 +838,7 @@
+ #error Unknown Architecture
+ #endif
+
+-#elif defined(__GLIBC__)
++#elif defined(__linux__)
+
+ // The following sequence depends on glibc's sys/ucontext.h.
+ #if CPU(X86)
+diff -Naur qtwebkit-5.212.0-alpha2-original/Source/ThirdParty/ANGLE/src/compiler/preprocessor/ExpressionParser.cpp qtwebkit-5.212.0-alpha2/Source/ThirdParty/ANGLE/src/compiler/preprocessor/ExpressionParser.cpp
+--- qtwebkit-5.212.0-alpha2-original/Source/ThirdParty/ANGLE/src/compiler/preprocessor/ExpressionParser.cpp 2017-06-04 20:16:06.000000000 +0000
++++ qtwebkit-5.212.0-alpha2/Source/ThirdParty/ANGLE/src/compiler/preprocessor/ExpressionParser.cpp 2018-09-26 02:12:36.770000000 +0000
+@@ -828,7 +828,7 @@
+ #if YYERROR_VERBOSE
+
+ # ifndef yystrlen
+-# if defined __GLIBC__ && defined _STRING_H
++# if defined __linux__ && defined _STRING_H
+ # define yystrlen strlen
+ # else
+ /* Return the length of YYSTR. */
+@@ -844,7 +844,7 @@
+ # endif
+
+ # ifndef yystpcpy
+-# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
++# if defined __linux__ && defined _STRING_H && defined _GNU_SOURCE
+ # define yystpcpy stpcpy
+ # else
+ /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
+diff -Naur qtwebkit-5.212.0-alpha2-original/Source/ThirdParty/ANGLE/src/compiler/translator/glslang_tab.cpp qtwebkit-5.212.0-alpha2/Source/ThirdParty/ANGLE/src/compiler/translator/glslang_tab.cpp
+--- qtwebkit-5.212.0-alpha2-original/Source/ThirdParty/ANGLE/src/compiler/translator/glslang_tab.cpp 2017-06-04 20:16:06.000000000 +0000
++++ qtwebkit-5.212.0-alpha2/Source/ThirdParty/ANGLE/src/compiler/translator/glslang_tab.cpp 2018-09-26 02:12:54.740000000 +0000
+@@ -1835,7 +1835,7 @@
+ #if YYERROR_VERBOSE
+
+ # ifndef yystrlen
+-# if defined __GLIBC__ && defined _STRING_H
++# if defined __linux__ && defined _STRING_H
+ # define yystrlen strlen
+ # else
+ /* Return the length of YYSTR. */
+@@ -1851,7 +1851,7 @@
+ # endif
+
+ # ifndef yystpcpy
+-# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
++# if defined __linux__ && defined _STRING_H && defined _GNU_SOURCE
+ # define yystpcpy stpcpy
+ # else
+ /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
diff --git a/experimental/qt5-qtwebkit/musl-thread-stacksize.patch b/experimental/qt5-qtwebkit/musl-thread-stacksize.patch
index b1e42b7d0..e790222dc 100644
--- a/experimental/qt5-qtwebkit/musl-thread-stacksize.patch
+++ b/experimental/qt5-qtwebkit/musl-thread-stacksize.patch
@@ -32,16 +32,18 @@
#if HAVE(QOS_CLASSES)
pthread_attr_set_qos_class_np(&attr, QOS_CLASS_USER_INITIATED, 0);
#endif
---- qtwebkit-5.212.0-alpha2/Source/JavaScriptCore/runtime/Options.h.old 2017-06-04 15:16:05.000000000 -0500
-+++ qtwebkit-5.212.0-alpha2/Source/JavaScriptCore/runtime/Options.h 2018-09-04 22:29:51.050000000 -0500
+--- qtwebkit-5.212.0-alpha2/Source/JavaScriptCore/runtime/Options.h.old 2017-06-04 20:16:05.000000000 +0000
++++ qtwebkit-5.212.0-alpha2/Source/JavaScriptCore/runtime/Options.h 2018-09-26 03:02:39.700000000 +0000
@@ -112,9 +112,9 @@
\
v(bool, reportMustSucceedExecutableAllocations, false, nullptr) \
\
- v(unsigned, maxPerThreadStackUsage, 4 * MB, nullptr) \
-+ v(unsigned, maxPerThreadStackUsage, 1 * MB, nullptr) \
- v(unsigned, reservedZoneSize, 128 * KB, nullptr) \
- v(unsigned, errorModeReservedZoneSize, 64 * KB, nullptr) \
+- v(unsigned, reservedZoneSize, 128 * KB, nullptr) \
+- v(unsigned, errorModeReservedZoneSize, 64 * KB, nullptr) \
++ v(unsigned, maxPerThreadStackUsage, 512 * KB, nullptr) \
++ v(unsigned, reservedZoneSize, 32 * KB, nullptr) \
++ v(unsigned, errorModeReservedZoneSize, 16 * KB, nullptr) \
\
v(bool, crashIfCantAllocateJITMemory, false, nullptr) \
v(unsigned, jitMemoryReservationSize, 0, "Set this number to change the executable allocation size in ExecutableAllocatorFixedVMPool. (In bytes.)") \
diff --git a/system/easy-kernel/APKBUILD b/system/easy-kernel/APKBUILD
index 4a9395acd..c8ac1329a 100644
--- a/system/easy-kernel/APKBUILD
+++ b/system/easy-kernel/APKBUILD
@@ -23,6 +23,7 @@ source="https://cdn.kernel.org/pub/linux/kernel/v4.x/linux-4.14.tar.xz
config-x86_64
config-pmmx
config-aarch64
+ futex-cmpxchg.patch
"
builddir="$srcdir/linux-4.14"
@@ -108,4 +109,5 @@ e41d9111219342ad13367902242444ecdd847a93575c3f9709d6c6a075bc650f4a15be9db1a87984
1112f6c3fcfd7fdc0ef4d5e85df5d3adea430a9c7b4c2b34508a215f7ba14c863ccd7a5e17f13ed46c518bafec30cfb3ced70c465137c14ef5fc998b6cbcca1f config-ppc
438a66561200d570b3bf6ab0481d9725a9f482b1fcf852a90f99c6db5aa4ee02d2b67b57235bb7afc01515a79289407cbe111536340824d7a391ce1a658c9a76 config-x86_64
e8f7749877c5b2574e7e853b757477b8f99d757b43225d4f83d611c20215b8b2690cc85369608c2dc8f7d6a619136a2d7dde4648031e37d2ae4dcc5ba85652c8 config-pmmx
-0174e758ea318171c8036426ed0ad22aaafbdbac755732a46397686ec8dd24e977447f6fc275d59eed43ea047fc8a36061b7ad0d5862d522222455a60c943027 config-aarch64"
+0174e758ea318171c8036426ed0ad22aaafbdbac755732a46397686ec8dd24e977447f6fc275d59eed43ea047fc8a36061b7ad0d5862d522222455a60c943027 config-aarch64
+64486a4f53046a69f727cecd8c39400b50c2d2b15e3b5ca8c18b8249d25990f3a872ec064800ba3d190f9d25b4518899b9ea3675920f487108102856d6beb51e futex-cmpxchg.patch"
diff --git a/system/easy-kernel/futex-cmpxchg.patch b/system/easy-kernel/futex-cmpxchg.patch
new file mode 100644
index 000000000..9e2aabfb7
--- /dev/null
+++ b/system/easy-kernel/futex-cmpxchg.patch
@@ -0,0 +1,12 @@
+diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
+index 9f2b75f..d75d8ea 100644
+--- a/arch/powerpc/Kconfig
++++ b/arch/powerpc/Kconfig
+@@ -190,6 +190,7 @@ config PPC
+ select HAVE_FTRACE_MCOUNT_RECORD
+ select HAVE_FUNCTION_GRAPH_TRACER
+ select HAVE_FUNCTION_TRACER
++ select HAVE_FUTEX_CMPXCHG if FUTEX
+ select HAVE_GCC_PLUGINS
+ select HAVE_GENERIC_GUP
+ select HAVE_HW_BREAKPOINT if PERF_EVENTS && (PPC_BOOK3S || PPC_8xx)
diff --git a/user/alsa-plugins/APKBUILD b/user/alsa-plugins/APKBUILD
new file mode 100644
index 000000000..304b63ab4
--- /dev/null
+++ b/user/alsa-plugins/APKBUILD
@@ -0,0 +1,58 @@
+# Contributor: Taner Tas <taner76@gmail.com>
+# Maintainer: Max Rees <maxcrees@me.com>
+pkgname=alsa-plugins
+pkgver=1.1.6
+pkgrel=0
+pkgdesc="Advanced Linux Sound Architecture (ALSA) plugins"
+url="https://www.alsa-project.org/main/index.php/Main_Page"
+arch="all"
+options="!check" # No test suite.
+license="GPL-2.0+ AND LGPL-2.1+ AND BSD-3-Clause AND MIT"
+makedepends="linux-headers alsa-lib-dev speexdsp-dev ffmpeg-dev
+ libsamplerate-dev pulseaudio-dev"
+subpackages="$pkgname-lavcrate $pkgname-pulse $pkgname-a52"
+source="ftp://ftp.alsa-project.org/pub/plugins/$pkgname-$pkgver.tar.bz2"
+
+prepare() {
+ default_prepare
+ update_config_sub
+}
+
+build() {
+ cd "$builddir"
+ ./configure \
+ --build=$CBUILD \
+ --host=$CHOST \
+ --prefix=/usr \
+ --sysconfdir=/etc \
+ --mandir=/usr/share/man \
+ --localstatedir=/var
+ make
+}
+
+package() {
+ cd "$builddir"
+ make DESTDIR="$pkgdir" install
+ find "$pkgdir" -name '*.la' -type f -delete
+}
+
+lavcrate() {
+ pkgdesc="FFmpeg samplerate conversion plugins for ALSA"
+ mkdir -p "$subpkgdir"/usr/lib/alsa-lib/
+ mv "$pkgdir"/usr/lib/alsa-lib/*lavcrate* "$subpkgdir"/usr/lib/alsa-lib/
+}
+
+pulse() {
+ pkgdesc="PulseAudio support for ALSA-only applications"
+ mkdir -p "$subpkgdir"/usr/lib/alsa-lib/
+ mv "$pkgdir"/usr/lib/alsa-lib/*pulse.so "$subpkgdir"/usr/lib/alsa-lib/
+ mv "$pkgdir"/usr/share "$subpkgdir"/usr/
+}
+
+a52() {
+ pkgdesc="S16 linear sound format to A52 compressed format for SPDIF output"
+ mkdir -p "$subpkgdir"/usr/lib/alsa-lib/
+ mv "$pkgdir"/usr/lib/alsa-lib/*a52.so "$subpkgdir"/usr/lib/alsa-lib/
+}
+
+sha512sums="f01633cd7166a2fba4c5b4d5d786b5a2122f6a810f5b5b7209c42033759d116a4515174e7ee57973d5de716be88a246d733dc5a2daf92b72377c274b04db401b alsa-plugins-1.1.6.tar.bz2"
diff --git a/user/alsa-utils/APKBUILD b/user/alsa-utils/APKBUILD
new file mode 100644
index 000000000..7ecea8193
--- /dev/null
+++ b/user/alsa-utils/APKBUILD
@@ -0,0 +1,49 @@
+# Contributor: Leonardo Arena <rnalrd@alpinelinux.org>
+# Maintainer: Max Rees <maxcrees@me.com>
+pkgname=alsa-utils
+pkgver=1.1.6
+pkgrel=0
+pkgdesc="Advanced Linux Sound Architecture (ALSA) utilities"
+url="https://www.alsa-project.org/main/index.php/Main_Page"
+arch="all"
+options="!check" # No test suite.
+license="GPL-2.0+ AND LGPL-2.0+ AND ISC AND GPL-2.0-only"
+makedepends="alsa-lib-dev fftw-dev ncurses-dev pciutils-dev"
+depends="bash dialog"
+subpackages="$pkgname-doc $pkgname-dbg $pkgname-lang $pkgname-openrc"
+replaces="alsaconf"
+source="ftp://ftp.alsa-project.org/pub/utils/$pkgname-$pkgver.tar.bz2
+ alsaconf.patch
+ alsa.initd
+ alsa.confd
+"
+
+prepare() {
+ default_prepare
+ update_config_sub
+}
+
+build() {
+ cd "$builddir"
+ ./configure \
+ --build=$CBUILD \
+ --host=$CHOST \
+ --prefix=/usr \
+ --sysconfdir=/etc \
+ --mandir=/usr/share/man \
+ --localstatedir=/var \
+ --disable-xmlto
+ make
+}
+
+package() {
+ cd "$builddir"
+ make DESTDIR="$pkgdir" install
+ install -Dm755 ../alsa.initd "$pkgdir"/etc/init.d/alsa
+ install -Dm644 ../alsa.confd "$pkgdir"/etc/conf.d/alsa
+}
+
+sha512sums="24d0ffaeeccecb3276d7d35ef51e6de6026a63fa5a1a1e4605b024f54d8097717e97ec9d33cfe50830ad17e4a89268ca24b065039b0df7f9fbe02b570617aa58 alsa-utils-1.1.6.tar.bz2
+817215be6e9f103a8a187df5b1142c4d2e952f547a64579a9b8cfa58bd762d6a55bde75c0f66f018c0597744d07ccdb08216f7b368db464e36667cecedcc00f3 alsaconf.patch
+8a52e6363d5dcfb16e1e607e1af3e46a2148989689e5ab04caf05f84dc68b34cc003b1cf0945ce2c3670cc7f3ef0e40824f689f1efa2d09177c82b13571a7168 alsa.initd
+6e716e6230fd3d2c33e3cb2dbf572d632c9ac6452c1768388bea7d3ca22f7c72cf6bcd702580f45cb9089983582011c8b04cbdb4420d14fb988167b1391ea547 alsa.confd"
diff --git a/user/alsa-utils/alsa.confd b/user/alsa-utils/alsa.confd
new file mode 100644
index 000000000..d47edb124
--- /dev/null
+++ b/user/alsa-utils/alsa.confd
@@ -0,0 +1,15 @@
+# RESTORE_ON_START:
+# Do you want to restore your mixer settings? If not, your cards will be
+# muted.
+# no - Do not restore state
+# yes - Restore state
+
+RESTORE_ON_START="yes"
+
+# SAVE_ON_STOP:
+# Do you want to save changes made to your mixer volumes when alsasound
+# stops?
+# no - Do not save state
+# yes - Save state
+
+SAVE_ON_STOP="yes"
diff --git a/user/alsa-utils/alsa.initd b/user/alsa-utils/alsa.initd
new file mode 100644
index 000000000..e0a1215cf
--- /dev/null
+++ b/user/alsa-utils/alsa.initd
@@ -0,0 +1,88 @@
+#!/sbin/openrc-run
+# $Header: /var/cvsroot/gentoo-x86/media-sound/alsa-utils/files/alsasound.initd-r6,v 1.1 2014/06/23 21:34:42 ssuominen Exp $
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+alsastatedir=/var/lib/alsa
+alsascrdir=/etc/alsa.d
+alsahomedir=/var/run/alsasound
+
+extra_commands="save restore"
+
+depend() {
+ need localmount
+ after bootmisc modules isapnp coldplug hotplug
+}
+
+restore() {
+ ebegin "Restoring Mixer Levels"
+
+ checkpath -q -d -m 0700 -o root:root ${alsahomedir} || return 1
+
+ if [ ! -r "${alsastatedir}/asound.state" ] ; then
+ ewarn "No mixer config in ${alsastatedir}/asound.state, you have to unmute your card!"
+ eend 0
+ return 0
+ fi
+
+ local cards="$(sed -n -e 's/ *\([[:digit:]]*\) .*/\1/p' /proc/asound/cards)"
+ local CARDNUM
+ for cardnum in ${cards}; do
+ [ -e /dev/snd/controlC${cardnum} ] || sleep 2
+ [ -e /dev/snd/controlC${cardnum} ] || sleep 2
+ [ -e /dev/snd/controlC${cardnum} ] || sleep 2
+ [ -e /dev/snd/controlC${cardnum} ] || sleep 2
+ alsactl -E HOME="${alsahomedir}" -I -f "${alsastatedir}/asound.state" restore ${cardnum} \
+ || ewarn "Errors while restoring defaults, ignoring"
+ done
+
+ for ossfile in "${alsastatedir}"/oss/card*_pcm* ; do
+ [ -e "${ossfile}" ] || continue
+ # We use cat because I'm not sure if cp works properly on /proc
+ local procfile=${ossfile##${alsastatedir}/oss}
+ procfile="$(echo "${procfile}" | sed -e 's,_,/,g')"
+ if [ -e /proc/asound/"${procfile}"/oss ] ; then
+ cat "${ossfile}" > /proc/asound/"${procfile}"/oss
+ fi
+ done
+
+ eend 0
+}
+
+save() {
+ ebegin "Storing ALSA Mixer Levels"
+
+ checkpath -q -d -m 0700 -o root:root ${alsahomedir} || return 1
+
+ mkdir -p "${alsastatedir}"
+ if ! alsactl -E HOME="${alsahomedir}" -f "${alsastatedir}/asound.state" store; then
+ eerror "Error saving levels."
+ eend 1
+ return 1
+ fi
+
+ for ossfile in /proc/asound/card*/pcm*/oss; do
+ [ -e "${ossfile}" ] || continue
+ local device=${ossfile##/proc/asound/} ; device=${device%%/oss}
+ device="$(echo "${device}" | sed -e 's,/,_,g')"
+ mkdir -p "${alsastatedir}/oss/"
+ cp "${ossfile}" "${alsastatedir}/oss/${device}"
+ done
+
+ eend 0
+}
+
+start() {
+ if [ "${RESTORE_ON_START}" = "yes" ]; then
+ restore
+ fi
+
+ return 0
+}
+
+stop() {
+ if [ "${SAVE_ON_STOP}" = "yes" ]; then
+ save
+ fi
+ return 0
+}
diff --git a/user/alsa-utils/alsaconf.patch b/user/alsa-utils/alsaconf.patch
new file mode 100644
index 000000000..a7dec1c9a
--- /dev/null
+++ b/user/alsa-utils/alsaconf.patch
@@ -0,0 +1,12 @@
+diff -Naur alsa-utils-1.0.9a-orig/alsaconf/alsaconf.in alsa-utils-1.0.9a/alsaconf/alsaconf.in
+--- alsa-utils-1.0.9a-orig/alsaconf/alsaconf.in 2005-03-24 00:24:52.000000000 -0800
++++ alsa-utils-1.0.9a/alsaconf/alsaconf.in 2005-07-18 09:25:02.000000000 -0700
+@@ -65,6 +58,8 @@
+ distribution="redhat"
+ elif test -f /etc/fedora-release && grep -q "Fedora" /etc/fedora-release; then
+ distribution="fedora"
++elif test -f /etc/adelie-release; then
++ distribution="adelie"
+ elif [ -f /etc/slackware-version -o -f /etc/slamd64-version ]; then
+ distribution="slackware"
+ else
diff --git a/user/bind/APKBUILD b/user/bind/APKBUILD
index db712b5a6..7e0b38e15 100644
--- a/user/bind/APKBUILD
+++ b/user/bind/APKBUILD
@@ -4,12 +4,12 @@
# Contributor: Natanael Copa <ncopa@alpinelinux.org>
# Maintainer: Dan Theisen <djt@hxx.in>
pkgname=bind
-pkgver=9.13.2
+pkgver=9.13.3
_p=${pkgver#*_p}
_ver=${pkgver%_p*}
_major=${pkgver%%.*}
[ "$_p" != "$pkgver" ] && _ver="${_ver}-P$_p"
-pkgrel=0
+pkgrel=1
pkgdesc="The ISC DNS server"
url="https://www.isc.org/downloads/bind/"
arch="all"
@@ -24,7 +24,7 @@ options="!check"
license="ISC AND Apache-2.0 AND OpenSSL AND BSD-2-Clause AND BSD-3-Clause AND BSD-4-Clause"
pkgusers="named"
pkggroups="named"
-makedepends="bash libressl-dev libcap-dev perl linux-headers bsd-compat-headers libxml2-dev json-c-dev"
+makedepends="bash openssl-dev libcap-dev perl linux-headers bsd-compat-headers libxml2-dev json-c-dev"
install="$pkgname.pre-install"
subpackages="$pkgname-doc $pkgname-dev $pkgname-libs $pkgname-openrc $pkgname-tools"
source="https://ftp.isc.org/isc/${pkgname}${_major}/$_ver/$pkgname-$_ver.tar.gz
@@ -40,6 +40,9 @@ source="https://ftp.isc.org/isc/${pkgname}${_major}/$_ver/$pkgname-$_ver.tar.gz
builddir="$srcdir/$pkgname-$_ver"
# secfixes:
+# 9.13.3:
+# - CVE-2018-5741
+# - CVE-2018-5740
# 9.13.2:
# - CVE-2018-5738
# 9.12.1_p2-r0:
@@ -144,7 +147,7 @@ tools() {
done
}
-sha512sums="d4a3e818fc9dd858489d42058b7c3c853848da40e2498b282ba1e6bb2cb8ec612ed2e47cf0afbeea19ddb898a3d87e0a57b2339befe5a8d11f5a3b7c0b715082 bind-9.13.2.tar.gz
+sha512sums="980f294ef7b75c9a0917212e26300037ad6a33ff3565c099a6bad15350f0738491396a22a40dd552efd7fd25634f82f236abca4f83b4c8a9c580099851dd3c83 bind-9.13.3.tar.gz
7167dccdb2833643dfdb92994373d2cc087e52ba23b51bd68bd322ff9aca6744f01fa9d8a4b9cd8c4ce471755a85c03ec956ec0d8a1d4fae02124ddbed6841f6 bind.so_bsdcompat.patch
196c0a3b43cf89e8e3547d7fb63a93ff9a3306505658dfd9aa78e6861be6b226580b424dd3dd44b955b2d9f682b1dc62c457f3ac29ce86200ef070140608c015 named.initd
127bdcc0b5079961f0951344bc3fad547450c81aee2149eac8c41a8c0c973ea0ffe3f956684c6fcb735a29c43d2ff48c153b6a71a0f15757819a72c492488ddf named.confd
diff --git a/user/bzflag/APKBUILD b/user/bzflag/APKBUILD
index dfa85b0bc..23d1a30dd 100644
--- a/user/bzflag/APKBUILD
+++ b/user/bzflag/APKBUILD
@@ -1,7 +1,7 @@
# Contributor: Dan Theisen <djt@hxx.in>
# Maintainer: Dan Theisen <djt@hxx.in>
pkgname=bzflag
-pkgver=2.4.14
+pkgver=2.4.16
pkgrel=0
pkgdesc="3D networked multi-player multi-platform tank battle game"
url="https://www.bzflag.org/"
@@ -35,5 +35,5 @@ package() {
make DESTDIR="$pkgdir" install
}
-sha512sums="9a9d4c9fee5b33613691e1b2d4ec4582bd89d8726122d42994933404c9fdeeaf5256ef5d77a56232a1026c2f2689ff342a1e4ff3d6bdd1596f91f0e7fdd1e80d bzflag-2.4.14.tar.bz2
-568e581dd82ca28aa43281a86867408c726ad4f2145f115a5d3535dbc472463c94288e9349ced715004191af0925daff7e3d55fe1db3ab35554352cc703d79b9 defineAddrLen.patch"
+sha512sums="809adc39088f3fc8ca0d2ead9c7172cfbe582789bc80b3ac55fabe078a0868f0cf7cfa8027ac696718e9983a19386933fd370684a0bd33e63c3106f2ce8a9d63 bzflag-2.4.16.tar.bz2
+6c7a1873706140b1b0b254d6f8350f47adef8f499a7e7b3418331beda11bdc71e2e0dee74e17d4a955960de66adf90d22796b440e1afa78d328077235e2e3dde defineAddrLen.patch"
diff --git a/user/bzflag/defineAddrLen.patch b/user/bzflag/defineAddrLen.patch
index b1189dcac..a25eb96c3 100644
--- a/user/bzflag/defineAddrLen.patch
+++ b/user/bzflag/defineAddrLen.patch
@@ -1,11 +1,11 @@
---- a/include/network.h 2018-04-23 23:17:50.969874036 -0700
-+++ b/include/network.h 2018-04-23 23:18:37.750554121 -0700
+--- bzflag-2.4.16/include/network.h.old 2018-09-27 19:16:48.015111918 -0700
++++ bzflag-2.4.16/include/network.h 2018-09-27 19:17:06.195370763 -0700
@@ -57,7 +57,7 @@
# include <bstring.h>
#endif
-#if defined(BSD) || defined(__sun__) || defined(__GLIBC__)
+#if defined(BSD) || defined(__sun__) || defined(__linux__)
- # define AddrLen socklen_t
+ # define AddrLen socklen_t
#elif defined (__APPLE__)
# include <AvailabilityMacros.h>
diff --git a/user/chrony/APKBUILD b/user/chrony/APKBUILD
index 494b70946..5f460b632 100644
--- a/user/chrony/APKBUILD
+++ b/user/chrony/APKBUILD
@@ -3,7 +3,7 @@
# Contributor: Natanael Copa <ncopa@alpinelinux.org>
# Maintainer: Dan Theisen <djt@hxx.in>
pkgname=chrony
-pkgver=3.3
+pkgver=3.4
pkgrel=0
_ver=${pkgver/_/-}
pkgdesc="NTP client and server programs"
@@ -20,6 +20,7 @@ subpackages="$pkgname-doc $pkgname-openrc"
source="https://download.tuxfamily.org/$pkgname/$pkgname-$_ver.tar.gz
fix-tests.patch
max_resolve_interval.patch
+ chrony-include-util.patch
chronyd.confd
chronyd.initd
chrony.logrotate
@@ -89,9 +90,10 @@ package() {
chown -R $pkgusers:$pkggroups "$pkgdir"/var/lib/chrony
}
-sha512sums="36975d863599141e8e5b071d35cf67326b27f5b0da7ec942dbb4530377d10472b0729eea632e0702718b515cb2d5fd41a7eba158e6dade7f05adfb1bdffa5df0 chrony-3.3.tar.gz
+sha512sums="4fbb0311c8d363a87edd6f5d1be3d8554da169f260ba23c1ad9e8c567808258c6fd7513ba630d6fa27453ecfd81f0ece0e26d5ee2f98ca47fbc9887181a36918 chrony-3.4.tar.gz
067d47224a8c075ec8f63ffc58e65b030fdf228a72c4f03d50a2f2c17414da65bb5d27c7c2e4ba99e909f452041db83eaebe3c9e34c0c8fce18e05ebb489735e fix-tests.patch
b26581ed32680585edea5b8163a0062a87f648394c0f363c77a7d01a36608fcf4d005d9e6ab179ed2827b8a08f598f7bad4801bb5e135cad5107eb77fb19b247 max_resolve_interval.patch
+30f1ed28e0d956c994abd770c68634c7d5c69ded04a2fbfd387bbd8009bc0102ce57934ce41e468fc6b2c7f8fefdab73d97f6d6ff39ec93fffa6575fa1451fbd chrony-include-util.patch
1ebb72341b4421060a43d6db164d743de9144f1c23370e052f0db92a17e5e34f24ac98baddeb5dbfef27f67479142d448c4401d927394e55024760730a27e8de chronyd.confd
9a18c9744d7b78d9b9be3f0ae0b43cb988b294c342764802e0d5df835d450e748584c0b345f7161f14d84e15c8bbd491514ee9dc45e4a65f1276c52124d2e312 chronyd.initd
ab38f06bf45888846778ad935e24abb30d13b6805e9a750bc694ff953695fa8c5b33aac560f5f7f96dc46031c1a38660e5c418b6fce6fb34a87908a9a3c99357 chrony.logrotate
diff --git a/user/chrony/chrony-include-util.patch b/user/chrony/chrony-include-util.patch
new file mode 100644
index 000000000..20b43c187
--- /dev/null
+++ b/user/chrony/chrony-include-util.patch
@@ -0,0 +1,10 @@
+--- chrony-3.4/hash_intmd5.c.old 2018-09-27 19:29:57.386348229 -0700
++++ chrony-3.4/hash_intmd5.c 2018-09-27 19:30:07.696494803 -0700
+@@ -29,6 +29,7 @@
+ #include "sysincl.h"
+ #include "hash.h"
+ #include "memory.h"
++#include "util.h"
+
+ #include "md5.c"
+
diff --git a/user/clang/APKBUILD b/user/clang/APKBUILD
index 826ca3373..a95693351 100644
--- a/user/clang/APKBUILD
+++ b/user/clang/APKBUILD
@@ -19,6 +19,7 @@ source="https://llvm.org/releases/$pkgver/cfe-$pkgver.src.tar.xz
0001-Add-support-for-Ad-lie-Linux.patch
0008-Fix-ClangConfig-cmake-LLVM-path.patch
use-llvm-lit.patch
+ secure-plt.patch
"
builddir="$srcdir/cfe-$pkgver.src"
@@ -86,4 +87,5 @@ analyzer() {
sha512sums="f64ba9290059f6e36fee41c8f32bf483609d31c291fcd2f77d41fecfdf3c8233a5e23b93a1c73fed03683823bd6e72757ed993dd32527de3d5f2b7a64bb031b9 cfe-6.0.1.src.tar.xz
44aa152d50822a9e1a223b9e07e150ffa830c55deb4c4ca29e6218a0103eb263a00b41fd1ca84390e65fa08005901a0a0f88cf529bff8764220e99d06adef5fc 0001-Add-support-for-Ad-lie-Linux.patch
9485fe4fd6182df543735ed8f4ce618693d0faeafa86d3f9574a6c7abf50978e2d56e0a94be3ed94d515cc937c388d66ceff1bbc9bb120d371b6d3e95340da00 0008-Fix-ClangConfig-cmake-LLVM-path.patch
-8a596e7369b5791e7e9c3278320aa5bac30d91f27d9a0df335ea862c359623869353d12145c3b64730f721600522f3acc5abe706428091482e0209e4ff308175 use-llvm-lit.patch"
+8a596e7369b5791e7e9c3278320aa5bac30d91f27d9a0df335ea862c359623869353d12145c3b64730f721600522f3acc5abe706428091482e0209e4ff308175 use-llvm-lit.patch
+23c3de4f8cbfa115b337ee115b4f95eb1ce3b8c6451de590b0ecf196a4b3bc96ab1d88029edf7f0c51299dffb7b2a05cade9c64c72dba18d858686466bb82bad secure-plt.patch"
diff --git a/user/clang/secure-plt.patch b/user/clang/secure-plt.patch
new file mode 100644
index 000000000..c1b4cb1de
--- /dev/null
+++ b/user/clang/secure-plt.patch
@@ -0,0 +1,70 @@
+Index: cfe/include/clang/Driver/Options.td
+===================================================================
+--- cfe/include/clang/Driver/Options.td
++++ cfe/include/clang/Driver/Options.td
+@@ -1957,6 +1957,7 @@
+ def mno_altivec : Flag<["-"], "mno-altivec">, Group<m_ppc_Features_Group>;
+ def mvsx : Flag<["-"], "mvsx">, Group<m_ppc_Features_Group>;
+ def mno_vsx : Flag<["-"], "mno-vsx">, Group<m_ppc_Features_Group>;
++def msecure_plt : Flag<["-"], "msecure-plt">, Group<m_ppc_Features_Group>;
+ def mpower8_vector : Flag<["-"], "mpower8-vector">,
+ Group<m_ppc_Features_Group>;
+ def mno_power8_vector : Flag<["-"], "mno-power8-vector">,
+Index: cfe/lib/Driver/ToolChains/Arch/PPC.h
+===================================================================
+--- cfe/lib/Driver/ToolChains/Arch/PPC.h
++++ cfe/lib/Driver/ToolChains/Arch/PPC.h
+@@ -29,10 +29,17 @@
+ Hard,
+ };
+
++enum class ReadGOTPtrMode {
++ Bss,
++ SecurePlt,
++};
++
+ FloatABI getPPCFloatABI(const Driver &D, const llvm::opt::ArgList &Args);
+
+ std::string getPPCTargetCPU(const llvm::opt::ArgList &Args);
+ const char *getPPCAsmModeForCPU(StringRef Name);
++ReadGOTPtrMode getPPCReadGOTPtrMode(const Driver &D,
++ const llvm::opt::ArgList &Args);
+
+ void getPPCTargetFeatures(const Driver &D, const llvm::Triple &Triple,
+ const llvm::opt::ArgList &Args,
+Index: cfe/lib/Driver/ToolChains/Arch/PPC.cpp
+===================================================================
+--- cfe/lib/Driver/ToolChains/Arch/PPC.cpp
++++ cfe/lib/Driver/ToolChains/Arch/PPC.cpp
+@@ -106,6 +106,16 @@
+ ppc::FloatABI FloatABI = ppc::getPPCFloatABI(D, Args);
+ if (FloatABI == ppc::FloatABI::Soft)
+ Features.push_back("-hard-float");
++
++ ppc::ReadGOTPtrMode ReadGOT = ppc::getPPCReadGOTPtrMode(D, Args);
++ if (ReadGOT == ppc::ReadGOTPtrMode::SecurePlt)
++ Features.push_back("+secure-plt");
++}
++
++ppc::ReadGOTPtrMode ppc::getPPCReadGOTPtrMode(const Driver &D, const ArgList &Args) {
++ if (Args.getLastArg(options::OPT_msecure_plt))
++ return ppc::ReadGOTPtrMode::SecurePlt;
++ return ppc::ReadGOTPtrMode::Bss;
+ }
+
+ ppc::FloatABI ppc::getPPCFloatABI(const Driver &D, const ArgList &Args) {
+Index: cfe/test/Driver/ppc-features.cpp
+===================================================================
+--- cfe/test/Driver/ppc-features.cpp
++++ cfe/test/Driver/ppc-features.cpp
+@@ -22,6 +22,10 @@
+ // RUN: %clang -target powerpc-unknown-linux-gnu %s -msoft-float -mhard-float -### -o %t.o 2>&1 | FileCheck --check-prefix=CHECK-SOFTHARD %s
+ // CHECK-SOFTHARD-NOT: "-target-feature" "-hard-float"
+
++// check -msecure-plt option for ppc32
++// RUN: %clang -target powerpc-unknown-linux-gnu -msecure-plt %s -### -o %t.o 2>&1 | FileCheck --check-prefix=CHECK-SECUREPLT %s
++// CHECK-SECUREPLT: "-target-feature" "+secure-plt"
++
+ // check -mfloat-abi=x option
+ // RUN: %clang -target powerpc-unknown-linux-gnu %s -mfloat-abi=x -### -o %t.o 2>&1 | FileCheck --check-prefix=CHECK-ERRMSG %s
+ // CHECK-ERRMSG: error: invalid float ABI '-mfloat-abi=x'
diff --git a/user/cups-filters/APKBUILD b/user/cups-filters/APKBUILD
index 4a29feb9c..9e174a77c 100644
--- a/user/cups-filters/APKBUILD
+++ b/user/cups-filters/APKBUILD
@@ -1,7 +1,7 @@
# Maintainer: Max Rees <maxcrees@me.com>
pkgname=cups-filters
pkgver=1.21.2
-pkgrel=0
+pkgrel=1
pkgdesc="OpenPrinting CUPS filters and backends"
url="https://www.linuxfoundation.org/collaborate/workgroups/openprinting/pdf_as_standard_print_job_format"
arch="all"
diff --git a/user/fluxbox/APKBUILD b/user/fluxbox/APKBUILD
new file mode 100644
index 000000000..ca5245921
--- /dev/null
+++ b/user/fluxbox/APKBUILD
@@ -0,0 +1,34 @@
+# Contributor: Natanael Copa <ncopa@alpinelinux.org>
+# Maintainer: Dan Theisen <djt@hxx.in>
+pkgname=fluxbox
+pkgver=1.3.7
+pkgrel=0
+pkgdesc="A lightweight and highly-configurable window manager"
+url="http://www.fluxbox.org"
+arch="all"
+license="MIT"
+options="!check" # This package has a broken testsuite
+depends=""
+makedepends="libxinerama-dev libxpm-dev libxrandr imlib2-dev libxrender-dev
+ libxrandr-dev libxinerama-dev freetype-dev libxft-dev xorgproto"
+subpackages="$pkgname-doc"
+source="http://downloads.sourceforge.net/sourceforge/$pkgname/$pkgname-$pkgver.tar.bz2"
+
+build() {
+ cd "$builddir"
+ # TODO: Enable NLS when we get 'gencat'
+ ./configure \
+ --build=$CBUILD \
+ --host=$CHOST \
+ --prefix=/usr \
+ --enable-imlib2 \
+ --disable-nls
+ make
+}
+
+package() {
+ cd "$builddir"
+ make DESTDIR="$pkgdir" install
+}
+
+sha512sums="c40cc765f5d542210e18dca21b98b97a048c6685b605a68e2c64f4e886329f4e6d3a3a7e76b3ca0ce488242f38d0ee2a4d6dfebc9ce97d37c68f84c3948aac8c fluxbox-1.3.7.tar.bz2"
diff --git a/user/freeglut/APKBUILD b/user/freeglut/APKBUILD
new file mode 100644
index 000000000..f89c0cac6
--- /dev/null
+++ b/user/freeglut/APKBUILD
@@ -0,0 +1,33 @@
+# Contributor: William Pitcock <nenolod@dereferenced.org>
+# Maintainer: Dan Theisen <djt@hxx.in>
+pkgname=freeglut
+pkgver=3.0.0
+pkgrel=0
+pkgdesc="free reimplementation of OpenGL Utility Toolkit (GLUT) library"
+url="http://freeglut.sourceforge.net/"
+arch="all"
+options="!check" # No test suite.
+license="X11"
+depends_dev="mesa-dev libx11-dev libice-dev libxxf86vm-dev libxi-dev glu-dev"
+makedepends="$depends_dev cmake"
+subpackages="$pkgname-dev $pkgname-doc"
+source="http://downloads.sourceforge.net/$pkgname/$pkgname-$pkgver.tar.gz"
+
+build() {
+ cd "$builddir"
+ cmake . \
+ -DCMAKE_BUILD_TYPE=Release \
+ -DCMAKE_INSTALL_PREFIX=/usr \
+ -DCMAKE_INSTALL_LIBDIR=lib \
+ -DFREEGLUT_BUILD_STATIC_LIBS=0
+ make
+}
+
+package() {
+ cd "$builddir"
+ make DESTDIR="$pkgdir" install
+
+ install -m644 -D COPYING "$pkgdir"/usr/share/licenses/$pkgname/COPYING
+}
+
+sha512sums="9c45d5b203b26a7ff92331b3e080a48e806c92fbbe7c65d9262dd18c39cd6efdad8a795a80f499a2d23df84b4909dbd7c1bab20d7dd3555d3d88782ce9dd15b0 freeglut-3.0.0.tar.gz"
diff --git a/user/fuse/APKBUILD b/user/fuse/APKBUILD
new file mode 100644
index 000000000..92840ed41
--- /dev/null
+++ b/user/fuse/APKBUILD
@@ -0,0 +1,45 @@
+# Contributor: Natanael Copa <ncopa@alpinelinux.org>
+# Maintainer: Max Rees <maxcrees@me.com>
+pkgname=fuse
+pkgver=2.9.8
+pkgrel=2
+pkgdesc="Linux Filesystem in Userspace (legacy version)"
+url="https://github.com/libfuse/libfuse"
+arch="all"
+options="suid !check" # No test suite.
+license="GPL-2.0-only AND LGPL-2.1-only AND (GPL-2.0-only OR BSD-2-Clause)"
+depends="fuse-common"
+makedepends=""
+subpackages="$pkgname-dev $pkgname-doc"
+source="https://github.com/libfuse/libfuse/releases/download/$pkgname-$pkgver/$pkgname-$pkgver.tar.gz
+ fix-realpath.patch
+"
+
+# secfixes:
+# 2.9.8-r0:
+# - CVE-2018-10906
+
+build() {
+ cd "$builddir"
+ UDEV_RULES_PATH='/lib/udev/rules.d' ./configure \
+ --build=$CBUILD \
+ --host=$CHOST \
+ --prefix=/usr \
+ --sysconfdir=/etc \
+ --mandir=/usr/share/man \
+ --localstatedir=/var \
+ --disable-static \
+ --disable-example \
+ --enable-lib \
+ --enable-util
+ make
+}
+
+package() {
+ cd "$builddir"
+ make DESTDIR="$pkgdir" install
+ rm -r "$pkgdir"/dev "$pkgdir"/etc/init.d
+}
+
+sha512sums="0a9b14d96c6f98f5c903baf00114bfff72f9aeb97224702bbed370516b2b582401d5b436fcef979918ffd85d69ba4a82c8f722c0b35ebd50f7aa5f4ddfdcf8ad fuse-2.9.8.tar.gz
+5672ceb35acabb4bd97b6efc30614f22def62882fe198e2a8598a074d45b6b5337c082a5e09b5e399b6e5212dc1fbde9071c2a5051534c32091444c350b9c657 fix-realpath.patch"
diff --git a/user/fuse/fix-realpath.patch b/user/fuse/fix-realpath.patch
new file mode 100644
index 000000000..1199eb338
--- /dev/null
+++ b/user/fuse/fix-realpath.patch
@@ -0,0 +1,28 @@
+--- fuse-2.9.3.orig/util/fusermount.c 2015-02-07 08:58:54.000000000 -0200
++++ fuse-2.9.3/util/fusermount.c 2015-02-09 09:15:16.737367957 -0200
+@@ -1255,19 +1255,16 @@
+
+ origmnt = argv[optind];
+
+- drop_privs();
+ mnt = fuse_mnt_resolve_path(progname, origmnt);
+- if (mnt != NULL) {
+- res = chdir("/");
+- if (res == -1) {
+- fprintf(stderr, "%s: failed to chdir to '/'\n", progname);
+- exit(1);
+- }
+- }
+- restore_privs();
+ if (mnt == NULL)
+ exit(1);
+
++ res = chdir("/");
++ if (res == -1) {
++ fprintf(stderr, "%s: failed to chdir to '/'\n", progname);
++ exit(1);
++ }
++
+ umask(033);
+ if (unmount)
+ goto do_unmount;
diff --git a/user/i3wm/APKBUILD b/user/i3wm/APKBUILD
new file mode 100644
index 000000000..197cbd45f
--- /dev/null
+++ b/user/i3wm/APKBUILD
@@ -0,0 +1,49 @@
+# Contributor: Sören Tempel <soeren+alpine@soeren-tempel.net>
+# Contributor: Natanael Copa <ncopa@alpinelinux.org>
+# Maintainer: Dan Theisen <djt@hxx.in>
+pkgname=i3wm
+pkgver=4.15
+pkgrel=0
+pkgdesc="Improved dynamic tiling window manager"
+url="http://i3wm.org"
+arch="all"
+license="BSD-3-Clause"
+options="!check" # The test suite requires X
+makedepends="bison flex libxcb-dev xcb-util-cursor-dev xcb-util-keysyms-dev
+ xcb-util-wm-dev libev-dev pango-dev cairo-dev yajl-dev
+ startup-notification-dev pcre-dev libxkbcommon-dev xcb-util-xrm-dev"
+checkdepends="perl-x11-xcb perl-anyevent perl-json-xs perl-ipc-run
+ perl-inline-c perl-dev libxcb-dev xcb-util-dev xorg-server-xephyr"
+subpackages="$pkgname-doc"
+source="http://i3wm.org/downloads/i3-$pkgver.tar.bz2
+ i3wm-musl-glob-tilde.patch
+ i3wm-test-fix-off_t.patch
+ i3wm-test-disable-branch-check.patch"
+builddir="$srcdir/i3-$pkgver"
+
+build() {
+ cd "$builddir"
+ ./configure \
+ --prefix="/usr" \
+ --disable-builddir \
+ --sysconfdir="/etc"
+ make
+}
+
+check() {
+ cd "$builddir"
+ make check
+}
+
+package() {
+ cd "$builddir"
+ make DESTDIR="$pkgdir/" install
+
+ install -d "$pkgdir/usr/share/man/man1"
+ install -m644 man/*.1 "$pkgdir"/usr/share/man/man1/
+}
+
+sha512sums="60ab61b7e380342126bea12fb4371f98fcf18f6435f79a9519d3f59cfabdb170634366036e1aa20c5592da0832b03140ad1f0c72bad3cfaace0b7c57ad01dfc4 i3-4.15.tar.bz2
+8ce7d00371c43b93dabbe0dadf9caf7c58a68f4a0079f5a9b9552c15c55bfa0df16d7e87a281595af2ac5254632ba28ccf82a467cea16159b41490f6f2910299 i3wm-musl-glob-tilde.patch
+77224b994397b2e2487ae28dfd5781b3630654191813eb3c685f05ebf446e65c36e53a665ff3cc8323ea67e87f7cf977044025dade0a6ed22cbd84f0e6b4cbc7 i3wm-test-fix-off_t.patch
+a80384965dff62c51ce77e2baa3cf1b0b6db1df68994ce98383f96554bd296b4b59527fb5b1cb24b08c123699e294ba9b3baaa52afe88d87e7a76f0629194b1f i3wm-test-disable-branch-check.patch"
diff --git a/user/i3wm/i3wm-musl-glob-tilde.patch b/user/i3wm/i3wm-musl-glob-tilde.patch
new file mode 100644
index 000000000..82ad6195b
--- /dev/null
+++ b/user/i3wm/i3wm-musl-glob-tilde.patch
@@ -0,0 +1,73 @@
+diff -urp i3-4.11/i3bar/src/main.c i3-4.11.new/i3bar/src/main.c
+--- i3-4.11/i3bar/src/main.c 2015-09-30 07:55:10.000000000 +0100
++++ i3-4.11.new/i3bar/src/main.c 2016-02-08 20:03:41.777392482 +0000
+@@ -45,14 +45,20 @@ void debuglog(char *fmt, ...) {
+ *
+ */
+ char *expand_path(char *path) {
+- static glob_t globbuf;
+- if (glob(path, GLOB_NOCHECK | GLOB_TILDE, NULL, &globbuf) < 0) {
+- ELOG("glob() failed\n");
+- exit(EXIT_FAILURE);
++ char *home, *expanded;
++
++ if (strncmp(path, "~/", 2) == 0) {
++ home = getenv("HOME");
++ if (home != NULL) {
++ /* new length: sum - 1 (omit '~') + 1 (for '\0') */
++ expanded = scalloc(strlen(home)+strlen(path), 1);
++ strcpy(expanded, home);
++ strcat(expanded, path+1);
++ return expanded;
++ }
+ }
+- char *result = sstrdup(globbuf.gl_pathc > 0 ? globbuf.gl_pathv[0] : path);
+- globfree(&globbuf);
+- return result;
++
++ return sstrdup(path);
+ }
+
+ void print_usage(char *elf_name) {
+diff -urp i3-4.11/libi3/resolve_tilde.c i3-4.11.new/libi3/resolve_tilde.c
+--- i3-4.11/libi3/resolve_tilde.c 2015-09-30 07:55:10.000000000 +0100
++++ i3-4.11.new/libi3/resolve_tilde.c 2016-02-08 20:03:47.849230953 +0000
+@@ -19,27 +19,18 @@
+ *
+ */
+ char *resolve_tilde(const char *path) {
+- static glob_t globbuf;
+- char *head, *tail, *result;
++ char *home, *expanded;
+
+- tail = strchr(path, '/');
+- head = sstrndup(path, tail ? (size_t)(tail - path) : strlen(path));
+-
+- int res = glob(head, GLOB_TILDE, NULL, &globbuf);
+- free(head);
+- /* no match, or many wildcard matches are bad */
+- if (res == GLOB_NOMATCH || globbuf.gl_pathc != 1)
+- result = sstrdup(path);
+- else if (res != 0) {
+- err(EXIT_FAILURE, "glob() failed");
+- } else {
+- head = globbuf.gl_pathv[0];
+- result = scalloc(strlen(head) + (tail ? strlen(tail) : 0) + 1, 1);
+- strncpy(result, head, strlen(head));
+- if (tail)
+- strncat(result, tail, strlen(tail));
++ if (strncmp(path, "~/", 2) == 0) {
++ home = getenv("HOME");
++ if (home != NULL) {
++ /* new length: sum - 1 (omit '~') + 1 (for '\0') */
++ expanded = scalloc(strlen(home)+strlen(path), 1);
++ strcpy(expanded, home);
++ strcat(expanded, path+1);
++ return expanded;
++ }
+ }
+- globfree(&globbuf);
+
+- return result;
++ return sstrdup(path);
+ }
diff --git a/user/i3wm/i3wm-test-disable-branch-check.patch b/user/i3wm/i3wm-test-disable-branch-check.patch
new file mode 100644
index 000000000..ac3572e9b
--- /dev/null
+++ b/user/i3wm/i3wm-test-disable-branch-check.patch
@@ -0,0 +1,10 @@
+--- i3-4.15/testcases/t/193-ipc-version.t.old 2018-03-10 09:29:14.000000000 -0800
++++ i3-4.15/testcases/t/193-ipc-version.t 2018-09-27 16:49:56.599257224 -0700
+@@ -32,6 +32,6 @@
+
+ is(int($version->{minor}), $version->{minor}, 'minor version is an integer');
+ is(int($version->{patch}), $version->{patch}, 'patch version is an integer');
+-like($version->{human_readable}, qr/branch/, 'human readable version contains branch name');
++#like($version->{human_readable}, qr/branch/, 'human readable version contains branch name');
+
+ done_testing;
diff --git a/user/i3wm/i3wm-test-fix-off_t.patch b/user/i3wm/i3wm-test-fix-off_t.patch
new file mode 100644
index 000000000..1aeb69be6
--- /dev/null
+++ b/user/i3wm/i3wm-test-fix-off_t.patch
@@ -0,0 +1,26 @@
+--- i3-4.15/testcases/lib/i3test/XTEST.pm.old 2018-09-27 16:18:59.682101063 -0700
++++ i3-4.15/testcases/lib/i3test/XTEST.pm 2018-09-27 16:20:33.723493893 -0700
+@@ -39,6 +39,7 @@
+ my %sn_config;
+ BEGIN {
+ %sn_config = ExtUtils::PkgConfig->find('xcb-xkb xcb-xtest xcb-util');
++ $sn_config{cflags} .= ' -D_GNU_SOURCE';
+ }
+
+ use Inline C => Config => LIBS => $sn_config{libs}, CCFLAGS => $sn_config{cflags};
+--- i3-4.15/testcases/t/175-startup-notification.t.old 2018-09-27 16:24:17.546808884 -0700
++++ i3-4.15/testcases/t/175-startup-notification.t 2018-09-27 16:24:55.587372292 -0700
+@@ -31,11 +31,13 @@
+ my %sn_config;
+ BEGIN {
+ %sn_config = ExtUtils::PkgConfig->find('libstartup-notification-1.0');
++ $sn_config{cflags} .= ' -D_GNU_SOURCE';
+ }
+
+ use Inline C => Config => LIBS => $sn_config{libs}, CCFLAGS => $sn_config{cflags};
+ use Inline C => <<'END_OF_C_CODE';
+
++#include <sys/types.h>
+ #include <xcb/xcb.h>
+
+ #define SN_API_NOT_YET_FROZEN 1
diff --git a/user/imake/APKBUILD b/user/imake/APKBUILD
new file mode 100644
index 000000000..ba5585c32
--- /dev/null
+++ b/user/imake/APKBUILD
@@ -0,0 +1,27 @@
+# Contributor: Natanael Copa <ncopa@alpinelinux.org>
+# Maintainer: Dan Theisen <djt@hxx.in>
+pkgname=imake
+pkgver=1.0.7
+pkgrel=0
+pkgdesc="X Windows make utility"
+url="http://www.x.org"
+arch="all"
+license="X11"
+options="!check" # No testsuite
+depends=""
+makedepends="util-macros xorgproto-dev"
+subpackages="$pkgname-doc"
+source="http://ftp.x.org/pub/individual/util/$pkgname-$pkgver.tar.bz2"
+
+build() {
+ cd "$builddir"
+ ./configure --prefix=/usr
+ make
+}
+
+package() {
+ cd "$builddir"
+ make DESTDIR="$pkgdir" install
+}
+
+sha512sums="b3527c8fead25c6e093e1fe4a39e60ff210212dcd323e206505b9e872a3f36d9db85f85cab5a6f0fa914fa5c558ef54b499b2b13ccd66739223e4e72ef805d08 imake-1.0.7.tar.bz2"
diff --git a/user/iperf3/APKBUILD b/user/iperf3/APKBUILD
new file mode 100644
index 000000000..1e1fad965
--- /dev/null
+++ b/user/iperf3/APKBUILD
@@ -0,0 +1,57 @@
+# Contributor: Michael Mason <ms13sp@gmail.com>
+# Contributor: Natanael Copa <ncopa@alpinelinux.org>
+# Maintainer: Dan Theisen <djt@hxx.in>
+pkgname=iperf3
+_pkgname=iperf
+pkgver=3.6
+pkgrel=0
+pkgdesc="A tool to measure IP bandwidth using UDP or TCP"
+url="https://software.es.net/iperf/"
+arch="all"
+license="BSD-3-Clause"
+depends=""
+makedepends=""
+install=""
+subpackages="$pkgname-doc $pkgname-openrc"
+source="$pkgname-$pkgver.tar.gz::https://downloads.es.net/pub/$_pkgname/$_pkgname-$pkgver.tar.gz
+ $_pkgname.initd
+ $_pkgname.confd
+
+ build-fixes.patch
+ remove-pg-flags.patch
+ "
+builddir="$srcdir/$_pkgname-$pkgver"
+
+build() {
+ cd "$builddir"
+ CFLAGS="$CFLAGS -D_GNU_SOURCE"
+ ./configure \
+ --build=$CBUILD \
+ --host=$CHOST \
+ --prefix=/usr \
+ --sysconfdir=/etc \
+ --mandir=/usr/share/man \
+ --infodir=/usr/share/info
+ make
+}
+
+check() {
+ cd "$builddir"
+ make check
+}
+
+package() {
+ cd "$builddir"
+ make DESTDIR="$pkgdir" install
+
+ install -Dm755 "$srcdir"/$_pkgname.initd \
+ "$pkgdir"/etc/init.d/$_pkgname
+ install -Dm644 "$srcdir"/$_pkgname.confd \
+ "$pkgdir"/etc/conf.d/$_pkgname
+}
+
+sha512sums="322a6893ad28c6ce9c9849e8a0326408ed76f09bbb13591c01c3d051bd4777a2acdb8f5032b9d1bb37d47ad3818d8b18ab6c0be4d40559040eb7e57bbfc06f39 iperf3-3.6.tar.gz
+339fb04b41cce11e8ea8694d95c13af9c88e0d1143356d913ec810c9b11efa27212d585b5dcc49cc2eb860a6d8bc557092c8659d7d5cfe532c5afdb36f8eedf8 iperf.initd
+fb5e155fff568a72488cc1511d30358835a48bcce309f8f46d040160932b4a4ccb85040c27c60dee477900a25bd34c50eac21d1d0bea984b40faa401be2ba7e8 iperf.confd
+126043503eebf84bccf26758f18715eaf81131e2fc9ef1fe829e55acb2f14e97db18e9b890b8bf13c230ac80c7537615272af4e072808e25bde8ddd6f326f198 build-fixes.patch
+ed0fb3a3af0dae3e9f58ff6643cb15defdd31f65cf966a6013fdf2a7fd67a7f8ef522a7c8f3269bd43d5ca991a86d758526c384ebc0984b1403bb24f61a1779b remove-pg-flags.patch"
diff --git a/user/iperf3/build-fixes.patch b/user/iperf3/build-fixes.patch
new file mode 100644
index 000000000..b797e70ea
--- /dev/null
+++ b/user/iperf3/build-fixes.patch
@@ -0,0 +1,20 @@
+--- a/src/t_timer.c
++++ b/src/t_timer.c
+@@ -33,6 +33,7 @@
+ #include <stdlib.h>
+ #include <unistd.h>
+ #include <sys/time.h>
++#include <sys/types.h>
+
+ #include "timer.h"
+
+--- a/src/t_uuid.c
++++ b/src/t_uuid.c
+@@ -28,6 +28,7 @@
+ #include <stdlib.h>
+ #include <string.h>
+ #include <sys/time.h>
++#include <sys/types.h>
+
+ #include "iperf_util.h"
+
diff --git a/user/iperf3/iperf.confd b/user/iperf3/iperf.confd
new file mode 100644
index 000000000..1f425faa6
--- /dev/null
+++ b/user/iperf3/iperf.confd
@@ -0,0 +1,3 @@
+# Default option for iperf: --server (runs in TCP/5001 mode)
+# For further server options check --help flag
+command_args=""
diff --git a/user/iperf3/iperf.initd b/user/iperf3/iperf.initd
new file mode 100644
index 000000000..a135bafc9
--- /dev/null
+++ b/user/iperf3/iperf.initd
@@ -0,0 +1,18 @@
+#!/sbin/openrc-run
+
+command="/usr/bin/iperf"
+pidfile="/var/run/$SVCNAME/$SVCNAME.pid"
+
+depend() {
+ need net
+ after firewall
+}
+
+start() {
+ ebegin "Starting $SVCNAME"
+ start-stop-daemon --start --make-pid --user ${exec_user:-nobody} \
+ --pidfile ${pidfile} --background --exec $command \
+ -- --server ${command_args}
+ eend
+}
+
diff --git a/user/iperf3/remove-pg-flags.patch b/user/iperf3/remove-pg-flags.patch
new file mode 100644
index 000000000..1ed47eebf
--- /dev/null
+++ b/user/iperf3/remove-pg-flags.patch
@@ -0,0 +1,29 @@
+--- a/src/Makefile.am
++++ b/src/Makefile.am
+@@ -50,9 +50,9 @@
+ iperf3_profile_SOURCES = main.c \
+ $(libiperf_la_SOURCES)
+
+-iperf3_profile_CFLAGS = -pg -g
++iperf3_profile_CFLAGS = -g
+ iperf3_profile_LDADD = libiperf.la
+-iperf3_profile_LDFLAGS = -pg -g
++iperf3_profile_LDFLAGS = -g
+
+ # Specify the sources and various flags for the test cases
+ t_timer_SOURCES = t_timer.c
+
+--- a/src/Makefile.in
++++ b/src/Makefile.in
+@@ -643,9 +643,9 @@
+ iperf3_profile_SOURCES = main.c \
+ $(libiperf_la_SOURCES)
+
+-iperf3_profile_CFLAGS = -pg -g
++iperf3_profile_CFLAGS = -g
+ iperf3_profile_LDADD = libiperf.la
+-iperf3_profile_LDFLAGS = -pg -g
++iperf3_profile_LDFLAGS = -g
+
+ # Specify the sources and various flags for the test cases
+ t_timer_SOURCES = t_timer.c
diff --git a/user/ipmiutil/APKBUILD b/user/ipmiutil/APKBUILD
new file mode 100644
index 000000000..8accd70c0
--- /dev/null
+++ b/user/ipmiutil/APKBUILD
@@ -0,0 +1,37 @@
+# Maintainer: A. Wilcox <awilfox@adelielinux.org>
+pkgname=ipmiutil
+pkgver=3.1.3
+pkgrel=0
+pkgdesc="IPMI Management Utilities"
+url="http://ipmiutil.sourceforge.net/"
+arch="all"
+options="!check" # No test suite shipped.
+license="BSD-2-Clause AND BSD-3-Clause AND GPL-2.0+"
+depends_dev="openssl-dev"
+makedepends="$depends_dev linux-headers"
+subpackages="$pkgname-dev $pkgname-doc $pkgname-openrc"
+source="https://downloads.sourceforge.net/project/ipmiutil/ipmiutil-$pkgver.tar.gz
+ ipmiutil-3.0.7-fix-sha256.patch"
+
+build() {
+ cd "$builddir"
+ ./configure \
+ --prefix=/usr \
+ --sysconfdir=/etc \
+ --libdir=/usr/lib \
+ --mandir=/usr/share/man \
+ --infodir=/usr/share/info \
+ --localstatedir=/var \
+ --disable-systemd \
+ --enable-sha256 \
+ --enable-gpl
+ make
+}
+
+package() {
+ cd "$builddir"
+ make DESTDIR="$pkgdir" install
+}
+
+sha512sums="bd1f95b59583a07a5b6001b40e59269f25eb63b69e33f7fad6dd40136e1ea7611e647eb5ed2e2a9746944bde2dc2a3aa2def44238947693d75d9ca48697e1b99 ipmiutil-3.1.3.tar.gz
+74e8951bccd004f765b99de87dc5f04834e594b3e14ba885148fb971eaf15164ccac2de880e409f201a38cba5c0948a0fabc04e1e34fb396f50b1ecddb6b305b ipmiutil-3.0.7-fix-sha256.patch"
diff --git a/user/ipmiutil/ipmiutil-3.0.7-fix-sha256.patch b/user/ipmiutil/ipmiutil-3.0.7-fix-sha256.patch
new file mode 100644
index 000000000..1cc1b5532
--- /dev/null
+++ b/user/ipmiutil/ipmiutil-3.0.7-fix-sha256.patch
@@ -0,0 +1,68 @@
+--- ipmiutil-3.0.7/lib/Makefile.am.old 2017-09-20 10:08:20.000000000 -0500
++++ ipmiutil-3.0.7/lib/Makefile.am 2018-01-01 18:03:45.080832425 -0600
+@@ -33,10 +33,11 @@
+ else cp -f libipmiapi64.a.redhat libipmiapi.a; fi \
+ else cp -f libipmiapi32.a libipmiapi.a; fi \
+ fi
+- if [ "$(PLUSFLAGS)" = "-DHAVE_LANPLUS" ]; then \
+- cd lanplus; make clean; make ; \
+- pwd; cp -f libipmi_lanplus.a .. ; \
+- fi
++ case "$(PLUSFLAGS)" in \
++ "-DHAVE_LANPLUS"*) \
++ cd lanplus; make clean; make ; \
++ pwd; cp -f libipmi_lanplus.a .. ;; \
++ esac
+
+ clean:
+ rm -f libipmiapi.a lib*_lanplus.a lib*_lanplus.so
+@@ -51,10 +52,11 @@
+ cd lanplus; make distclean
+
+ install:
+- if [ "$(PLUSFLAGS)" = "-DHAVE_LANPLUS" ]; then \
+- $(MKDIR) ${datato} ; \
+- cd lanplus; make install ; \
+- fi
++ case "$(PLUSFLAGS)" in \
++ "-DHAVE_LANPLUS"*) \
++ $(MKDIR) ${datato} ; \
++ cd lanplus; make install ;; \
++ esac
+
+ check:
+
+--- ipmiutil-3.0.7/lib/Makefile.in.old 2017-09-20 10:08:28.000000000 -0500
++++ ipmiutil-3.0.7/lib/Makefile.in 2018-01-01 18:02:55.187678005 -0600
+@@ -392,10 +392,11 @@
+ else cp -f libipmiapi64.a.redhat libipmiapi.a; fi \
+ else cp -f libipmiapi32.a libipmiapi.a; fi \
+ fi
+- if [ "$(PLUSFLAGS)" = "-DHAVE_LANPLUS" ]; then \
+- cd lanplus; make clean; make ; \
+- pwd; cp -f libipmi_lanplus.a .. ; \
+- fi
++ case "$(PLUSFLAGS)" in \
++ "-DHAVE_LANPLUS"*) \
++ cd lanplus; make clean; make ; \
++ pwd; cp -f libipmi_lanplus.a .. ;; \
++ esac
+
+ clean:
+ rm -f libipmiapi.a lib*_lanplus.a lib*_lanplus.so
+@@ -410,10 +411,11 @@
+ cd lanplus; make distclean
+
+ install:
+- if [ "$(PLUSFLAGS)" = "-DHAVE_LANPLUS" ]; then \
+- $(MKDIR) ${datato} ; \
+- cd lanplus; make install ; \
+- fi
++ case "$(PLUSFLAGS)" in \
++ "-DHAVE_LANPLUS"*) \
++ $(MKDIR) ${datato} ; \
++ cd lanplus; make install ;; \
++ esac
+
+ check:
+
diff --git a/user/libxdg-basedir/APKBUILD b/user/libxdg-basedir/APKBUILD
new file mode 100644
index 000000000..50a1e7dfc
--- /dev/null
+++ b/user/libxdg-basedir/APKBUILD
@@ -0,0 +1,43 @@
+# Contributor: William Pitcock <nenolod@dereferenced.org>
+# Contributor: Natanael Copa <ncopa@alpinelinux.org>
+# Maintainer: Dan Theisen <djt@hxx.in>
+# TODO: Repackage from better source, rehost or something.
+pkgname=libxdg-basedir
+pkgver=1.2.0
+pkgrel=0
+pkgdesc="library for XDG base dir specification"
+url="https://nevill.ch/libxdg-basedir/"
+arch="all"
+license="MIT"
+depends=""
+makedepends=""
+subpackages="$pkgname-dev"
+source="https://nevill.ch/libxdg-basedir/downloads/$pkgname-$pkgver.tar.gz"
+
+prepare() {
+ cd "$builddir"
+ default_prepare
+ update_config_sub
+}
+
+build() {
+ cd "$builddir"
+ ./configure \
+ --build=$CBUILD \
+ --host=$CHOST \
+ --prefix=/usr \
+ --sysconfdir=/etc \
+ make
+}
+
+check() {
+ cd "$builddir"
+ make check
+}
+
+package() {
+ cd "$builddir"
+ make DESTDIR="$pkgdir" install
+}
+
+sha512sums="346553ddd9d0a0c854af9320f2ced695a0838adc18736b66120bea48ea60cb9ea3a7390672a42f83909db92f692e94de833d9e8bcfe51568a72ad1f4661fde06 libxdg-basedir-1.2.0.tar.gz"
diff --git a/user/llvm6/APKBUILD b/user/llvm6/APKBUILD
index d29026f24..f3bc9acc7 100644
--- a/user/llvm6/APKBUILD
+++ b/user/llvm6/APKBUILD
@@ -23,6 +23,7 @@ source="http://llvm.org/releases/$pkgver/llvm-$pkgver.src.tar.xz
disable-FileSystemTest.CreateDir-perms-assert.patch
disable-dlclose-test.patch
musl-ppc64-elfv2.patch
+ secure-plt.patch
"
builddir="$srcdir/$_pkgname-$pkgver.src"
@@ -244,4 +245,5 @@ f84cd65d7042e89826ba6e8d48c4c302bf4980da369d7f19a55f217e51c00ca8ed178d453df3a3ce
6d1a716e5aa24e6b9a3acf4cc11e2504b1b01abf574074e9e5617b991de87d5e4e687eb18e85e73d5e632568afe2fc357771c4c96f9e136502071991496fb78c cmake-fix-libLLVM-name.patch
49c47f125014b60d0ea7870f981a2c1708ad705793f89287ed846ee881a837a4dc0170bf467e03f2ef56177473128945287749ac80dc2d13cfabcf8b929ba58a disable-FileSystemTest.CreateDir-perms-assert.patch
caeec8e4dbd92f5f74940780b69075f3879a267a8623822cbdc193fd14706eb089071e3a5a20d60cc2eca59e4c5b2a61d29827a2f3362ee7c5f74f11d9ace200 disable-dlclose-test.patch
-bde743960003a2a39868af9f665d86fadb0a7b1e7eb51c16ebbd74ce4c5220bbc400b1d5211c02fc2643863f49ee961e9a18dffa0eb813a0e1723613396512ab musl-ppc64-elfv2.patch"
+bde743960003a2a39868af9f665d86fadb0a7b1e7eb51c16ebbd74ce4c5220bbc400b1d5211c02fc2643863f49ee961e9a18dffa0eb813a0e1723613396512ab musl-ppc64-elfv2.patch
+35d289641fa4d200b5a3f62f1d51da600a734641356b0dc6c54a3080dd89aec3b031e36af8b53be49c35346c1cbcce00268de7ec9b4f552bfd7bf84d3504d1c4 secure-plt.patch"
diff --git a/user/llvm6/secure-plt.patch b/user/llvm6/secure-plt.patch
new file mode 100644
index 000000000..e8af33d87
--- /dev/null
+++ b/user/llvm6/secure-plt.patch
@@ -0,0 +1,208 @@
+Index: llvm/lib/Target/PowerPC/PPC.td
+===================================================================
+--- llvm/lib/Target/PowerPC/PPC.td
++++ llvm/lib/Target/PowerPC/PPC.td
+@@ -119,6 +119,8 @@
+ [FeatureBookE]>;
+ def FeatureE500 : SubtargetFeature<"e500", "IsE500", "true",
+ "Enable E500/E500mc instructions">;
++def FeatureSecurePlt : SubtargetFeature<"secure-plt","SecurePlt", "true",
++ "Enable secure plt mode">;
+ def FeaturePPC4xx : SubtargetFeature<"ppc4xx", "IsPPC4xx", "true",
+ "Enable PPC 4xx instructions">;
+ def FeaturePPC6xx : SubtargetFeature<"ppc6xx", "IsPPC6xx", "true",
+Index: llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
+===================================================================
+--- llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
++++ llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
+@@ -563,33 +563,63 @@
+ // Transform %rd = UpdateGBR(%rt, %ri)
+ // Into: lwz %rt, .L0$poff - .L0$pb(%ri)
+ // add %rd, %rt, %ri
++ // or into (if secure plt mode is on):
++ // addis r30, r30, .LTOC - .L0$pb@ha
++ // addi r30, r30, .LTOC - .L0$pb@l
+ // Get the offset from the GOT Base Register to the GOT
+ LowerPPCMachineInstrToMCInst(MI, TmpInst, *this, isDarwin);
+- MCSymbol *PICOffset =
+- MF->getInfo<PPCFunctionInfo>()->getPICOffsetSymbol();
+- TmpInst.setOpcode(PPC::LWZ);
+- const MCExpr *Exp =
+- MCSymbolRefExpr::create(PICOffset, MCSymbolRefExpr::VK_None, OutContext);
+- const MCExpr *PB =
+- MCSymbolRefExpr::create(MF->getPICBaseSymbol(),
+- MCSymbolRefExpr::VK_None,
+- OutContext);
+- const MCOperand TR = TmpInst.getOperand(1);
+- const MCOperand PICR = TmpInst.getOperand(0);
++ if (Subtarget->isSecurePlt() && isPositionIndependent() ) {
++ unsigned PICR = TmpInst.getOperand(0).getReg();
++ MCSymbol *LTOCSymbol = OutContext.getOrCreateSymbol(StringRef(".LTOC"));
++ const MCExpr *PB =
++ MCSymbolRefExpr::create(MF->getPICBaseSymbol(),
++ OutContext);
+
+- // Step 1: lwz %rt, .L$poff - .L$pb(%ri)
+- TmpInst.getOperand(1) =
+- MCOperand::createExpr(MCBinaryExpr::createSub(Exp, PB, OutContext));
+- TmpInst.getOperand(0) = TR;
+- TmpInst.getOperand(2) = PICR;
+- EmitToStreamer(*OutStreamer, TmpInst);
++ const MCExpr *LTOCDeltaExpr =
++ MCBinaryExpr::createSub(MCSymbolRefExpr::create(LTOCSymbol, OutContext),
++ PB, OutContext);
+
+- TmpInst.setOpcode(PPC::ADD4);
+- TmpInst.getOperand(0) = PICR;
+- TmpInst.getOperand(1) = TR;
+- TmpInst.getOperand(2) = PICR;
+- EmitToStreamer(*OutStreamer, TmpInst);
+- return;
++ const MCExpr *LTOCDeltaHi =
++ PPCMCExpr::createHa(LTOCDeltaExpr, false, OutContext);
++ EmitToStreamer(*OutStreamer, MCInstBuilder(PPC::ADDIS)
++ .addReg(PICR)
++ .addReg(PICR)
++ .addExpr(LTOCDeltaHi));
++
++ const MCExpr *LTOCDeltaLo =
++ PPCMCExpr::createLo(LTOCDeltaExpr, false, OutContext);
++ EmitToStreamer(*OutStreamer, MCInstBuilder(PPC::ADDI)
++ .addReg(PICR)
++ .addReg(PICR)
++ .addExpr(LTOCDeltaLo));
++ return;
++ } else {
++ MCSymbol *PICOffset =
++ MF->getInfo<PPCFunctionInfo>()->getPICOffsetSymbol();
++ TmpInst.setOpcode(PPC::LWZ);
++ const MCExpr *Exp =
++ MCSymbolRefExpr::create(PICOffset, MCSymbolRefExpr::VK_None, OutContext);
++ const MCExpr *PB =
++ MCSymbolRefExpr::create(MF->getPICBaseSymbol(),
++ MCSymbolRefExpr::VK_None,
++ OutContext);
++ const MCOperand TR = TmpInst.getOperand(1);
++ const MCOperand PICR = TmpInst.getOperand(0);
++
++ // Step 1: lwz %rt, .L$poff - .L$pb(%ri)
++ TmpInst.getOperand(1) =
++ MCOperand::createExpr(MCBinaryExpr::createSub(Exp, PB, OutContext));
++ TmpInst.getOperand(0) = TR;
++ TmpInst.getOperand(2) = PICR;
++ EmitToStreamer(*OutStreamer, TmpInst);
++
++ TmpInst.setOpcode(PPC::ADD4);
++ TmpInst.getOperand(0) = PICR;
++ TmpInst.getOperand(1) = TR;
++ TmpInst.getOperand(2) = PICR;
++ EmitToStreamer(*OutStreamer, TmpInst);
++ return;
++ }
+ }
+ case PPC::LWZtoc: {
+ // Transform %r3 = LWZtoc @min1, %r2
+@@ -1233,7 +1263,7 @@
+
+ if (!Subtarget->isPPC64()) {
+ const PPCFunctionInfo *PPCFI = MF->getInfo<PPCFunctionInfo>();
+- if (PPCFI->usesPICBase()) {
++ if (PPCFI->usesPICBase() && !Subtarget->isSecurePlt()) {
+ MCSymbol *RelocSymbol = PPCFI->getPICOffsetSymbol();
+ MCSymbol *PICBase = MF->getPICBaseSymbol();
+ OutStreamer->EmitLabel(RelocSymbol);
+Index: llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp
+===================================================================
+--- llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp
++++ llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp
+@@ -4001,6 +4001,27 @@
+ return;
+ break;
+
++ case PPCISD::CALL: {
++ const Module *M = MF->getFunction().getParent();
++
++ if (PPCLowering->getPointerTy(CurDAG->getDataLayout()) != MVT::i32 ||
++ !PPCSubTarget->isSecurePlt() || !PPCSubTarget->isTargetELF() ||
++ M->getPICLevel() == PICLevel::SmallPIC)
++ break;
++
++ SDValue Op = N->getOperand(1);
++
++ if (GlobalAddressSDNode *GA = dyn_cast<GlobalAddressSDNode>(Op)) {
++ if (GA->getTargetFlags() == PPCII::MO_PLT)
++ getGlobalBaseReg();
++ }
++ else if (ExternalSymbolSDNode *ES = dyn_cast<ExternalSymbolSDNode>(Op)) {
++ if (ES->getTargetFlags() == PPCII::MO_PLT)
++ getGlobalBaseReg();
++ }
++ }
++ break;
++
+ case PPCISD::GlobalBaseReg:
+ ReplaceNode(N, getGlobalBaseReg());
+ return;
+Index: llvm/lib/Target/PowerPC/PPCMCInstLower.cpp
+===================================================================
+--- llvm/lib/Target/PowerPC/PPCMCInstLower.cpp
++++ llvm/lib/Target/PowerPC/PPCMCInstLower.cpp
+@@ -107,10 +107,20 @@
+ break;
+ }
+
+- if (MO.getTargetFlags() == PPCII::MO_PLT)
++ if (MO.getTargetFlags() == PPCII::MO_PLT)
+ RefKind = MCSymbolRefExpr::VK_PLT;
+
++ const MachineFunction *MF = MO.getParent()->getParent()->getParent();
++ const PPCSubtarget *Subtarget = &(MF->getSubtarget<PPCSubtarget>());
++ const TargetMachine &TM = Printer.TM;
+ const MCExpr *Expr = MCSymbolRefExpr::create(Symbol, RefKind, Ctx);
++ // -msecure-plt option works only in PIC mode. If secure plt mode
++ // is on add 32768 to symbol.
++ if (Subtarget->isSecurePlt() && TM.isPositionIndependent() &&
++ MO.getTargetFlags() == PPCII::MO_PLT)
++ Expr = MCBinaryExpr::createAdd(Expr,
++ MCConstantExpr::create(32768, Ctx),
++ Ctx);
+
+ if (!MO.isJTI() && MO.getOffset())
+ Expr = MCBinaryExpr::createAdd(Expr,
+Index: llvm/lib/Target/PowerPC/PPCSubtarget.h
+===================================================================
+--- llvm/lib/Target/PowerPC/PPCSubtarget.h
++++ llvm/lib/Target/PowerPC/PPCSubtarget.h
+@@ -133,6 +133,7 @@
+ bool HasFloat128;
+ bool IsISA3_0;
+ bool UseLongCalls;
++ bool SecurePlt;
+
+ POPCNTDKind HasPOPCNTD;
+
+@@ -255,6 +256,7 @@
+ bool hasOnlyMSYNC() const { return HasOnlyMSYNC; }
+ bool isPPC4xx() const { return IsPPC4xx; }
+ bool isPPC6xx() const { return IsPPC6xx; }
++ bool isSecurePlt() const {return SecurePlt; }
+ bool isE500() const { return IsE500; }
+ bool isFeatureMFTB() const { return FeatureMFTB; }
+ bool isDeprecatedDST() const { return DeprecatedDST; }
+Index: llvm/test/CodeGen/PowerPC/ppc32-pic-large.ll
+===================================================================
+--- llvm/test/CodeGen/PowerPC/ppc32-pic-large.ll
++++ llvm/test/CodeGen/PowerPC/ppc32-pic-large.ll
+@@ -1,4 +1,5 @@
+ ; RUN: llc < %s -mtriple=powerpc-unknown-linux-gnu -relocation-model=pic | FileCheck -check-prefix=LARGE-BSS %s
++; RUN: llc < %s -mtriple=powerpc-unknown-linux-gnu -mattr=+secure-plt -relocation-model=pic | FileCheck -check-prefix=LARGE-SECUREPLT %s
+ @bar = common global i32 0, align 4
+
+ declare i32 @call_foo(i32, ...)
+@@ -29,3 +30,6 @@
+ ; LARGE-BSS: [[VREF]]:
+ ; LARGE-BSS-NEXT: .p2align 2
+ ; LARGE-BSS-NEXT: .long bar
++; LARGE-SECUREPLT: addis 30, 30, .LTOC-.L0$pb@ha
++; LARGE-SECUREPLT: addi 30, 30, .LTOC-.L0$pb@l
++; LARGE-SECUREPLT: bl call_foo@PLT+32768
diff --git a/user/lua-lgi/APKBUILD b/user/lua-lgi/APKBUILD
new file mode 100644
index 000000000..ef7e42726
--- /dev/null
+++ b/user/lua-lgi/APKBUILD
@@ -0,0 +1,35 @@
+# Contributor: Natanael Copa <ncopa@alpinelinux.org>
+# Maintainer: Dan Theisen <djt@hxx.in>
+pkgname=lua-lgi
+pkgver=0.9.2
+pkgrel=0
+pkgdesc="Dynamic Lua binding to GObject libraries using GObject-Introspection"
+url="https://github.com/pavouk/lgi"
+arch="all"
+license="MIT"
+options="!check" # checks require dbus
+depends=""
+makedepends="glib-dev gobject-introspection-dev libffi-dev lua5.3-dev"
+subpackages="$pkgname-doc"
+source="lgi-$pkgver.tar.gz::https://github.com/pavouk/lgi/archive/$pkgver.tar.gz"
+builddir="$srcdir"/lgi-$pkgver
+
+build() {
+ cd "$builddir"
+ make PREFIX=/usr LUA_CFLAGS="$(pkg-config --cflags lua)"
+}
+
+check() {
+ cd "$builddir"
+ make check
+}
+
+package() {
+ cd "$builddir"
+ make install PREFIX=/usr DESTDIR="$pkgdir"
+
+ mkdir -p "$pkgdir"/usr/share/doc/lua-lgi
+ cp -r docs/* samples "$pkgdir"/usr/share/doc/lua-lgi/
+}
+
+sha512sums="755a96b78530f42da6d4e2664f8e37cb07a356419e7e6448003c3f841c9d98ad18b851715d9eb203ea7eb27b13ec46223fa8a1c90a99fd12960ce85b0a695335 lgi-0.9.2.tar.gz"
diff --git a/user/mesa-demos/APKBUILD b/user/mesa-demos/APKBUILD
new file mode 100644
index 000000000..9d2b4627d
--- /dev/null
+++ b/user/mesa-demos/APKBUILD
@@ -0,0 +1,30 @@
+# Contributor: Carlo Landmeter <clandmeter@gmail.com>
+# Contributor: Natanael Copa <ncopa@alpinelinux.org>
+# Maintainer: Dan Theisen <djt@hxx.in>
+pkgname=mesa-demos
+pkgver=8.3.0
+pkgrel=0
+pkgdesc="Mesa demos and utils"
+url="http://mesa3d.org"
+arch="all"
+license="X11"
+options="!check" # No testsuite
+makedepends="mesa-dev glew-dev glu-dev freeglut-dev freetype-dev libtool"
+source="ftp://ftp.freedesktop.org/pub/mesa/demos/$pkgver/$pkgname-$pkgver.tar.bz2"
+
+build() {
+ cd "$builddir"
+ export LDFLAGS="$LDFLAGS -Wl,-z,lazy"
+ ./configure \
+ --build=$CBUILD \
+ --host=$CHOST \
+ --prefix=/usr
+ make V=1
+}
+
+package() {
+ cd "$builddir"
+ make -j1 DESTDIR="$pkgdir" install
+}
+
+sha512sums="9ba96980306953f7b72745063e75809fb8399bbd5fc58fca96290a8b4e61741bb82fb6171311eddf249ea12face83d7c7b087e6dade6833699a8d220fc752e3f mesa-demos-8.3.0.tar.bz2"
diff --git a/user/minicom/APKBUILD b/user/minicom/APKBUILD
new file mode 100644
index 000000000..d597290e8
--- /dev/null
+++ b/user/minicom/APKBUILD
@@ -0,0 +1,39 @@
+# Contributor: Michael Mason <ms13sp@gmail.com>
+# Maintainer: Dan Theisen <djt@hxx.in>
+pkgname=minicom
+pkgver=2.7.1
+pkgrel=0
+pkgdesc="menu driven communications program for terminals"
+url="https://fossies.org/linux/minicom/"
+arch="all"
+license="GPL-2.0+"
+depends=""
+makedepends="ncurses-dev gettext-tiny-dev linux-headers"
+subpackages="$pkgname-doc $pkgname-lang"
+source="https://fossies.org/linux/misc/$pkgname-$pkgver.tar.gz
+ fix-includes.patch"
+
+build() {
+ cd "$builddir"
+ ./configure \
+ --build=$CBUILD \
+ --host=$CHOST \
+ --prefix=/usr \
+ --sysconfdir=/etc \
+ --mandir=/usr/share/man \
+ --infodir=/usr/share/info
+ make
+}
+
+check() {
+ cd "$builddir"
+ make check
+}
+
+package() {
+ cd "$builddir"
+ make DESTDIR="$pkgdir" install
+}
+
+sha512sums="b429b32d187c3ee915c5074a0d0f08b7e3951cb8528ecbdd889837ff301662c16740ad77bd2bf3baf759c0a84e779a8dc8fd888a4260a0ace15ebc4c2f697c82 minicom-2.7.1.tar.gz
+5acff3efb0b8b02333291722044d7c473bf19eec8a26e66c0e0f41895f3e3f071dff13515ec20f7ce17368732e3674f0a42b38602e61b04e9cd70e61012641ff fix-includes.patch"
diff --git a/user/minicom/fix-includes.patch b/user/minicom/fix-includes.patch
new file mode 100644
index 000000000..19a18dcdb
--- /dev/null
+++ b/user/minicom/fix-includes.patch
@@ -0,0 +1,24 @@
+--- minicom-2.6.2.orig/src/dial.c
++++ minicom-2.6.2/src/dial.c
+@@ -39,11 +39,9 @@
+ #include "intl.h"
+
+ #ifdef VC_MUSIC
+-# if defined(__GLIBC__)
+ # include <sys/ioctl.h>
+ # include <sys/kd.h>
+ # include <sys/time.h>
+-# endif
+ #endif
+
+ enum { CURRENT_VERSION = 6 };
+--- minicom-2.6.2.orig/src/getsdir.h
++++ minicom-2.6.2/src/getsdir.h
+@@ -22,6 +22,7 @@
+ * and licensing conditions. See the source, Luke.
+ */
+
++#include <sys/param.h>
+ #include <dirent.h>
+
+ typedef struct dirEntry { /* structure of data item */
diff --git a/user/ncftp/APKBUILD b/user/ncftp/APKBUILD
new file mode 100644
index 000000000..1a9b5fce4
--- /dev/null
+++ b/user/ncftp/APKBUILD
@@ -0,0 +1,46 @@
+# Contributor: Carlo Landmeter <clandmeter@gmail.com>
+# Maintainer: Dan Theisen <djt@hxx.in>
+pkgname=ncftp
+pkgver=3.2.6
+pkgrel=0
+pkgdesc="A set of free application programs implementing FTP"
+url="http://www.ncftp.com/"
+arch="all"
+options="!check" # No test suite.
+license="ClArtistic"
+makedepends="ncurses-dev"
+source="ftp://ftp.ncftp.com/ncftp/$pkgname-$pkgver-src.tar.gz"
+subpackages="$pkgname-doc $pkgname-bookmarks"
+
+build () {
+ cd "$builddir"
+
+ LIBS="-ltinfo" ./configure \
+ --build=$CBUILD \
+ --host=$CHOST \
+ --prefix=/usr \
+ --sysconfdir=/etc \
+ --mandir=/usr/share/man
+
+ cd "$builddir"/libncftp
+ make shared
+ cd "$builddir"
+ make
+}
+
+package() {
+ cd "$builddir"/libncftp
+ make PREFIX="${pkgdir}"/usr soinstall
+ cd "$builddir"
+ make DESTDIR="$pkgdir" install
+ install -D doc/LICENSE.txt \
+ "$pkgdir"/usr/share/licenses/"$pkgname"/LICENSE
+}
+
+bookmarks () {
+ mkdir -p "$subpkgdir"/usr/bin
+ mv "$pkgdir"/usr/bin/ncftpbookmarks \
+ "$subpkgdir"/usr/bin/
+}
+
+sha512sums="a2f8ac555bee8af4be1aa745ce5838beee99cd2253c1fe701b710ec135d7c47e2bf8b22ec928975ec2460919977d45a07fb12185ab58a2e96e3092039ffd3303 ncftp-3.2.6-src.tar.gz"
diff --git a/user/ntfs-3g/APKBUILD b/user/ntfs-3g/APKBUILD
new file mode 100644
index 000000000..d403c4f42
--- /dev/null
+++ b/user/ntfs-3g/APKBUILD
@@ -0,0 +1,40 @@
+# Contributor: Valery Kartel <valery.kartel@gmail.com>
+# Contributor: Carlo Landmeter <clandmeter@gmail.com>
+# Contributor: Natanael Copa <ncopa@alpinelinux.org>
+# Maintainer: Max Rees <maxcrees@me.com>
+pkgname=ntfs-3g
+_pkgname=ntfs-3g_ntfsprogs
+pkgver=2017.3.23
+pkgrel=1
+pkgdesc="Stable, full-featured, read-write NTFS"
+url="https://www.tuxera.com/community/open-source-ntfs-3g/"
+arch="all"
+options="!check" # No test suite.
+license="LGPL-2.1-only AND BSD-2-Clause AND GPL-2.0+ AND GPL-3.0+"
+makedepends="attr-dev util-linux-dev linux-headers fuse-dev"
+subpackages="$pkgname-doc $pkgname-dev $pkgname-libs"
+source="https://tuxera.com/opensource/$_pkgname-$pkgver.tgz"
+builddir="$srcdir/$_pkgname-$pkgver"
+
+build() {
+ cd "$builddir"
+ ./configure \
+ --build=$CBUILD \
+ --host=$CHOST \
+ --prefix=/usr \
+ --sysconfdir=/etc \
+ --mandir=/usr/share/man \
+ --infodir=/usr/share/info \
+ --localstatedir=/var \
+ --with-fuse=external
+ make
+}
+
+package() {
+ cd "$builddir"
+ mkdir -p "$pkgdir"/lib
+ make -j1 DESTDIR="$pkgdir" LDCONFIG=: install
+ ln -s /bin/ntfs-3g "$pkgdir"/sbin/mount.ntfs
+}
+
+sha512sums="3a607f0d7be35204c992d8931de0404fbc52032c13b4240d2c5e6f285c318a28eb2a385d7cf5ac4cd445876aee5baa5753bb636ada0d870d84a9d3fdbce794ef ntfs-3g_ntfsprogs-2017.3.23.tgz"
diff --git a/user/perl-inline-c/APKBUILD b/user/perl-inline-c/APKBUILD
new file mode 100644
index 000000000..50d298bb0
--- /dev/null
+++ b/user/perl-inline-c/APKBUILD
@@ -0,0 +1,35 @@
+# Contributor: Dan Theisen <djt@hxx.in>
+# Maintainer: Adélie Perl Team <adelie-perl@lists.adelielinux.org>
+pkgname=perl-inline-c
+pkgver=0.78
+pkgrel=0
+pkgdesc="C Language Support for Inline"
+url="https://metacpan.org/pod/Inline::C"
+arch="noarch"
+license="GPL-1.0+ OR Artistic-1.0-Perl"
+depends="perl perl-inline perl-pegex perl-parse-recdescent"
+makedepends="perl-dev perl-file-sharedir-install"
+checkdepends="perl-test-warn perl-yaml-libyaml perl-file-copy-recursive"
+install=""
+subpackages="$pkgname-doc"
+source="https://cpan.metacpan.org/authors/id/T/TI/TINITA/Inline-C-$pkgver.tar.gz"
+builddir="$srcdir/Inline-C-$pkgver"
+
+build() {
+ cd "$builddir"
+ PERL_MM_USE_DEFAULT=1 perl Makefile.PL INSTALLDIRS=vendor
+ make
+}
+
+check() {
+ cd "$builddir"
+ make test
+}
+
+package() {
+ cd "$builddir"
+ make DESTDIR="$pkgdir" install
+ find "$pkgdir" \( -name perllocal.pod -o -name .packlist \) -delete
+}
+
+sha512sums="368e68dfb9f1700534d9b391090e340172e3adde5fe15576f883e9341047fec35cea8660751883b27e128ad91dda363d513547368097a989457d669bbbdc8ce4 Inline-C-0.78.tar.gz"
diff --git a/user/perl-ipc-run/APKBUILD b/user/perl-ipc-run/APKBUILD
new file mode 100644
index 000000000..c78ee10fb
--- /dev/null
+++ b/user/perl-ipc-run/APKBUILD
@@ -0,0 +1,34 @@
+# Contributor: Dan Theisen <djt@hxx.in>
+# Maintainer: Adélie Perl Team <adelie-perl@lists.adelielinux.org>
+pkgname=perl-ipc-run
+pkgver=20180523.0
+pkgrel=0
+pkgdesc="system() and background procs w/ piping, redirs, ptys"
+url="https://metacpan.org/pod/IPC::Run"
+arch="noarch"
+license="GPL-1.0+ OR Artistic-1.0-Perl"
+depends="perl"
+makedepends="perl-dev"
+install=""
+subpackages="$pkgname-doc"
+source="https://cpan.metacpan.org/authors/id/T/TO/TODDR/IPC-Run-$pkgver.tar.gz"
+builddir="$srcdir/IPC-Run-$pkgver"
+
+build() {
+ cd "$builddir"
+ PERL_MM_USE_DEFAULT=1 perl Makefile.PL INSTALLDIRS=vendor
+ make
+}
+
+check() {
+ cd "$builddir"
+ make test
+}
+
+package() {
+ cd "$builddir"
+ make DESTDIR="$pkgdir" install
+ find "$pkgdir" \( -name perllocal.pod -o -name .packlist \) -delete
+}
+
+sha512sums="e9d97cbec9f2607d1a89c1a06bd166ae2f030157f201e870df3b88b9f0b915b06a4b0db05b7f50daa4883de255e29c6898b1f9964d706739d4bf7034b53d7f89 IPC-Run-20180523.0.tar.gz"
diff --git a/user/perl-x11-xcb/APKBUILD b/user/perl-x11-xcb/APKBUILD
index b28a86211..070b97db9 100644
--- a/user/perl-x11-xcb/APKBUILD
+++ b/user/perl-x11-xcb/APKBUILD
@@ -7,12 +7,13 @@ pkgdesc="Perl bindings for libxcb"
url="https://metacpan.org/pod/X11::XCB"
arch="all"
license="Artistic-1.0-Perl AND GPL-2.0"
-depends="perl perl-extutils-pkgconfig perl-extutils-depends perl-xs-object-magic
- perl-xs-object-magic-dev perl-data-dump perl-xml-simple perl-xml-descent
- perl-mouse perl-mousex-nativetraits"
-makedepends="perl-dev"
+depends="perl perl-extutils-pkgconfig perl-extutils-depends
+ perl-xs-object-magic perl-data-dump perl-xml-simple
+ perl-xml-descent perl-mouse perl-mousex-nativetraits"
+makedepends="perl-dev perl-xs-object-magic-dev libxcb-dev
+ xcb-util-dev xcb-util-wm-dev"
checkdepends="perl-test-deep perl-test-exception"
-install=""
+options="!check" # Tests require a running X server
subpackages="$pkgname-doc"
source="https://cpan.metacpan.org/authors/id/M/MS/MSTPLBG/X11-XCB-$pkgver.tar.gz"
builddir="$srcdir/X11-XCB-$pkgver"
diff --git a/user/screen/APKBUILD b/user/screen/APKBUILD
new file mode 100644
index 000000000..e717f570d
--- /dev/null
+++ b/user/screen/APKBUILD
@@ -0,0 +1,43 @@
+# Contributor: Michael Mason <ms13sp@gmail.com>
+# Contributor: Natanael Copa <ncopa@alpinelinux.org>
+# Maintainer: Dan Theisen <djt@hxx.in>
+pkgname=screen
+pkgver=4.6.2
+pkgrel=0
+pkgdesc="A window manager that multiplexes a physical terminal"
+url="http://ftp.gnu.org/gnu/screen/"
+arch="all"
+license="GPL-3.0+"
+options="!check" # No test suite.
+makedepends="ncurses-dev utmps-dev"
+subpackages="$pkgname-doc"
+source="http://ftp.gnu.org/gnu/$pkgname/$pkgname-$pkgver.tar.gz
+ utmpx.patch"
+
+build() {
+ cd "$builddir"
+ LIBS="-lutmps -lskarnet" ./configure \
+ --build=$CBUILD \
+ --host=$CHOST \
+ --prefix=/usr \
+ --sysconfdir=/etc \
+ --mandir=/usr/share/man \
+ --infodir=/usr/share/info \
+ --enable-colors256
+ make
+}
+
+package() {
+ cd "$builddir"
+ make -j1 DESTDIR="$pkgdir" install
+
+ # remove suid root
+ find "$pkgdir" -type f -perm -u+s -print0 \
+ | xargs -0 chmod -s
+
+ install -Dm644 etc/etcscreenrc "$pkgdir"/etc/screenrc
+ install -Dm644 etc/screenrc "$pkgdir"/etc/skel/.screenrc
+}
+
+sha512sums="224bd16ad5ae501d1b8bb7d2ba9cc19e6a0743de5a5b320109c2f6bf3b1ca564cc7094ed9211be13733d9d769cde77d13fe236341d448cad0518038ab1e85c99 screen-4.6.2.tar.gz
+82aca3e16c8cd7a3029d3b589ff2dd3471708d6287979ebb5cfdaedbd1f3012c0cd660b131e0cbe142b99786e49ef8b24c63159523d870e95ccf71ec94b82634 utmpx.patch"
diff --git a/user/screen/utmpx.patch b/user/screen/utmpx.patch
new file mode 100644
index 000000000..c8c6f444b
--- /dev/null
+++ b/user/screen/utmpx.patch
@@ -0,0 +1,21 @@
+--- screen-4.6.2/os.h.old 2018-09-27 23:11:11.655480028 -0700
++++ screen-4.6.2/os.h 2018-09-27 23:11:34.745808665 -0700
+@@ -250,17 +250,13 @@
+ #endif
+
+ #if defined(UTMPOK) || defined(BUGGYGETLOGIN)
+-# if defined(SVR4) && !defined(DGUX) && !defined(__hpux) && !defined(linux)
++# if defined(linux)
+ # include <utmpx.h>
+ # define UTMPFILE UTMPX_FILE
+ # define utmp utmpx
+-# define getutent getutxent
+ # define getutid getutxid
+ # define getutline getutxline
+ # define pututline pututxline
+-# define setutent setutxent
+-# define endutent endutxent
+-# define ut_time ut_xtime
+ # else /* SVR4 */
+ # include <utmp.h>
+ # endif /* SVR4 */
diff --git a/user/sdl_mixer/APKBUILD b/user/sdl_mixer/APKBUILD
new file mode 100644
index 000000000..2cdb8238e
--- /dev/null
+++ b/user/sdl_mixer/APKBUILD
@@ -0,0 +1,44 @@
+# Contributor: Carlo Landmeter
+# Maintainer:
+pkgname=sdl_mixer
+pkgver=1.2.12
+pkgrel=2
+pkgdesc="A simple multi-channel audio mixer"
+url="https://www.libsdl.org/projects/SDL_mixer/release-1.2.html"
+arch="all"
+options="!check" # No test suite.
+license="Zlib"
+depends=""
+makedepends="flac-dev fluidsynth-dev libvorbis-dev linux-headers sdl-dev"
+subpackages="$pkgname-dev"
+source="https://www.libsdl.org/projects/SDL_mixer/release/SDL_mixer-${pkgver}.tar.gz"
+builddir="$srcdir"/SDL_mixer-$pkgver
+
+prepare() {
+ cd "$builddir"
+ update_config_sub
+ sed -e "/CONFIG_FILE_ETC/s/\/etc\/timidity.cfg/\/etc\/timidity++\/timidity.cfg/" \
+ -e "/DEFAULT_PATH/s/\/etc\/timidity/\/etc\/timidity++/" \
+ -e "/DEFAULT_PATH2/s/\/usr\/local\/lib\/timidity/\/usr\/lib\/timidity/" \
+ -i timidity/config.h
+}
+
+build() {
+ cd "$builddir"
+ ./configure \
+ --build=$CBUILD \
+ --host=$CHOST \
+ --prefix=/usr \
+ --sysconfdir=/etc \
+ --mandir=/usr/share/man \
+ --infodir=/usr/share/info \
+ --enable-music-mod
+ make
+}
+
+package() {
+ cd "$builddir"
+ make DESTDIR="$pkgdir" install
+}
+
+sha512sums="230f6c5a73f4bea364f8aa3d75f76694305571dea45f357def742b2b50849b2d896af71e08689981207edc99a9836088bee2d0bd98d92c7f4ca52b12b3d8cf96 SDL_mixer-1.2.12.tar.gz"
diff --git a/user/sdl_net/APKBUILD b/user/sdl_net/APKBUILD
new file mode 100644
index 000000000..6172ddc1e
--- /dev/null
+++ b/user/sdl_net/APKBUILD
@@ -0,0 +1,46 @@
+# Contributor: A. Wilcox <awilfox@adelielinux.org>
+# Maintainer: A. Wilcox <awilfox@adelielinux.org>
+pkgname=sdl_net
+_pkgname=SDL_net
+pkgver=1.2.8
+pkgrel=0
+pkgdesc="Cross-platform networking library"
+url="https://www.libsdl.org/projects/SDL_net/release-1.2.html"
+arch="all"
+license="zlib"
+depends=""
+makedepends="sdl-dev"
+subpackages="$pkgname-dev"
+source="https://www.libsdl.org/projects/$_pkgname/release/$_pkgname-$pkgver.tar.gz"
+builddir="$srcdir"/$_pkgname-$pkgver
+
+prepare() {
+ cd "$builddir"
+ default_prepare
+ update_config_sub
+}
+
+build() {
+ cd "$builddir"
+ ./configure \
+ --build=$CBUILD \
+ --host=$CHOST \
+ --prefix=/usr \
+ --sysconfdir=/etc \
+ --mandir=/usr/share/man \
+ --localstatedir=/var \
+ --disable-static
+ make
+}
+
+check() {
+ cd "$builddir"
+ make check
+}
+
+package() {
+ cd "$builddir"
+ make DESTDIR="$pkgdir" install
+}
+
+sha512sums="2766ca55343127c619958ab3a3ae3052a27a676839f10a158f7dfc071b8db38c2f1fc853e8add32b9fef94ab07eaa986f46a68e264e8087b57c990af30ea9a0b SDL_net-1.2.8.tar.gz"
diff --git a/user/tcpdump/APKBUILD b/user/tcpdump/APKBUILD
new file mode 100644
index 000000000..c5f4203e7
--- /dev/null
+++ b/user/tcpdump/APKBUILD
@@ -0,0 +1,38 @@
+# Contributor: Natanael Copa <ncopa@alpinelinux.org>
+# Maintainer: Dan Theisen <djt@hxx.in>
+pkgname=tcpdump
+pkgver=4.9.2
+pkgrel=0
+pkgdesc="A tool for network monitoring and data acquisition"
+url="http://www.tcpdump.org"
+arch="all"
+license="BSD-3-Clause"
+depends=""
+makedepends="libpcap-dev openssl-dev perl"
+subpackages="$pkgname-doc"
+source="http://www.tcpdump.org/release/$pkgname-$pkgver.tar.gz"
+
+build () {
+ cd "$builddir"
+ ./configure \
+ --build=$CBUILD \
+ --host=$CHOST \
+ --prefix=/usr \
+ --sysconfdir=/etc \
+ --mandir=/usr/share/man \
+ --localstatedir=/var
+ make
+}
+
+check() {
+ cd "$builddir"
+ make check
+}
+
+package() {
+ cd "$builddir"
+ make DESTDIR="$pkgdir" install
+ rm -f "$pkgdir"/usr/sbin/tcpdump.4*
+}
+
+sha512sums="e1bc19a5867d6e3628f3941bdf3ec831bf13784f1233ca1bccc46aac1702f47ee9357d7ff0ca62cddf211b3c8884488c21144cabddd92c861e32398cd8f7c44b tcpdump-4.9.2.tar.gz"
diff --git a/user/tcsh/001-sysmalloc.patch b/user/tcsh/001-sysmalloc.patch
new file mode 100644
index 000000000..b22c01898
--- /dev/null
+++ b/user/tcsh/001-sysmalloc.patch
@@ -0,0 +1,15 @@
+--- a/config_f.h
++++ b/config_f.h
+@@ -139,11 +139,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/user/tcsh/002-test_123-posix_fix.patch b/user/tcsh/002-test_123-posix_fix.patch
new file mode 100644
index 000000000..6ed59de38
--- /dev/null
+++ b/user/tcsh/002-test_123-posix_fix.patch
@@ -0,0 +1,34 @@
+Author: Dan Theisen <djt@hxx.in>
+Date: Wed Jun 06 03:30:25 2018 -0800
+
+The following lines have a subtle change around [:blank:], changing it
+to [[:blank:]] instead. This is required because POSIX treats characters
+inside of brackets as a group of characters to match against. In this case,
+[[:space:]] means [] group of characters, and [:space:] is the group, as per:
+IEEE Std 1003.1-2017 (Revision of IEEE Std 1003.1-2008), Chapter 9
+http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap09.html
+
+--- tcsh-6.20.00/tests/lexical.at.old 2018-06-06 02:20:16.787145186 -0700
++++ tcsh-6.20.00/tests/lexical.at 2018-06-06 02:21:09.537890842 -0700
+@@ -567,10 +567,10 @@
+ ]])
+ AT_DATA([uniformity_test.csh],
+ [[
+-set SERVICE_NAME_LOG = `cat batchsystem.properties | grep '^jdbc_url' | sed -ne 's/^[^=]*=[^@]*@[:blank:]*\([^$]*\)$/\1/p' | perl -pe 's/\s//g' | perl -pe 's/\)/\\\)/g' | perl -pe 's/\(/\\\(/g'`
++set SERVICE_NAME_LOG = `cat batchsystem.properties | grep '^jdbc_url' | sed -ne 's/^[^=]*=[^@]*@[[:blank:]]*\([^$]*\)$/\1/p' | perl -pe 's/\s//g' | perl -pe 's/\)/\\\)/g' | perl -pe 's/\(/\\\(/g'`
+ echo -n "$SERVICE_NAME_LOG" > ./output1
+
+-cat batchsystem.properties | grep '^jdbc_url' | sed -ne 's/^[^=]*=[^@]*@[:blank:]*\([^$]*\)$/\1/p' | perl -pe 's/\s//g' | perl -pe 's/\)/\\\)/g' | perl -pe 's/\(/\\\(/g' > ./output2
++cat batchsystem.properties | grep '^jdbc_url' | sed -ne 's/^[^=]*=[^@]*@[[:blank:]]*\([^$]*\)$/\1/p' | perl -pe 's/\s//g' | perl -pe 's/\)/\\\)/g' | perl -pe 's/\(/\\\(/g' > ./output2
+
+ diff -uprN ./output1 ./output2 >& /dev/null
+
+@@ -587,7 +587,7 @@
+ echo "(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP\)(HOST=db\)(PORT=1521\)\)(CONNECT_DATA=(SERVER=DEDICATED\)(SERVICE_NAME=bns03\)\)\)" > ./expected_result
+
+ set string = "jdbc_url=jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=db)(PORT=1521))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=bns03)))"
+-set SERVICE_NAME_LOG = `echo "$string" | grep '^jdbc_url' | sed -ne 's/^[^=]*=[^@]*@[:blank:]*\([^$]*\)$/\1/p' | perl -pe 's/\)/\\\)/g'`
++set SERVICE_NAME_LOG = `echo "$string" | grep '^jdbc_url' | sed -ne 's/^[^=]*=[^@]*@[[:blank:]]*\([^$]*\)$/\1/p' | perl -pe 's/\)/\\\)/g'`
+
+ echo "$SERVICE_NAME_LOG" > ./actual_result
+
diff --git a/user/tcsh/APKBUILD b/user/tcsh/APKBUILD
new file mode 100644
index 000000000..2fdfac0b2
--- /dev/null
+++ b/user/tcsh/APKBUILD
@@ -0,0 +1,47 @@
+# Contributor: Dan Theisen <djt@hxx.in>
+# Maintainer: Dan Theisen <djt@hxx.in>
+pkgname=tcsh
+pkgver=6.20.00
+pkgrel=2
+pkgdesc="extended C-shell"
+url="http://www.tcsh.org"
+arch="all"
+license="BSD-3-Clause"
+depends=""
+checkdepends="diffutils autoconf"
+makedepends="ncurses-dev ncurses-terminfo utmps-dev gettext-tiny-dev"
+install="$pkgname.post-install $pkgname.post-upgrade $pkgname.pre-deinstall"
+subpackages="$pkgname-doc"
+options="!checkroot"
+source="$pkgname-$pkgver.tar.gz::http://http.debian.net/debian/pool/main/t/tcsh/${pkgname}_${pkgver}.orig.tar.gz
+ 001-sysmalloc.patch
+ 002-test_123-posix_fix.patch"
+
+build() {
+ cd "$builddir"
+ LIBS="-lutmps -lskarnet -ltinfo" ./configure \
+ --build=$CBUILD \
+ --host=$CHOST \
+ --prefix=/usr \
+ --bindir=/bin \
+ --mandir=/usr/share/man \
+ --infodir=/usr/share/info \
+ --enable-nls \
+ --enable-nls-catalogs \
+ --disable-rpath
+ make
+}
+
+check() {
+ cd "$builddir"
+ make check
+}
+
+package() {
+ cd "$builddir"
+ make DESTDIR="$pkgdir" install
+}
+
+sha512sums="c5635393c22341e62fb9a0b953ddf8871a876ab09deb08c98237f93afa9257b4a3381d1db65eefe769e22ef845db29ab7bc78773f1f609d73c8205689a6683e9 tcsh-6.20.00.tar.gz
+40149d8eb2fc0fe5184f3c24c7a1b728e881cc0048ccd37a986c3b2d2094499ec1c37ae2bae4c209fb8a847aa943e83e81f79e3d2f55c59990bc00d9d07f5a94 001-sysmalloc.patch
+b4c1afe04554d117b1402608bcdb243148c0c7b2442bdc10dde3ed6601db5e7c5a2341373f9bdc31fda8860e47a6e152cdcc4e3a8b273742037eebc624df282c 002-test_123-posix_fix.patch"
diff --git a/user/tcsh/tcsh.post-install b/user/tcsh/tcsh.post-install
new file mode 100644
index 000000000..7342c5e72
--- /dev/null
+++ b/user/tcsh/tcsh.post-install
@@ -0,0 +1,3 @@
+#!/bin/sh
+add-shell '/bin/tcsh'
+exit 0
diff --git a/user/tcsh/tcsh.post-upgrade b/user/tcsh/tcsh.post-upgrade
new file mode 120000
index 000000000..180542a18
--- /dev/null
+++ b/user/tcsh/tcsh.post-upgrade
@@ -0,0 +1 @@
+tcsh.post-install \ No newline at end of file
diff --git a/user/tcsh/tcsh.pre-deinstall b/user/tcsh/tcsh.pre-deinstall
new file mode 100644
index 000000000..9e2e34c1c
--- /dev/null
+++ b/user/tcsh/tcsh.pre-deinstall
@@ -0,0 +1,3 @@
+#!/bin/sh
+remove-shell '/bin/tcsh'
+exit 0
diff --git a/user/valgrind/0001-Ensure-ELFv2-is-supported-on-PPC64.patch b/user/valgrind/0001-Ensure-ELFv2-is-supported-on-PPC64.patch
new file mode 100644
index 000000000..5272406ec
--- /dev/null
+++ b/user/valgrind/0001-Ensure-ELFv2-is-supported-on-PPC64.patch
@@ -0,0 +1,817 @@
+From a5224eb31a4c8a680587e74cc402e5ed92ead216 Mon Sep 17 00:00:00 2001
+From: "A. Wilcox" <AWilcox@Wilcox-Tech.com>
+Date: Thu, 27 Sep 2018 15:42:40 -0500
+Subject: [PATCH] Ensure ELFv2 is supported on PPC64
+
+---
+ coregrind/m_dispatch/dispatch-ppc64be-linux.S | 107 ++++++++++++++++--
+ coregrind/m_initimg/initimg-linux.c | 5 +-
+ coregrind/m_libcsetjmp.c | 7 +-
+ coregrind/m_machine.c | 3 +-
+ coregrind/m_main.c | 19 ++--
+ coregrind/m_sigframe/sigframe-ppc64-linux.c | 3 +-
+ coregrind/m_signals.c | 11 +-
+ coregrind/m_stacktrace.c | 12 +-
+ coregrind/m_syscall.c | 9 +-
+ coregrind/m_syswrap/syscall-ppc64be-linux.S | 19 +++-
+ coregrind/m_syswrap/syswrap-ppc64-linux.c | 9 +-
+ coregrind/m_trampoline.S | 4 +-
+ coregrind/m_translate.c | 23 ++--
+ coregrind/m_ume/elf.c | 8 +-
+ coregrind/pub_core_machine.h | 12 +-
+ coregrind/vg_preloaded.c | 3 +-
+ include/valgrind.h | 16 ++-
+ memcheck/mc_leakcheck.c | 2 +-
+ memcheck/mc_machine.c | 3 +-
+ 19 files changed, 206 insertions(+), 69 deletions(-)
+
+diff --git a/coregrind/m_dispatch/dispatch-ppc64be-linux.S b/coregrind/m_dispatch/dispatch-ppc64be-linux.S
+index 91bd3b236..eb8026c7c 100644
+--- a/coregrind/m_dispatch/dispatch-ppc64be-linux.S
++++ b/coregrind/m_dispatch/dispatch-ppc64be-linux.S
+@@ -75,14 +75,26 @@ void VG_(disp_run_translations)( UWord* two_words,
+ .section ".text"
+ .align 2
+ .globl VG_(disp_run_translations)
++#if _CALL_ELF == 2
++.type VG_(disp_run_translations),@function
++VG_(disp_run_translations):
++.type .VG_(disp_run_translations),@function
++#else
+ .section ".opd","aw"
+ .align 3
+ VG_(disp_run_translations):
+ .quad .VG_(disp_run_translations),.TOC.@tocbase,0
+ .previous
+ .type .VG_(disp_run_translations),@function
++#endif
+ .globl .VG_(disp_run_translations)
+ .VG_(disp_run_translations):
++#if _CALL_ELF == 2
++0: addis 2, 12,.TOC.-0b@ha
++ addi 2,2,.TOC.-0b@l
++ .localentry VG_(disp_run_translations), .-VG_(disp_run_translations)
++#endif
++
+ /* r3 holds two_words */
+ /* r4 holds guest_state */
+ /* r5 holds host_addr */
+@@ -231,6 +243,11 @@ VG_(disp_run_translations):
+
+ /* Set up the guest state ptr */
+ mr 31,4 /* r31 (generated code gsp) = r4 */
++#if _CALL_ELF == 2
++/* for the LE ABI need to setup r2 and r12 */
++0: addis 2, 12,.TOC.-0b@ha
++ addi 2,2,.TOC.-0b@l
++#endif
+
+ /* and jump into the code cache. Chained translations in
+ the code cache run, until for whatever reason, they can't
+@@ -385,7 +402,9 @@ VG_(disp_run_translations):
+ mtlr 0
+ addi 1,1,624 /* stack_size */
+ blr
+-
++#if _CALL_ELF == 2
++ .size VG_(disp_run_translations),.-VG_(disp_run_translations)
++#endif
+
+ /*----------------------------------------------------*/
+ /*--- Continuation points ---*/
+@@ -395,15 +414,25 @@ VG_(disp_run_translations):
+ .section ".text"
+ .align 2
+ .globl VG_(disp_cp_chain_me_to_slowEP)
+- .section ".opd","aw"
++#if _CALL_ELF == 2
++ .type VG_(disp_cp_chain_me_to_slowEP),@function
++ VG_(disp_cp_chain_me_to_slowEP):
++#else
++ .section ".opd","aw"
+ .align 3
+ VG_(disp_cp_chain_me_to_slowEP):
+ .quad .VG_(disp_cp_chain_me_to_slowEP),.TOC.@tocbase,0
+ .previous
++#endif
+ .type .VG_(disp_cp_chain_me_to_slowEP),@function
+ .globl .VG_(disp_cp_chain_me_to_slowEP)
+ .VG_(disp_cp_chain_me_to_slowEP):
+- /* We got called. The return address indicates
++#if _CALL_ELF == 2
++0: addis 2, 12,.TOC.-0b@ha
++ addi 2,2,.TOC.-0b@l
++ .localentry VG_(disp_cp_chain_me_to_slowEP), .-VG_(disp_cp_chain_me_to_slowEP)
++#endif
++ /* We got called. The return address indicates
+ where the patching needs to happen. Collect
+ the return address and, exit back to C land,
+ handing the caller the pair (Chain_me_S, RA) */
+@@ -415,20 +444,33 @@ VG_(disp_cp_chain_me_to_slowEP):
+ */
+ subi 7,7,20+4+4
+ b .postamble
++#if _CALL_ELF == 2
++ .size VG_(disp_cp_chain_me_to_slowEP),.-VG_(disp_cp_chain_me_to_slowEP)
++#endif
+
+ /* ------ Chain me to fast entry point ------ */
+ .section ".text"
+ .align 2
+ .globl VG_(disp_cp_chain_me_to_fastEP)
+- .section ".opd","aw"
++#if _CALL_ELF == 2
++ .type VG_(disp_cp_chain_me_to_fastEP),@function
++VG_(disp_cp_chain_me_to_fastEP):
++#else
++ .section ".opd","aw"
+ .align 3
+ VG_(disp_cp_chain_me_to_fastEP):
+ .quad .VG_(disp_cp_chain_me_to_fastEP),.TOC.@tocbase,0
+ .previous
++#endif
+ .type .VG_(disp_cp_chain_me_to_fastEP),@function
+ .globl .VG_(disp_cp_chain_me_to_fastEP)
+ .VG_(disp_cp_chain_me_to_fastEP):
+- /* We got called. The return address indicates
++#if _CALL_ELF == 2
++0: addis 2, 12,.TOC.-0b@ha
++ addi 2,2,.TOC.-0b@l
++ .localentry VG_(disp_cp_chain_me_to_fastEP), .-VG_(disp_cp_chain_me_to_fastEP)
++#endif
++ /* We got called. The return address indicates
+ where the patching needs to happen. Collect
+ the return address and, exit back to C land,
+ handing the caller the pair (Chain_me_S, RA) */
+@@ -440,20 +482,33 @@ VG_(disp_cp_chain_me_to_fastEP):
+ */
+ subi 7,7,20+4+4
+ b .postamble
++#if _CALL_ELF == 2
++ .size VG_(disp_cp_chain_me_to_fastEP),.-VG_(disp_cp_chain_me_to_fastEP)
++#endif
+
+ /* ------ Indirect but boring jump ------ */
+ .section ".text"
+ .align 2
+ .globl VG_(disp_cp_xindir)
+- .section ".opd","aw"
++#if _CALL_ELF == 2
++ .type VG_(disp_cp_xindir),@function
++VG_(disp_cp_xindir):
++#else
++ .section ".opd","aw"
+ .align 3
+ VG_(disp_cp_xindir):
+ .quad .VG_(disp_cp_xindir),.TOC.@tocbase,0
+ .previous
++#endif
+ .type .VG_(disp_cp_xindir),@function
+ .globl .VG_(disp_cp_xindir)
+ .VG_(disp_cp_xindir):
+- /* Where are we going? */
++#if _CALL_ELF == 2
++0: addis 2, 12,.TOC.-0b@ha
++ addi 2,2,.TOC.-0b@l
++ .localentry VG_(disp_cp_xindir), .-VG_(disp_cp_xindir)
++#endif
++ /* Where are we going? */
+ ld 3,OFFSET_ppc64_CIA(31)
+
+ /* stats only */
+@@ -479,6 +534,9 @@ VG_(disp_cp_xindir):
+ /* Found a match. Jump to .host. */
+ mtctr 7
+ bctr
++#if _CALL_ELF == 2
++ .size VG_(disp_cp_xindir),.-VG_(disp_cp_xindir)
++#endif
+
+ .fast_lookup_failed:
+ /* stats only */
+@@ -496,39 +554,64 @@ VG_(disp_cp_xindir):
+ .section ".text"
+ .align 2
+ .globl VG_(disp_cp_xassisted)
+- .section ".opd","aw"
++#if _CALL_ELF == 2
++ .type VG_(disp_cp_xassisted),@function
++VG_(disp_cp_xassisted):
++#else
++ .section ".opd","aw"
+ .align 3
+ VG_(disp_cp_xassisted):
+ .quad .VG_(disp_cp_xassisted),.TOC.@tocbase,0
+ .previous
+- .type .VG_(disp_cp_xassisted),@function
++#endif
++#if _CALL_ELF == 2
++0: addis 2, 12,.TOC.-0b@ha
++ addi 2,2,.TOC.-0b@l
++ .localentry VG_(disp_cp_xassisted), .-VG_(disp_cp_xassisted)
++#endif
++ .type .VG_(disp_cp_xassisted),@function
+ .globl .VG_(disp_cp_xassisted)
+ .VG_(disp_cp_xassisted):
+ /* r31 contains the TRC */
+ mr 6,31
+ li 7,0
+ b .postamble
++#if _CALL_ELF == 2
++ .size VG_(disp_cp_xassisted),.-VG_(disp_cp_xassisted)
++#endif
+
+ /* ------ Event check failed ------ */
+ .section ".text"
+ .align 2
+ .globl VG_(disp_cp_evcheck_fail)
+- .section ".opd","aw"
++#if _CALL_ELF == 2
++ .type VG_(disp_cp_evcheck_fail),@function
++VG_(disp_cp_evcheck_fail):
++#else
++ .section ".opd","aw"
+ .align 3
+ VG_(disp_cp_evcheck_fail):
+ .quad .VG_(disp_cp_evcheck_fail),.TOC.@tocbase,0
+ .previous
++#endif
++#if _CALL_ELF == 2
++0: addis 2, 12,.TOC.-0b@ha
++ addi 2,2,.TOC.-0b@l
++ .localentry VG_(disp_cp_evcheck_fail), .-VG_(disp_cp_evcheck_fail)
++#endif
+ .type .VG_(disp_cp_evcheck_fail),@function
+ .globl .VG_(disp_cp_evcheck_fail)
+ .VG_(disp_cp_evcheck_fail):
+ li 6,VG_TRC_INNER_COUNTERZERO
+ li 7,0
+ b .postamble
++#if _CALL_ELF == 2
++ .size VG_(disp_cp_evcheck_fail),.-VG_(disp_cp_evcheck_fail)
++#endif
+
+-
+ .size .VG_(disp_run_translations), .-.VG_(disp_run_translations)
+
+-#endif // defined(VGP_ppc64be_linux)
++#endif // defined(VGP_ppc64be_linux) || defined(VGP_ppc64le_linux)
+
+ /* Let the linker know we don't need an executable stack */
+ MARK_STACK_NO_EXEC
+diff --git a/coregrind/m_initimg/initimg-linux.c b/coregrind/m_initimg/initimg-linux.c
+index 61cc458bc..19df79705 100644
+--- a/coregrind/m_initimg/initimg-linux.c
++++ b/coregrind/m_initimg/initimg-linux.c
+@@ -1117,7 +1117,8 @@ void VG_(ii_finalise_image)( IIFinaliseImageInfo iifii )
+ arch->vex.guest_GPR1 = iifii.initial_client_SP;
+ arch->vex.guest_GPR2 = iifii.initial_client_TOC;
+ arch->vex.guest_CIA = iifii.initial_client_IP;
+-#if defined(VGP_ppc64le_linux)
++#if (defined(VGP_ppc64be_linux) || defined(VGP_ppc64le_linux)) \
++ && !defined(VG_PLAT_USES_PPCTOC)
+ arch->vex.guest_GPR12 = iifii.initial_client_IP;
+ #endif
+
+diff --git a/coregrind/m_libcsetjmp.c b/coregrind/m_libcsetjmp.c
+index c73180640..ed96f4739 100644
+--- a/coregrind/m_libcsetjmp.c
++++ b/coregrind/m_libcsetjmp.c
+@@ -35,6 +35,7 @@
+
+ #include "pub_core_basics.h"
+ #include "pub_core_libcsetjmp.h" /* self */
++#include "pub_core_machine.h" /* VG_PLAT_USES_PPCTOC */
+
+ /* See include/pub_tool_libcsetjmp.h for background and rationale. */
+
+@@ -151,7 +152,8 @@ __asm__(
+
+ /* ------------ ppc64-linux ------------ */
+
+-#if defined(VGP_ppc64be_linux)
++#if (defined(VGP_ppc64be_linux) || defined(VGP_ppc64le_linux)) \
++ && defined(VG_PLAT_USES_PPCTOC)
+
+ __asm__(
+ ".section \".toc\",\"aw\"" "\n"
+@@ -270,7 +272,8 @@ __asm__(
+ ".previous" "\n"
+ );
+
+-#elif defined(VGP_ppc64le_linux)
++#elif (defined(VGP_ppc64be_linux) || defined(VGP_ppc64le_linux)) \
++ && !defined(VG_PLAT_USES_PPCTOC)
+ __asm__(
+ ".section \".toc\",\"aw\"" "\n"
+
+diff --git a/coregrind/m_machine.c b/coregrind/m_machine.c
+index 31b0e1b6b..eb3e6a4e1 100644
+--- a/coregrind/m_machine.c
++++ b/coregrind/m_machine.c
+@@ -2035,7 +2035,8 @@ void* VG_(fnptr_to_fnentry)( void* f )
+ || defined(VGP_ppc32_linux) || defined(VGP_ppc64le_linux) \
+ || defined(VGP_s390x_linux) || defined(VGP_mips32_linux) \
+ || defined(VGP_mips64_linux) || defined(VGP_arm64_linux) \
+- || defined(VGP_x86_solaris) || defined(VGP_amd64_solaris)
++ || defined(VGP_x86_solaris) || defined(VGP_amd64_solaris) \
++ || (defined(VGP_ppc64be_linux) && !defined(VG_PLAT_USES_PPCTOC))
+ return f;
+ # elif defined(VGP_ppc64be_linux)
+ /* ppc64-linux uses the AIX scheme, in which f is a pointer to a
+diff --git a/coregrind/m_main.c b/coregrind/m_main.c
+index bf4a71284..102235dca 100644
+--- a/coregrind/m_main.c
++++ b/coregrind/m_main.c
+@@ -2274,7 +2274,7 @@ static void final_tidyup(ThreadId tid)
+ return; /* won't do it */
+ }
+
+-# if defined(VGP_ppc64be_linux)
++# if defined(VGP_ppc64be_linux) && defined(VG_PLAT_USES_PPCTOC)
+ Addr r2 = VG_(get_tocptr)(freeres_wrapper);
+ if (r2 == 0) {
+ VG_(message)(Vg_UserMsg,
+@@ -2306,9 +2306,11 @@ static void final_tidyup(ThreadId tid)
+ directly. However, we need to set R2 (the toc pointer)
+ appropriately. */
+ VG_(set_IP)(tid, freeres_wrapper);
+-# if defined(VGP_ppc64be_linux)
++# if (defined(VGP_ppc64be_linux) || defined(VGP_ppc64le_linux)) \
++ && defined(VG_PLAT_USES_PPCTOC)
+ VG_(threads)[tid].arch.vex.guest_GPR2 = r2;
+-# elif defined(VGP_ppc64le_linux)
++# elif (defined(VGP_ppc64be_linux) || defined(VGP_ppc64le_linux)) \
++ && !defined(VG_PLAT_USES_PPCTOC)
+ /* setting GPR2 but not really needed, GPR12 is needed */
+ VG_(threads)[tid].arch.vex.guest_GPR2 = freeres_wrapper;
+ VG_(threads)[tid].arch.vex.guest_GPR12 = freeres_wrapper;
+@@ -2610,9 +2612,10 @@ asm("\n"
+ "\ttrap\n"
+ ".previous\n"
+ );
+-#elif defined(VGP_ppc64be_linux)
++#elif (defined(VGP_ppc64be_linux) || defined(VGP_ppc64le_linux)) \
++ && defined(VG_PLAT_USES_PPCTOC)
+ asm("\n"
+- /* PPC64 ELF ABI says '_start' points to a function descriptor.
++ /* PPC64 ELFv1 ABI says '_start' points to a function descriptor.
+ So we must have one, and that is what goes into the .opd section. */
+ "\t.align 2\n"
+ "\t.global _start\n"
+@@ -2656,9 +2659,9 @@ asm("\n"
+ "\tnop\n"
+ "\ttrap\n"
+ );
+-#elif defined(VGP_ppc64le_linux)
+-/* Little Endian uses ELF version 2 but in the future may also
+- * support other ELF versions.
++#elif (defined(VGP_ppc64be_linux) || defined(VGP_ppc64le_linux)) \
++ && !defined(VG_PLAT_USES_PPCTOC)
++/* ELF version 2 does not use function descriptors.
+ */
+ asm("\n"
+ "\t.align 2\n"
+diff --git a/coregrind/m_sigframe/sigframe-ppc64-linux.c b/coregrind/m_sigframe/sigframe-ppc64-linux.c
+index b16606c22..cc657838f 100644
+--- a/coregrind/m_sigframe/sigframe-ppc64-linux.c
++++ b/coregrind/m_sigframe/sigframe-ppc64-linux.c
+@@ -263,7 +263,8 @@ void VG_(sigframe_create)( ThreadId tid,
+
+ /* Handler is in fact a standard ppc64-linux function descriptor,
+ so extract the function entry point and also the toc ptr to use. */
+-#if defined(VGP_ppc64be_linux)
++#if (defined(VGP_ppc64be_linux) || defined(VGP_ppc64le_linux)) \
++ && defined(VG_PLAT_USES_PPCTOC)
+ SET_SIGNAL_GPR(tid, 2, (Addr) ((ULong*)handler)[1]);
+ tst->arch.vex.guest_CIA = (Addr) ((ULong*)handler)[0];
+ #else
+diff --git a/coregrind/m_signals.c b/coregrind/m_signals.c
+index e572f17cc..52d939057 100644
+--- a/coregrind/m_signals.c
++++ b/coregrind/m_signals.c
+@@ -889,7 +889,9 @@ extern void my_sigreturn(void);
+ " sc\n" \
+ ".previous\n"
+
+-#elif defined(VGP_ppc64be_linux)
++#elif (defined(VGP_ppc64be_linux) || defined(VGP_ppc64le_linux)) \
++ && defined(VG_PLAT_USES_PPCTOC)
++/* ELF version 1. Used in some legacy environments on LE, and most BE. */
+ # define _MY_SIGRETURN(name) \
+ ".align 2\n" \
+ ".globl my_sigreturn\n" \
+@@ -904,9 +906,10 @@ extern void my_sigreturn(void);
+ " li 0, " #name "\n" \
+ " sc\n"
+
+-#elif defined(VGP_ppc64le_linux)
+-/* Little Endian supports ELF version 2. In the future, it may
+- * support other versions.
++#elif (defined(VGP_ppc64be_linux) || defined(VGP_ppc64le_linux)) \
++ && !defined(VG_PLAT_USES_PPCTOC)
++/* ELF version 2. In the future, PPC64 may support other versions. Used by
++ * most LE environments and any BE environment running musl libc.
+ */
+ # define _MY_SIGRETURN(name) \
+ ".align 2\n" \
+diff --git a/coregrind/m_stacktrace.c b/coregrind/m_stacktrace.c
+index 24f1409dd..9be4c6da9 100644
+--- a/coregrind/m_stacktrace.c
++++ b/coregrind/m_stacktrace.c
+@@ -726,7 +726,8 @@ UInt VG_(get_StackTrace_wrk) ( ThreadId tid_if_known,
+ Addr fp_max_orig )
+ {
+ Bool lr_is_first_RA = False;
+-# if defined(VG_PLAT_USES_PPCTOC) || defined(VGP_ppc64le_linux)
++# if defined(VG_PLAT_USES_PPCTOC) || defined(VGP_ppc64be_linux) \
++ || defined(VGP_ppc64le_linux)
+ Word redir_stack_size = 0;
+ Word redirs_used = 0;
+ # endif
+@@ -787,7 +788,8 @@ UInt VG_(get_StackTrace_wrk) ( ThreadId tid_if_known,
+ redirs_used = 0;
+ # endif
+
+-# if defined(VG_PLAT_USES_PPCTOC) || defined (VGP_ppc64le_linux)
++# if defined(VG_PLAT_USES_PPCTOC) || defined(VGP_ppc64be_linux) \
++ || defined(VGP_ppc64le_linux)
+ /* Deal with bogus LR values caused by function
+ interception/wrapping on ppc-TOC platforms; see comment on
+ similar code a few lines further down. */
+@@ -839,7 +841,8 @@ UInt VG_(get_StackTrace_wrk) ( ThreadId tid_if_known,
+ /* On ppc64-linux (ppc64-elf, really), the lr save
+ slot is 2 words back from sp, whereas on ppc32-elf(?) it's
+ only one word back. */
+-# if defined(VG_PLAT_USES_PPCTOC) || defined(VGP_ppc64le_linux)
++# if defined(VG_PLAT_USES_PPCTOC) || defined(VGP_ppc64be_linux) \
++ || defined(VGP_ppc64le_linux)
+ const Int lr_offset = 2;
+ # else
+ const Int lr_offset = 1;
+@@ -858,7 +861,8 @@ UInt VG_(get_StackTrace_wrk) ( ThreadId tid_if_known,
+ else
+ ip = (((UWord*)fp)[lr_offset]);
+
+-# if defined(VG_PLAT_USES_PPCTOC) || defined(VGP_ppc64le_linux)
++# if defined(VG_PLAT_USES_PPCTOC) || defined(VGP_ppc64be_linux) \
++ || defined(VGP_ppc64le_linux)
+ /* Nasty hack to do with function replacement/wrapping on
+ ppc64-linux. If LR points to our magic return stub,
+ then we are in a wrapped or intercepted function, in
+diff --git a/coregrind/m_syscall.c b/coregrind/m_syscall.c
+index 5948cecf5..c1cdfab27 100644
+--- a/coregrind/m_syscall.c
++++ b/coregrind/m_syscall.c
+@@ -470,7 +470,8 @@ asm(
+ ".previous\n"
+ );
+
+-#elif defined(VGP_ppc64be_linux)
++#elif (defined(VGP_ppc64be_linux) || defined(VGP_ppc64le_linux)) \
++ && defined(VG_PLAT_USES_PPCTOC)
+ /* Due to the need to return 65 bits of result, this is completely
+ different from the ppc32 case. The single arg register points to a
+ 7-word block containing the syscall # and the 6 args. The syscall
+@@ -506,15 +507,15 @@ asm(
+ " blr\n"
+ );
+
+-#elif defined(VGP_ppc64le_linux)
++#elif (defined(VGP_ppc64be_linux) || defined(VGP_ppc64le_linux)) \
++ && !defined(VG_PLAT_USES_PPCTOC)
+ /* Due to the need to return 65 bits of result, this is completely
+ different from the ppc32 case. The single arg register points to a
+ 7-word block containing the syscall # and the 6 args. The syscall
+ result proper is put in [0] of the block, and %cr0.so is in the
+ bottom bit of [1]. */
+ extern void do_syscall_WRK ( ULong* argblock );
+-/* Little Endian supports ELF version 2. In the future, it may support
+- * other versions as well.
++/* ELF version 2. In the future, PPC64 may support other versions as well.
+ */
+ asm(
+ ".align 2\n"
+diff --git a/coregrind/m_syswrap/syscall-ppc64be-linux.S b/coregrind/m_syswrap/syscall-ppc64be-linux.S
+index 16e9cedc0..db0d8b4aa 100644
+--- a/coregrind/m_syswrap/syscall-ppc64be-linux.S
++++ b/coregrind/m_syswrap/syscall-ppc64be-linux.S
+@@ -76,11 +76,24 @@
+
+ .align 2
+ .globl ML_(do_syscall_for_client_WRK)
++#if _CALL_ELF == 2
++.type .ML_(do_syscall_for_client_WRK),@function
++ML_(do_syscall_for_client_WRK):
++0: addis 2,12,.TOC.-0b@ha
++ addi 2,2,.TOC.-0b@l
++ .localentry ML_(do_syscall_for_client_WRK), .-ML_(do_syscall_for_client_WRK)
++#else
+ .section ".opd","aw"
+ .align 3
+-ML_(do_syscall_for_client_WRK):
++ML_(do_syscall_for_client_WRK):
+ .quad .ML_(do_syscall_for_client_WRK),.TOC.@tocbase,0
+ .previous
++#endif
++#if _CALL_ELF == 2
++0: addis 2,12,.TOC.-0b@ha
++ addi 2,2,.TOC.-0b@l
++ .localentry ML_(do_syscall_for_client_WRK), .-ML_(do_syscall_for_client_WRK)
++#endif
+ .type .ML_(do_syscall_for_client_WRK),@function
+ .globl .ML_(do_syscall_for_client_WRK)
+ .ML_(do_syscall_for_client_WRK):
+@@ -145,7 +158,9 @@ ML_(do_syscall_for_client_WRK):
+ /* failure: return 0x8000 | error code */
+ 7: ori 3,3,0x8000 /* FAILURE -- ensure return value is nonzero */
+ b 5b
+-
++#if _CALL_ELF == 2
++ .size .ML_(do_syscall_for_client_WRK),.-.ML_(do_syscall_for_client_WRK)
++#endif
+ .section .rodata
+ /* export the ranges so that
+ VG_(fixup_guest_state_after_syscall_interrupted) can do the
+diff --git a/coregrind/m_syswrap/syswrap-ppc64-linux.c b/coregrind/m_syswrap/syswrap-ppc64-linux.c
+index 6549dd1b3..4ecbe38a6 100644
+--- a/coregrind/m_syswrap/syswrap-ppc64-linux.c
++++ b/coregrind/m_syswrap/syswrap-ppc64-linux.c
+@@ -41,6 +41,7 @@
+ #include "pub_core_libcprint.h"
+ #include "pub_core_libcproc.h"
+ #include "pub_core_libcsignal.h"
++#include "pub_core_machine.h"
+ #include "pub_core_options.h"
+ #include "pub_core_scheduler.h"
+ #include "pub_core_sigframe.h" // For VG_(sigframe_destroy)()
+@@ -76,7 +77,8 @@ void ML_(call_on_new_stack_0_1) ( Addr stack,
+ address, the second word is the TOC ptr (r2), and the third word is
+ the static chain value. */
+ asm(
+-#if defined(VGP_ppc64be_linux)
++#if (defined(VGP_ppc64be_linux) || defined(VGP_ppc64le_linux)) \
++ && defined(VG_PLAT_USES_PPCTOC)
+ " .align 2\n"
+ " .globl vgModuleLocal_call_on_new_stack_0_1\n"
+ " .section \".opd\",\"aw\"\n"
+@@ -126,7 +128,7 @@ asm(
+ " bctr\n\t" // jump to dst
+ " trap\n" // should never get here
+ #else
+-// ppc64le_linux
++// ppc64 ELFv2 Linux
+ " .align 2\n"
+ " .globl vgModuleLocal_call_on_new_stack_0_1\n"
+ "vgModuleLocal_call_on_new_stack_0_1:\n"
+@@ -211,7 +213,8 @@ asm(
+
+ // See priv_syswrap-linux.h for arg profile.
+ asm(
+-#if defined(VGP_ppc64be_linux)
++#if (defined(VGP_ppc64be_linux) || defined(VGP_ppc64le_linux)) \
++ && defined(VG_PLAT_USES_PPCTOC)
+ " .align 2\n"
+ " .globl do_syscall_clone_ppc64_linux\n"
+ " .section \".opd\",\"aw\"\n"
+diff --git a/coregrind/m_trampoline.S b/coregrind/m_trampoline.S
+index 0488b54bd..d00916aef 100644
+--- a/coregrind/m_trampoline.S
++++ b/coregrind/m_trampoline.S
+@@ -469,11 +469,11 @@ VG_(ppctoc_magic_redirect_return_stub):
+ .align 2
+ .globl VG_(ppc64_linux_REDIR_FOR_strlen)
+ #if !defined VGP_ppc64be_linux || _CALL_ELF == 2
+- /* Little Endian uses ELF version 2 */
++ /* ELF version 2 */
+ .type VG_(ppc64_linux_REDIR_FOR_strlen),@function
+ VG_(ppc64_linux_REDIR_FOR_strlen):
+ #else
+- /* Big Endian uses ELF version 1 */
++ /* ELF version 1 */
+ .section ".opd","aw"
+ .align 3
+ VG_(ppc64_linux_REDIR_FOR_strlen):
+diff --git a/coregrind/m_translate.c b/coregrind/m_translate.c
+index 3602a4663..bdd1d50ee 100644
+--- a/coregrind/m_translate.c
++++ b/coregrind/m_translate.c
+@@ -1006,7 +1006,8 @@ static IRExpr* mkU32 ( UInt n ) {
+ return IRExpr_Const(IRConst_U32(n));
+ }
+
+-#if defined(VG_PLAT_USES_PPCTOC) || defined(VGP_ppc64le_linux)
++#if defined(VG_PLAT_USES_PPCTOC) || defined(VGP_ppc64be_linux) \
++ || defined(VGP_ppc64le_linux)
+ static IRExpr* mkU8 ( UChar n ) {
+ return IRExpr_Const(IRConst_U8(n));
+ }
+@@ -1234,7 +1234,8 @@ static void gen_push_and_set_LR_R2 ( IRSB* bb, Addr new_R2_value )
+ }
+ #endif
+
+-#if defined(VG_PLAT_USES_PPCTOC) || defined(VGP_ppc64le_linux)
++#if defined(VG_PLAT_USES_PPCTOC) || defined(VGP_ppc64be_linux) \
++ || defined(VGP_ppc64le_linux)
+
+ static void gen_pop_R2_LR_then_bLR ( IRSB* bb )
+ {
+@@ -1263,7 +1264,8 @@ static void gen_pop_R2_LR_then_bLR ( IRSB* bb )
+ }
+ #endif
+
+-#if defined(VG_PLAT_USES_PPCTOC) || defined(VGP_ppc64le_linux)
++#if defined(VG_PLAT_USES_PPCTOC) || defined(VGP_ppc64be_linux) \
++ || defined(VGP_ppc64le_linux)
+
+ static
+ Bool mk_preamble__ppctoc_magic_return_stub ( void* closureV, IRSB* bb )
+@@ -1285,7 +1287,7 @@ Bool mk_preamble__ppctoc_magic_return_stub ( void* closureV, IRSB* bb )
+ }
+ #endif
+
+-#if defined(VGP_ppc64le_linux)
++#if defined(VGP_ppc64be_linux) || defined(VGP_ppc64le_linux)
+ /* Generate code to push LR and R2 onto this thread's redir stack.
+ Need to save R2 in case we redirect to a global entry point. The
+ value of R2 is not preserved when entering the global entry point.
+@@ -1366,9 +1368,7 @@ Bool mk_preamble__set_NRADDR_to_zero ( void* closureV, IRSB* bb )
+ gen_push_and_set_LR_R2 ( bb, VG_(get_tocptr)( VG_(current_DiEpoch)(),
+ closure->readdr ) );
+ }
+-# endif
+-
+-#if defined(VGP_ppc64le_linux)
++#elif defined(VGP_ppc64be_linux) || defined(VGP_ppc64le_linux)
+ VgCallbackClosure* closure = (VgCallbackClosure*)closureV;
+ Int offB_GPR12 = offsetof(VexGuestArchState, guest_GPR12);
+ addStmtToIRSB(bb, IRStmt_Put(offB_GPR12, mkU64(closure->readdr)));
+@@ -1424,7 +1424,6 @@ Bool mk_preamble__set_NRADDR_to_nraddr ( void* closureV, IRSB* bb )
+ );
+ gen_push_and_set_LR_R2 ( bb, VG_(get_tocptr)( closure->readdr ) );
+-# endif
+-#if defined(VGP_ppc64le_linux)
++#elif defined(VGP_ppc64be_linux) || defined(VGP_ppc64le_linux)
+ /* This saves the r2 before leaving the function. We need to move
+ * guest_NRADDR_GPR2 back to R2 on return.
+ */
+@@ -1648,7 +1647,8 @@ Bool VG_(translate) ( ThreadId tid,
+ preamble_fn = mk_preamble__set_NRADDR_to_nraddr;
+
+ /* LE we setup the LR */
+-# if defined(VG_PLAT_USES_PPCTOC) || defined(VGP_ppc64le_linux)
++# if defined(VG_PLAT_USES_PPCTOC) || defined(VGP_ppc64be_linux) \
++ || defined(VGP_ppc64le_linux)
+ if (nraddr == (Addr)&VG_(ppctoc_magic_redirect_return_stub)) {
+ /* If entering the special return stub, this means a wrapped or
+ redirected function is returning. Make this translation one
+@@ -1692,13 +1692,14 @@ Bool VG_(translate) ( ThreadId tid,
+ vex_abiinfo.guest_ppc_zap_RZ_at_bl = NULL;
+ # endif
+
+-# if defined(VGP_ppc64be_linux)
++# if defined(VGP_ppc64be_linux) && defined(VG_PLAT_USES_PPCTOC)
+ vex_abiinfo.guest_ppc_zap_RZ_at_blr = True;
+ vex_abiinfo.guest_ppc_zap_RZ_at_bl = const_True;
+ vex_abiinfo.host_ppc_calls_use_fndescrs = True;
+ # endif
+
+-# if defined(VGP_ppc64le_linux)
++# if (defined(VGP_ppc64be_linux) && !defined(VG_PLAT_USES_PPCTOC)) \
++ || defined(VGP_ppc64le_linux)
+ vex_abiinfo.guest_ppc_zap_RZ_at_blr = True;
+ vex_abiinfo.guest_ppc_zap_RZ_at_bl = const_True;
+ vex_abiinfo.host_ppc_calls_use_fndescrs = False;
+diff --git a/coregrind/m_ume/elf.c b/coregrind/m_ume/elf.c
+index 21eb52bcb..f1e6b4728 100644
+--- a/coregrind/m_ume/elf.c
++++ b/coregrind/m_ume/elf.c
+@@ -847,8 +847,8 @@ Int VG_(load_ELF)(Int fd, const HChar* name, /*MOD*/ExeInfo* info)
+ info->exe_base = minaddr + ebase;
+ info->exe_end = maxaddr + ebase;
+
+-#if defined(VGP_ppc64be_linux)
+- /* On PPC64BE, ELF ver 1, a func ptr is represented by a TOC entry ptr.
++#if defined(VGP_ppc64be_linux) && defined(VG_PLAT_USES_PPCTOC)
++ /* On PPC64, ELF ver 1, a func ptr is represented by a TOC entry ptr.
+ This TOC entry contains three words; the first word is the function
+ address, the second word is the TOC ptr (r2), and the third word
+ is the static chain value. */
+@@ -856,8 +856,8 @@ Int VG_(load_ELF)(Int fd, const HChar* name, /*MOD*/ExeInfo* info)
+ info->init_toc = ((ULong*)entry)[1];
+ info->init_ip += info->interp_offset;
+ info->init_toc += info->interp_offset;
+-#elif defined(VGP_ppc64le_linux)
+- /* On PPC64LE, ELF ver 2. API doesn't use a func ptr */
++#elif defined(VGP_ppc64be_linux) || defined(VGP_ppc64le_linux)
++ /* On PPC64, ELF ver 2. API doesn't use a func ptr */
+ info->init_ip = (Addr)entry;
+ info->init_toc = 0; /* meaningless on this platform */
+ #else
+diff --git a/coregrind/pub_core_machine.h b/coregrind/pub_core_machine.h
+index d6af843df..400148d57 100644
+--- a/coregrind/pub_core_machine.h
++++ b/coregrind/pub_core_machine.h
+@@ -60,12 +60,20 @@
+ # define VG_ELF_DATA2XXX ELFDATA2MSB
+ # define VG_ELF_MACHINE EM_PPC64
+ # define VG_ELF_CLASS ELFCLASS64
+-# define VG_PLAT_USES_PPCTOC 1
++# if !defined(_CALL_ELF) || _CALL_ELF == 1
++# define VG_PLAT_USES_PPCTOC 1
++# else
++# undef VG_PLAT_USES_PPCTOC
++# endif
+ #elif defined(VGP_ppc64le_linux)
+ # define VG_ELF_DATA2XXX ELFDATA2LSB
+ # define VG_ELF_MACHINE EM_PPC64
+ # define VG_ELF_CLASS ELFCLASS64
+-# undef VG_PLAT_USES_PPCTOC
++# if defined(_CALL_ELF) && _CALL_ELF == 1
++# define VG_PLAT_USES_PPCTOC 1
++# else // assume ELFv2 by default if no ABI is specified
++# undef VG_PLAT_USES_PPCTOC
++# endif
+ #elif defined(VGP_arm_linux)
+ # define VG_ELF_DATA2XXX ELFDATA2LSB
+ # define VG_ELF_MACHINE EM_ARM
+diff --git a/coregrind/vg_preloaded.c b/coregrind/vg_preloaded.c
+index ad033432a..f300fbe80 100644
+--- a/coregrind/vg_preloaded.c
++++ b/coregrind/vg_preloaded.c
+@@ -45,6 +45,7 @@
+ #include "pub_core_basics.h"
+ #include "pub_core_clreq.h"
+ #include "pub_core_debuginfo.h" // Needed for pub_core_redir.h
++#include "pub_core_machine.h" // For VG_PLAT_USES_PPCTOC
+ #include "pub_core_redir.h" // For VG_NOTIFY_ON_LOAD
+
+ #if defined(VGO_linux) || defined(VGO_solaris)
+@@ -103,7 +104,7 @@ void * VG_NOTIFY_ON_LOAD(ifunc_wrapper) (void)
+ VALGRIND_GET_ORIG_FN(fn);
+ CALL_FN_W_v(result, fn);
+
+-#if defined(VGP_ppc64be_linux)
++#if defined(VGP_ppc64be_linux) && defined(VG_PLAT_USES_PPCTOC)
+ /* ppc64be uses function descriptors, so get the actual function entry
+ address for the client request, but return the function descriptor
+ from this function.
+diff --git a/include/valgrind.h b/include/valgrind.h
+index 577c8f05e..99e058ccf 100644
+--- a/include/valgrind.h
++++ b/include/valgrind.h
+@@ -143,12 +143,20 @@
+ # define PLAT_amd64_linux 1
+ #elif defined(__linux__) && defined(__powerpc__) && !defined(__powerpc64__)
+ # define PLAT_ppc32_linux 1
+-#elif defined(__linux__) && defined(__powerpc__) && defined(__powerpc64__) && _CALL_ELF != 2
+-/* Big Endian uses ELF version 1 */
++#elif defined(__linux__) && defined(__powerpc__) && defined(__powerpc64__) && defined(__BIG_ENDIAN__)
+ # define PLAT_ppc64be_linux 1
+-#elif defined(__linux__) && defined(__powerpc__) && defined(__powerpc64__) && _CALL_ELF == 2
+-/* Little Endian uses ELF version 2 */
++# if _CALL_ELF == 2
++# define PLAT_ppc64_linux_abi2
++# else
++# define PLAT_ppc64_linux_abi1
++# endif
++#elif defined(__linux__) && defined(__powerpc__) && defined(__powerpc64__) && !defined(__BIG_ENDIAN__)
+ # define PLAT_ppc64le_linux 1
++# if _CALL_ELF == 2
++# define PLAT_ppc64_linux_abi2
++# else
++# define PLAT_ppc64_linux_abi1
++# endif
+ #elif defined(__linux__) && defined(__arm__) && !defined(__aarch64__)
+ # define PLAT_arm_linux 1
+ #elif defined(__linux__) && defined(__aarch64__) && !defined(__arm__)
+diff --git a/memcheck/mc_leakcheck.c b/memcheck/mc_leakcheck.c
+index 782244481..c239f5b10 100644
+--- a/memcheck/mc_leakcheck.c
++++ b/memcheck/mc_leakcheck.c
+@@ -653,7 +653,7 @@ static Bool aligned_ptr_above_page0_is_vtable_addr(Addr ptr)
+ if (pot_fn == 0)
+ continue; // NULL fn pointer. Seems it can happen in vtable.
+ seg = VG_(am_find_nsegment) (pot_fn);
+-#if defined(VGA_ppc64be)
++#if defined(VGA_ppc64be) && (!defined(_CALL_ELF) || _CALL_ELF == 1)
+ // ppc64BE uses a thunk table (function descriptors), so we have one
+ // more level of indirection to follow.
+ if (seg == NULL
+diff --git a/memcheck/mc_machine.c b/memcheck/mc_machine.c
+index 5ed101fca..70c64b361 100644
+--- a/memcheck/mc_machine.c
++++ b/memcheck/mc_machine.c
+@@ -132,7 +132,8 @@ static Int get_otrack_shadow_offset_wrk ( Int offset, Int szB )
+ return GOF(GPRn);
+ by testing ox instead of o, and setting ox back 4 bytes when sz == 4.
+ */
+-#if defined(VGA_ppc64le)
++#if (defined(VGA_ppc64be) && (defined(_CALL_ELF) && _CALL_ELF == 2)) \
++ || defined(VGA_ppc64le)
+ Int ox = o;
+ #else
+ Int ox = sz == 8 ? o : (o - 4);
+--
+2.18.0
+
diff --git a/user/valgrind/APKBUILD b/user/valgrind/APKBUILD
index 58ed29fa1..fcbd838d2 100644
--- a/user/valgrind/APKBUILD
+++ b/user/valgrind/APKBUILD
@@ -1,12 +1,12 @@
# Maintainer: A. Wilcox <awilfox@adelielinux.org>
pkgname=valgrind
pkgver=3.13.0
-pkgrel=1
+pkgrel=3
pkgdesc="A tool to help find memory-management problems in programs"
url="http://valgrind.org/"
arch="all"
license="GPL-2.0+"
-makedepends="autoconf automake libtool bash perl"
+makedepends="autoconf automake libtool bash perl cmd:which"
# from README_PACKAGERS:
# Don't strip the debug info off lib/valgrind/$platform/vgpreload*.so
# in the installation tree. Either Valgrind won't work at all, or it
@@ -17,9 +17,9 @@ subpackages="$pkgname-dev $pkgname-doc"
source="ftp://sourceware.org/pub/$pkgname/$pkgname-$pkgver.tar.bz2
uclibc.patch
arm.patch
- coregrind-elfv2.patch"
+ 0001-Ensure-ELFv2-is-supported-on-PPC64.patch
+ "
# musl-fixes.patch
-builddir="$srcdir"/$pkgname-$pkgver
prepare() {
default_prepare
@@ -67,4 +67,4 @@ package() {
sha512sums="34e1013cd3815d30a459b86220e871bb0a6209cc9e87af968f347083693779f022e986f211bdf1a5184ad7370cde12ff2cfca8099967ff94732970bd04a97009 valgrind-3.13.0.tar.bz2
d59a10db9037e120df2ee94a103402ca95a79abee9d8be63e4e1bca29c82dca775cc402a79b854ec11a2160a4d2da202c237369418e221d1925267ea2613fd5d uclibc.patch
9ee297d1b2b86891584443ad0caadc4977e1447979611ccf1cc55dbee61911b0b063bc4ad936d86c451cedae410cb3219b5a088b2ad0aa17df182d564fe36cfe arm.patch
-0f54b7b207870f495a0cf010b3091e2c0626bbf93b8a5ba7956b690981d4186de61f3e3b1fdc3aec2dfcacb69e712900f32c883a09dd4733c1e4569506272520 coregrind-elfv2.patch"
+71afb12748f69f0976a299c65572818b70cbce5d04f230a49a50f114351d8083c59a9e197cefbcb9145806797ff4d1d54488f50342b680c9a2b76e4a7f7cf305 0001-Ensure-ELFv2-is-supported-on-PPC64.patch"
diff --git a/user/valgrind/coregrind-elfv2.patch b/user/valgrind/coregrind-elfv2.patch
deleted file mode 100644
index 7e4a2d636..000000000
--- a/user/valgrind/coregrind-elfv2.patch
+++ /dev/null
@@ -1,443 +0,0 @@
-The LE and BE code here is the same, except the BE has the old-style
-function descriptor. So, we use the LE code on ELFv2 to fix build errors.
-
---- valgrind-3.13.0/coregrind/m_libcsetjmp.c 2017-05-31 10:14:45.000000000 -0500
-+++ valgrind-3.13.0/coregrind/m_libcsetjmp.c 2018-05-25 20:07:37.007835735 -0500
-@@ -149,7 +149,7 @@
-
- /* ------------ ppc64-linux ------------ */
-
--#if defined(VGP_ppc64be_linux)
-+#if defined(VGP_ppc64be_linux) && (!defined(_CALL_ELF) || _CALL_ELF == 1)
-
- __asm__(
- ".section \".toc\",\"aw\"" "\n"
-@@ -268,7 +268,8 @@
- ".previous" "\n"
- );
-
--#elif defined(VGP_ppc64le_linux)
-+#elif (defined(VGP_ppc64le_linux)) || \
-+ (defined(VGP_ppc64be_linux) && defined(_CALL_ELF) && _CALL_ELF == 2)
- __asm__(
- ".section \".toc\",\"aw\"" "\n"
-
---- valgrind-3.13.0/coregrind/m_main.c.old 2017-05-31 10:14:52.000000000 -0500
-+++ valgrind-3.13.0/coregrind/m_main.c 2018-05-30 19:01:00.534083618 -0500
-@@ -2585,7 +2585,7 @@
- "\ttrap\n"
- ".previous\n"
- );
--#elif defined(VGP_ppc64be_linux)
-+#elif defined(VGP_ppc64be_linux) && (!defined(_CALL_ELF) || _CALL_ELF == 1)
- asm("\n"
- /* PPC64 ELF ABI says '_start' points to a function descriptor.
- So we must have one, and that is what goes into the .opd section. */
-@@ -2631,9 +2631,9 @@
- "\tnop\n"
- "\ttrap\n"
- );
--#elif defined(VGP_ppc64le_linux)
--/* Little Endian uses ELF version 2 but in the future may also
-- * support other ELF versions.
-+#elif defined(VGP_ppc64le_linux) || \
-+ (defined(VGP_ppc64be_linux) && defined(_CALL_ELF) && _CALL_ELF == 2)
-+/* PowerPC 64 ELF version 2 does not use function descriptors.
- */
- asm("\n"
- "\t.align 2\n"
---- valgrind-3.13.0/coregrind/m_syscall.c.old 2017-05-31 10:14:29.000000000 -0500
-+++ valgrind-3.13.0/coregrind/m_syscall.c 2018-05-30 19:02:00.984023769 -0500
-@@ -470,7 +470,7 @@
- ".previous\n"
- );
-
--#elif defined(VGP_ppc64be_linux)
-+#elif defined(VGP_ppc64be_linux) && (!defined(_CALL_ELF) || _CALL_ELF == 1)
- /* Due to the need to return 65 bits of result, this is completely
- different from the ppc32 case. The single arg register points to a
- 7-word block containing the syscall # and the 6 args. The syscall
-@@ -506,7 +506,8 @@
- " blr\n"
- );
-
--#elif defined(VGP_ppc64le_linux)
-+#elif defined(VGP_ppc64le_linux) || \
-+ (defined(VGP_ppc64be_linux) && defined(_CALL_ELF) && _CALL_ELF == 2)
- /* Due to the need to return 65 bits of result, this is completely
- different from the ppc32 case. The single arg register points to a
- 7-word block containing the syscall # and the 6 args. The syscall
---- valgrind-3.13.0/coregrind/m_signals.c.old 2017-05-31 10:14:52.000000000 -0500
-+++ valgrind-3.13.0/coregrind/m_signals.c 2018-05-30 22:12:46.082692356 -0500
-@@ -889,7 +889,7 @@
- " sc\n" \
- ".previous\n"
-
--#elif defined(VGP_ppc64be_linux)
-+#elif defined(VGP_ppc64be_linux) && (!defined(_CALL_ELF) || _CALL_ELF == 1)
- # define _MY_SIGRETURN(name) \
- ".align 2\n" \
- ".globl my_sigreturn\n" \
-@@ -904,7 +904,8 @@
- " li 0, " #name "\n" \
- " sc\n"
-
--#elif defined(VGP_ppc64le_linux)
-+#elif defined(VGP_ppc64le_linux) || \
-+ (defined(VGP_ppc64be_linux) && defined(_CALL_ELF) && _CALL_ELF == 2)
- /* Little Endian supports ELF version 2. In the future, it may
- * support other versions.
- */
---- valgrind-3.13.0/coregrind/m_syswrap/syswrap-ppc64-linux.c.old 2017-05-31 10:14:39.000000000 -0500
-+++ valgrind-3.13.0/coregrind/m_syswrap/syswrap-ppc64-linux.c 2018-05-30 22:15:42.112518074 -0500
-@@ -71,12 +71,12 @@
- // r4 = retaddr
- // r5 = function descriptor
- // r6 = arg1
--/* On PPC64, a func ptr is represented by a TOC entry ptr.
-+/* On ELFv1, a func ptr is represented by a TOC entry ptr.
- This TOC entry contains three words; the first word is the function
- address, the second word is the TOC ptr (r2), and the third word is
- the static chain value. */
- asm(
--#if defined(VGP_ppc64be_linux)
-+#if defined(VGP_ppc64be_linux) && (!defined(_CALL_ELF) || _CALL_ELF == 1)
- " .align 2\n"
- " .globl vgModuleLocal_call_on_new_stack_0_1\n"
- " .section \".opd\",\"aw\"\n"
-@@ -126,7 +126,7 @@
- " bctr\n\t" // jump to dst
- " trap\n" // should never get here
- #else
--// ppc64le_linux
-+// ppc64le_linux, or ELFv2 ABI on BE
- " .align 2\n"
- " .globl vgModuleLocal_call_on_new_stack_0_1\n"
- "vgModuleLocal_call_on_new_stack_0_1:\n"
-@@ -211,7 +211,7 @@
-
- // See priv_syswrap-linux.h for arg profile.
- asm(
--#if defined(VGP_ppc64be_linux)
-+#if defined(VGP_ppc64be_linux) && (!defined(_CALL_ELF) || _CALL_ELF == 1)
- " .align 2\n"
- " .globl do_syscall_clone_ppc64_linux\n"
- " .section \".opd\",\"aw\"\n"
---- valgrind-3.13.0/coregrind/m_syswrap/syscall-ppc64be-linux.S.old 2017-05-31 10:14:39.000000000 -0500
-+++ valgrind-3.13.0/coregrind/m_syswrap/syscall-ppc64be-linux.S 2018-05-30 22:18:31.742350130 -0500
-@@ -29,7 +29,7 @@
-
- #include "pub_core_basics_asm.h"
-
--#if defined(VGP_ppc64be_linux)
-+#if defined(VGP_ppc64be_linux) || defined(VGP_ppc64le_linux)
-
- #include "pub_core_vkiscnums_asm.h"
- #include "libvex_guest_offsets.h"
-@@ -76,12 +76,25 @@
-
- .align 2
- .globl ML_(do_syscall_for_client_WRK)
-+#if _CALL_ELF == 2
-+.type .ML_(do_syscall_for_client_WRK),@function
-+ML_(do_syscall_for_client_WRK):
-+0: addis 2,12,.TOC.-0b@ha
-+ addi 2,2,.TOC.-0b@l
-+ .localentry ML_(do_syscall_for_client_WRK), .-ML_(do_syscall_for_client_WRK)
-+#else
- .section ".opd","aw"
- .align 3
--ML_(do_syscall_for_client_WRK):
-+ML_(do_syscall_for_client_WRK):
- .quad .ML_(do_syscall_for_client_WRK),.TOC.@tocbase,0
- .previous
--.type .ML_(do_syscall_for_client_WRK),@function
-+#endif
-+#if _CALL_ELF == 2
-+0: addis 2,12,.TOC.-0b@ha
-+ addi 2,2,.TOC.-0b@l
-+ .localentry ML_(do_syscall_for_client_WRK), .-ML_(do_syscall_for_client_WRK)
-+#endif
-+.type .ML_(do_syscall_for_client_WRK),@function
- .globl .ML_(do_syscall_for_client_WRK)
- .ML_(do_syscall_for_client_WRK):
- /* make a stack frame */
-@@ -145,7 +158,11 @@
- /* failure: return 0x8000 | error code */
- 7: ori 3,3,0x8000 /* FAILURE -- ensure return value is nonzero */
- b 5b
--
-+#if _CALL_ELF == 2
-+ .size .ML_(do_syscall_for_client_WRK),.-.ML_(do_syscall_for_client_WRK)
-+#else
-+ .size .ML_(do_syscall_for_client_WRK),.-.ML_(do_syscall_for_client_WRK)
-+#endif
- .section .rodata
- /* export the ranges so that
- VG_(fixup_guest_state_after_syscall_interrupted) can do the
-@@ -162,7 +179,7 @@
- ML_(blksys_committed): .quad 4b
- ML_(blksys_finished): .quad 5b
-
--#endif // defined(VGP_ppc64be_linux)
-+#endif // defined(VGP_ppc64le_linux)
-
- /* Let the linker know we don't need an executable stack */
- MARK_STACK_NO_EXEC
---- valgrind-3.13.0/coregrind/m_dispatch/dispatch-ppc64be-linux.S.old 2017-05-31 10:14:33.000000000 -0500
-+++ valgrind-3.13.0/coregrind/m_dispatch/dispatch-ppc64be-linux.S 2018-05-30 22:39:37.951096498 -0500
-@@ -30,12 +30,21 @@
-
- #include "pub_core_basics_asm.h"
-
--#if defined(VGP_ppc64be_linux)
-+#if defined(VGP_ppc64be_linux) || defined(VGP_ppc64le_linux)
-
- #include "pub_core_dispatch_asm.h"
- #include "pub_core_transtab_asm.h"
- #include "libvex_guest_offsets.h" /* for OFFSET_ppc64_CIA */
-
-+/* NOTE: PPC64 supports Big Endian and Little Endian. It also supports the
-+ ELF version 1 and ELF version 2 APIs.
-+
-+ Currently LE uses ELF version 2 and BE uses ELF version 1. However,
-+ BE and LE may support the other ELF version in the future. So, the
-+ _CALL_ELF is used in the assembly function to enable code for a
-+ specific ELF version independently of the endianness of the machine.
-+ The test "#if _CALL_ELF == 2" checks if ELF version 2 is being used.
-+*/
-
- /* References to globals via the TOC */
-
-@@ -75,14 +84,26 @@
- .section ".text"
- .align 2
- .globl VG_(disp_run_translations)
-+#if _CALL_ELF == 2
-+.type VG_(disp_run_translations),@function
-+VG_(disp_run_translations):
-+.type .VG_(disp_run_translations),@function
-+#else
- .section ".opd","aw"
- .align 3
- VG_(disp_run_translations):
- .quad .VG_(disp_run_translations),.TOC.@tocbase,0
- .previous
- .type .VG_(disp_run_translations),@function
-+#endif
- .globl .VG_(disp_run_translations)
- .VG_(disp_run_translations):
-+#if _CALL_ELF == 2
-+0: addis 2, 12,.TOC.-0b@ha
-+ addi 2,2,.TOC.-0b@l
-+ .localentry VG_(disp_run_translations), .-VG_(disp_run_translations)
-+#endif
-+
- /* r3 holds two_words */
- /* r4 holds guest_state */
- /* r5 holds host_addr */
-@@ -229,8 +250,13 @@
- /* make a stack frame for the code we are calling */
- stdu 1,-48(1)
-
-- /* Set up the guest state ptr */
-+ /* Set up the guest state ptr */
- mr 31,4 /* r31 (generated code gsp) = r4 */
-+#if _CALL_ELF == 2
-+/* for the LE ABI need to setup r2 and r12 */
-+0: addis 2, 12,.TOC.-0b@ha
-+ addi 2,2,.TOC.-0b@l
-+#endif
-
- /* and jump into the code cache. Chained translations in
- the code cache run, until for whatever reason, they can't
-@@ -385,6 +411,9 @@
- mtlr 0
- addi 1,1,624 /* stack_size */
- blr
-+#if _CALL_ELF == 2
-+ .size VG_(disp_run_translations),.-VG_(disp_run_translations)
-+#endif
-
-
- /*----------------------------------------------------*/
-@@ -395,15 +424,25 @@
- .section ".text"
- .align 2
- .globl VG_(disp_cp_chain_me_to_slowEP)
-- .section ".opd","aw"
-+#if _CALL_ELF == 2
-+ .type VG_(disp_cp_chain_me_to_slowEP),@function
-+ VG_(disp_cp_chain_me_to_slowEP):
-+#else
-+ .section ".opd","aw"
- .align 3
- VG_(disp_cp_chain_me_to_slowEP):
- .quad .VG_(disp_cp_chain_me_to_slowEP),.TOC.@tocbase,0
- .previous
-+#endif
- .type .VG_(disp_cp_chain_me_to_slowEP),@function
- .globl .VG_(disp_cp_chain_me_to_slowEP)
- .VG_(disp_cp_chain_me_to_slowEP):
-- /* We got called. The return address indicates
-+#if _CALL_ELF == 2
-+0: addis 2, 12,.TOC.-0b@ha
-+ addi 2,2,.TOC.-0b@l
-+ .localentry VG_(disp_cp_chain_me_to_slowEP), .-VG_(disp_cp_chain_me_to_slowEP)
-+#endif
-+ /* We got called. The return address indicates
- where the patching needs to happen. Collect
- the return address and, exit back to C land,
- handing the caller the pair (Chain_me_S, RA) */
-@@ -415,20 +454,33 @@
- */
- subi 7,7,20+4+4
- b .postamble
-+#if _CALL_ELF == 2
-+ .size VG_(disp_cp_chain_me_to_slowEP),.-VG_(disp_cp_chain_me_to_slowEP)
-+#endif
-
- /* ------ Chain me to fast entry point ------ */
- .section ".text"
- .align 2
- .globl VG_(disp_cp_chain_me_to_fastEP)
-- .section ".opd","aw"
-+#if _CALL_ELF == 2
-+ .type VG_(disp_cp_chain_me_to_fastEP),@function
-+VG_(disp_cp_chain_me_to_fastEP):
-+#else
-+ .section ".opd","aw"
- .align 3
- VG_(disp_cp_chain_me_to_fastEP):
- .quad .VG_(disp_cp_chain_me_to_fastEP),.TOC.@tocbase,0
- .previous
-+#endif
- .type .VG_(disp_cp_chain_me_to_fastEP),@function
- .globl .VG_(disp_cp_chain_me_to_fastEP)
- .VG_(disp_cp_chain_me_to_fastEP):
-- /* We got called. The return address indicates
-+#if _CALL_ELF == 2
-+0: addis 2, 12,.TOC.-0b@ha
-+ addi 2,2,.TOC.-0b@l
-+ .localentry VG_(disp_cp_chain_me_to_fastEP), .-VG_(disp_cp_chain_me_to_fastEP)
-+#endif
-+ /* We got called. The return address indicates
- where the patching needs to happen. Collect
- the return address and, exit back to C land,
- handing the caller the pair (Chain_me_S, RA) */
-@@ -440,20 +492,33 @@
- */
- subi 7,7,20+4+4
- b .postamble
-+#if _CALL_ELF == 2
-+ .size VG_(disp_cp_chain_me_to_fastEP),.-VG_(disp_cp_chain_me_to_fastEP)
-+#endif
-
- /* ------ Indirect but boring jump ------ */
- .section ".text"
- .align 2
- .globl VG_(disp_cp_xindir)
-- .section ".opd","aw"
-+#if _CALL_ELF == 2
-+ .type VG_(disp_cp_xindir),@function
-+VG_(disp_cp_xindir):
-+#else
-+ .section ".opd","aw"
- .align 3
- VG_(disp_cp_xindir):
- .quad .VG_(disp_cp_xindir),.TOC.@tocbase,0
- .previous
-+#endif
- .type .VG_(disp_cp_xindir),@function
- .globl .VG_(disp_cp_xindir)
- .VG_(disp_cp_xindir):
-- /* Where are we going? */
-+#if _CALL_ELF == 2
-+0: addis 2, 12,.TOC.-0b@ha
-+ addi 2,2,.TOC.-0b@l
-+ .localentry VG_(disp_cp_xindir), .-VG_(disp_cp_xindir)
-+#endif
-+ /* Where are we going? */
- ld 3,OFFSET_ppc64_CIA(31)
-
- /* stats only */
-@@ -479,6 +544,9 @@
- /* Found a match. Jump to .host. */
- mtctr 7
- bctr
-+#if _CALL_ELF == 2
-+ .size VG_(disp_cp_xindir),.-VG_(disp_cp_xindir)
-+#endif
-
- .fast_lookup_failed:
- /* stats only */
-@@ -496,39 +564,64 @@
- .section ".text"
- .align 2
- .globl VG_(disp_cp_xassisted)
-- .section ".opd","aw"
-+#if _CALL_ELF == 2
-+ .type VG_(disp_cp_xassisted),@function
-+VG_(disp_cp_xassisted):
-+#else
-+ .section ".opd","aw"
- .align 3
- VG_(disp_cp_xassisted):
- .quad .VG_(disp_cp_xassisted),.TOC.@tocbase,0
- .previous
-- .type .VG_(disp_cp_xassisted),@function
-+#endif
-+#if _CALL_ELF == 2
-+0: addis 2, 12,.TOC.-0b@ha
-+ addi 2,2,.TOC.-0b@l
-+ .localentry VG_(disp_cp_xassisted), .-VG_(disp_cp_xassisted)
-+#endif
-+ .type .VG_(disp_cp_xassisted),@function
- .globl .VG_(disp_cp_xassisted)
- .VG_(disp_cp_xassisted):
- /* r31 contains the TRC */
- mr 6,31
- li 7,0
- b .postamble
-+#if _CALL_ELF == 2
-+ .size VG_(disp_cp_xassisted),.-VG_(disp_cp_xassisted)
-+#endif
-
- /* ------ Event check failed ------ */
- .section ".text"
- .align 2
- .globl VG_(disp_cp_evcheck_fail)
-- .section ".opd","aw"
-+#if _CALL_ELF == 2
-+ .type VG_(disp_cp_evcheck_fail),@function
-+VG_(disp_cp_evcheck_fail):
-+#else
-+ .section ".opd","aw"
- .align 3
- VG_(disp_cp_evcheck_fail):
- .quad .VG_(disp_cp_evcheck_fail),.TOC.@tocbase,0
- .previous
-+#endif
-+#if _CALL_ELF == 2
-+0: addis 2, 12,.TOC.-0b@ha
-+ addi 2,2,.TOC.-0b@l
-+ .localentry VG_(disp_cp_evcheck_fail), .-VG_(disp_cp_evcheck_fail)
-+#endif
- .type .VG_(disp_cp_evcheck_fail),@function
- .globl .VG_(disp_cp_evcheck_fail)
- .VG_(disp_cp_evcheck_fail):
- li 6,VG_TRC_INNER_COUNTERZERO
- li 7,0
- b .postamble
-+#if _CALL_ELF == 2
-+ .size VG_(disp_cp_evcheck_fail),.-VG_(disp_cp_evcheck_fail)
-+#endif
-
--
- .size .VG_(disp_run_translations), .-.VG_(disp_run_translations)
-
--#endif // defined(VGP_ppc64be_linux)
-+#endif // defined(VGP_ppc64be_linux) || defined(VGP_ppc64le_linux)
-
- /* Let the linker know we don't need an executable stack */
- MARK_STACK_NO_EXEC
diff --git a/user/vlc/APKBUILD b/user/vlc/APKBUILD
index dea31e948..7db6632a1 100644
--- a/user/vlc/APKBUILD
+++ b/user/vlc/APKBUILD
@@ -3,7 +3,7 @@
# Maintainer: A. Wilcox <awilfox@adelielinux.org>
pkgname=vlc
pkgver=3.0.4
-pkgrel=0
+pkgrel=1
pkgdesc="Multi-platform MPEG, VCD/DVD, and DivX player"
triggers="vlc-libs.trigger=/usr/lib/vlc/plugins"
pkgusers="vlc"
diff --git a/user/xinput/APKBUILD b/user/xinput/APKBUILD
new file mode 100644
index 000000000..2cb5822fe
--- /dev/null
+++ b/user/xinput/APKBUILD
@@ -0,0 +1,33 @@
+# Contributor: Johannes Matheis <jomat+alpinebuild@jmt.gr>
+# Maintainer: Dan Theisen <djt@hxx.in>
+pkgname=xinput
+pkgver=1.6.2
+pkgrel=0
+pkgdesc="Utility to configure and test XInput devices"
+url="http://xorg.freedesktop.org/"
+arch="all"
+options="!check" # No test suite.
+license="X11"
+makedepends="util-macros libx11-dev libxext-dev libxi-dev libxrandr-dev
+ libxinerama-dev"
+subpackages="$pkgname-doc"
+source="http://www.x.org/archive/individual/app/$pkgname-$pkgver.tar.bz2"
+
+build() {
+ cd "$builddir"
+ ./configure \
+ --build=$CBUILD \
+ --host=$CHOST \
+ --prefix=/usr \
+ --sysconfdir=/etc \
+ --mandir=/usr/share/man \
+ --localstatedir=/var
+ make
+}
+
+package() {
+ cd "$builddir"
+ make DESTDIR="$pkgdir" install
+}
+
+sha512sums="dbef3a87dd47bb8c593f1305bea7978697a12434a4992584e4124d745bb366812366b44fc205159137a3db6f7b8338effd1b90641a194497b19159b9fd91939e xinput-1.6.2.tar.bz2"