summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatt Parnell2019-05-10 11:32:41 -0500
committerMatt Parnell2019-05-10 11:32:41 -0500
commit1ab1c53de3995c354d0c799be1c3eddf0471fadc (patch)
tree95e0efbe4eb2e2b6aa0137cfdcae77462a84b74e
downloadaur-1ab1c53de3995c354d0c799be1c3eddf0471fadc.tar.gz
initial commit
-rw-r--r--.SRCINFO18
-rw-r--r--.gitignore5
-rw-r--r--PKGBUILD43
-rw-r--r--preload.sh5
4 files changed, 71 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..21b2ebc530dc
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,18 @@
+# Generated by mksrcinfo v8
+# Fri May 10 16:29:32 UTC 2019
+pkgbase = hardened-malloc-git
+ pkgdesc = Hardened allocator designed for modern systems.
+ pkgver = 371+b40ba97
+ pkgrel = 1
+ url = https://github.com/GrapheneOS/hardened_malloc
+ arch = i686
+ arch = x86_64
+ license = MIT
+ makedepends = git
+ source = git://github.com/GrapheneOS/hardened_malloc
+ source = preload.sh
+ sha256sums = SKIP
+ sha256sums = e6dbce7ac1d689fafbc94ffb17d8c4ae5271dd3580421828d35aac2c067b652d
+
+pkgname = hardened-malloc-git
+
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 000000000000..c275d04e82ee
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,5 @@
+hardened_malloc
+*.pkg.tar
+*.pkg.tar.xz
+pkg
+src
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..f074e62ab7e6
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,43 @@
+# Maintainer: Matt Parnell/ilikenwf <parwok@gmail.com>
+pkgname="hardened-malloc-git"
+pkgver=371+b40ba97
+pkgdesc="Hardened allocator designed for modern systems."
+url="https://github.com/GrapheneOS/hardened_malloc"
+license=("MIT")
+makedepends=("git")
+arch=("i686" "x86_64")
+pkgrel=1
+source=('git://github.com/GrapheneOS/hardened_malloc'
+ 'preload.sh')
+sha256sums=('SKIP'
+ 'e6dbce7ac1d689fafbc94ffb17d8c4ae5271dd3580421828d35aac2c067b652d')
+
+# compress the modules or not
+_compress="y"
+
+# don't compress the package - we're just going to uncompress during install in a moment
+PKGEXT='.pkg.tar'
+
+pkgver() {
+ cd "${srcdir}/hardened_malloc"
+ printf "%s+%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
+}
+
+build() {
+ cd "${srcdir}/hardened_malloc"
+
+ make
+}
+
+package() {
+ cd "${srcdir}/hardened_malloc"
+
+ mkdir -p "$pkgdir/usr/lib"
+ mkdir -p "$pkgdir/usr/bin"
+
+ install -D -m755 "libhardened_malloc.so" "$pkgdir/usr/lib"
+ install -D -m755 "$srcdir/preload.sh" "$pkgdir/usr/bin/hardened-malloc-preload"
+ install -D -m755 "calculate_waste.py" "$pkgdir/usr/bin/hardened-malloc-calculate-waste.py"
+
+ msg "Done."
+}
diff --git a/preload.sh b/preload.sh
new file mode 100644
index 000000000000..4a80d32c5ba7
--- /dev/null
+++ b/preload.sh
@@ -0,0 +1,5 @@
+#!/bin/bash
+
+[[ $LD_PRELOAD ]] && LD_PRELOAD+=" "
+export LD_PRELOAD+="/usr/lib/libhardened_malloc.so"
+exec "$@"