summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorThibaut Sautereau2021-11-05 00:21:26 +0100
committerThibaut Sautereau2021-11-05 00:33:32 +0100
commitd757f2fefff5e768439a3a5219ec95b53652211b (patch)
tree090d2727310c9b00858927ecb4999fbb4dc7a5fb
parentfcaa6d2c3c6f79b81f921bf270ea02e1e25bfdf1 (diff)
downloadaur-d757f2fefff5e768439a3a5219ec95b53652211b.tar.gz
Backport patch to fix test suite build issue
This patch has been merged upstream: https://github.com/GrapheneOS/hardened_malloc/pull/151.
-rw-r--r--.SRCINFO5
-rw-r--r--0001-Fix-CPPFLAGS-in-test-Makefile.patch31
-rw-r--r--PKGBUILD12
3 files changed, 43 insertions, 5 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 2a6d9a95be2a..59b34512e9bc 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,7 +1,7 @@
pkgbase = hardened_malloc
pkgdesc = Hardened allocator designed for modern systems
pkgver = 8
- pkgrel = 1
+ pkgrel = 2
url = https://github.com/GrapheneOS/hardened_malloc
arch = x86_64
license = MIT
@@ -10,8 +10,9 @@ pkgbase = hardened_malloc
depends = gcc-libs
provides = libhardened_malloc.so
source = git+https://github.com/GrapheneOS/hardened_malloc#tag=8?signed
+ source = 0001-Fix-CPPFLAGS-in-test-Makefile.patch
validpgpkeys = 65EEFE022108E2B708CBFCF7F9E712E59AF5F22A
sha256sums = SKIP
+ sha256sums = 118692a4096a70401773def95be713f535ae04477e2eb73e59b03169d54ea635
pkgname = hardened_malloc
-
diff --git a/0001-Fix-CPPFLAGS-in-test-Makefile.patch b/0001-Fix-CPPFLAGS-in-test-Makefile.patch
new file mode 100644
index 000000000000..22dd89b67058
--- /dev/null
+++ b/0001-Fix-CPPFLAGS-in-test-Makefile.patch
@@ -0,0 +1,31 @@
+From a33d2ca97d119ef657207fc27248db4c3103531f Mon Sep 17 00:00:00 2001
+From: Thibaut Sautereau <thibaut@sautereau.fr>
+Date: Tue, 2 Nov 2021 20:22:05 +0100
+Subject: [PATCH] Fix CPPFLAGS in test Makefile
+
+In particular, the _GNU_SOURCE feature test macro needs to be set in
+order to correctly define mmap(2) flags such as MAP_ANONYMOUS.
+Otherwise, compilation of some test files fails when CPPFLAGS is not
+defined in the initial user environment, as Make then does not export it
+from the root Makefile to the sub-make.
+---
+ test/simple-memory-corruption/Makefile | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/test/simple-memory-corruption/Makefile b/test/simple-memory-corruption/Makefile
+index 609677e7e670..d217b4806565 100644
+--- a/test/simple-memory-corruption/Makefile
++++ b/test/simple-memory-corruption/Makefile
+@@ -6,7 +6,8 @@ ifeq (,$(filter $(CONFIG_SLAB_CANARY),true false))
+ $(error CONFIG_SLAB_CANARY must be true or false)
+ endif
+
+-CFLAGS += -DSLAB_CANARY=$(CONFIG_SLAB_CANARY)
++CPPFLAGS += -D_GNU_SOURCE \
++ -DSLAB_CANARY=$(CONFIG_SLAB_CANARY)
+
+ LDLIBS := -lhardened_malloc
+
+--
+2.33.1
+
diff --git a/PKGBUILD b/PKGBUILD
index fdf1ac4d382d..a7f44ceb3a34 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -2,7 +2,7 @@
pkgname=hardened_malloc
pkgver=8
-pkgrel=1
+pkgrel=2
pkgdesc="Hardened allocator designed for modern systems"
arch=('x86_64')
url="https://github.com/GrapheneOS/hardened_malloc"
@@ -11,10 +11,16 @@ depends=('gcc-libs')
makedepends=('git')
checkdepends=('python')
provides=('libhardened_malloc.so')
-source=("git+https://github.com/GrapheneOS/$pkgname#tag=$pkgver?signed")
-sha256sums=('SKIP')
+source=("git+https://github.com/GrapheneOS/$pkgname#tag=$pkgver?signed"
+ '0001-Fix-CPPFLAGS-in-test-Makefile.patch')
+sha256sums=('SKIP'
+ '118692a4096a70401773def95be713f535ae04477e2eb73e59b03169d54ea635')
validpgpkeys=('65EEFE022108E2B708CBFCF7F9E712E59AF5F22A') # Daniel Micay <danielmicay@gmail.com>
+prepare() {
+ patch --directory="$pkgname" --input="$srcdir/0001-Fix-CPPFLAGS-in-test-Makefile.patch" --strip=1
+}
+
build() {
cd "$pkgname"
make