Package Details: hardened_malloc 11-1

Git Clone URL: https://aur.archlinux.org/hardened_malloc.git (read-only, click to copy)
Package Base: hardened_malloc
Description: Hardened allocator designed for modern systems
Upstream URL: https://github.com/GrapheneOS/hardened_malloc
Licenses: MIT
Provides: libhardened_malloc-light.so, libhardened_malloc.so
Submitter: thithib
Maintainer: thithib
Last Packager: thithib
Votes: 14
Popularity: 0.33
First Submitted: 2019-08-18 21:53 (UTC)
Last Updated: 2022-01-27 20:18 (UTC)

Latest Comments

thestinger commented on 2022-01-23 23:38 (UTC)

You should be able to remove CONFIG_WERROR=false for make test for version 11.

The flags for the library weren't meant to be inherited by the tests. Having environment variables exported for CFLAGS, etc. was causing them to get applied for the test Makefile too. That's now resolved.

mynacol commented on 2022-01-12 20:59 (UTC)

hardened_malloc 10 was just released. A new light build variant is included, which should be packaged by this project as well. See https://twitter.com/GrapheneOS/status/1481364976317120512

thithib commented on 2021-11-04 23:00 (UTC)

I sent a pull request to fix the test suite build issue and it's been merged: https://github.com/GrapheneOS/hardened_malloc/pull/151. I'll backport the patch and release a new version of the package.

rhlobo commented on 2021-07-20 08:16 (UTC)

In the PKGBUILD, inside the "check" function add the line:

CPPFLAGS=-I/usr/include

before the make command.

Sapiens commented on 2021-07-14 21:10 (UTC)

I have no experience with C. What do I need to do to properly set the CPPFLAGS to make the compilation succeed? Thanks!

moita commented on 2021-06-05 19:58 (UTC)

Thanks @thithib, setting CPPFLAGS allowed the check to succeed.

thithib commented on 2021-06-03 15:10 (UTC)

So I just hit the same problem as both of you after updating my makepkg configuration file and it turns out the compilation error happens when CPPFLAGS is not set, which I guess is somehow not OK for hardened_malloc's Makefile.

rando commented on 2021-05-23 10:32 (UTC)

Hi! I have exactly the same problem as @dreieck. I tried clearing the Yay cache to force a download of the sources, and the problem persists. @thithib, would you mind having a look? Thanks a lot for maintaining this package!

thithib commented on 2021-04-24 18:37 (UTC)

@dreieck That's weird, I just checked again and it works fine for me.

dreieck commented on 2021-04-24 12:56 (UTC)

Fails to check() for me:

[...]
cc   -g0 -march=x86-64 -mtune=native -O3 -pipe -fstack-protector --param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2 -fomit-frame-pointer -fPIC -std=c11 -O3 -flto -fPIC -fvisibility=hidden -fno-plt -fstack-clash-protection -fstack-protector-strong -pipe -Wall -Wextra -Wcast-align=strict -Wcast-qual -Wwrite-strings -march=native -Wmissing-prototypes -DSLAB_CANARY=true  -Wl,-L/[...]/hardened_malloc/src/hardened_malloc/test/simple-memory-corruption/../../,-R,/[...]/hardened_malloc/src/hardened_malloc/test/simple-memory-corruption/../../  invalid_free_protected.c  -lhardened_malloc -o invalid_free_protected
invalid_free_protected.c: In function ‘main’:
invalid_free_protected.c:9:48: error: ‘MAP_ANONYMOUS’ undeclared (first use in this function)
    9 |     char *p = mmap(NULL, 4096 * 16, PROT_NONE, MAP_ANONYMOUS|MAP_PRIVATE, -1, 0);
      |                                                ^~~~~~~~~~~~~
invalid_free_protected.c:9:48: note: each undeclared identifier is reported only once for each function it appears in
make[2]: *** [<builtin>: invalid_free_protected] Error 1
make[2]: Leaving directory '/[...]/hardened_malloc/src/hardened_malloc/test/simple-memory-corruption'
make[1]: *** [Makefile:21: all] Error 2
make[1]: Leaving directory '/[...]/hardened_malloc/src/hardened_malloc/test'
make: *** [Makefile:138: test] Error 2
==> ERROR: A failure occurred in check().
    Aborting...

thithib commented on 2019-09-30 21:09 (UTC)

Thanks @egrupled, I'll do that ;)

egrupled commented on 2019-09-27 12:20 (UTC)

Hi @thithib thx for packaging this. I have small feature request - could you use git tag instead of tarball and check gpg signature on it? Like below:

# Maintainer: Thibaut Sautereau (thithib) <thibaut at sautereau dot fr>

pkgname=hardened_malloc
pkgver=2
pkgrel=1
pkgdesc="Hardened allocator designed for modern systems"
arch=('x86_64')
url="https://github.com/GrapheneOS/hardened_malloc"
license=('MIT')
depends=('python' 'bash')
makedepends=('git')
conflicts=('hardened-malloc-git')
source=("git+https://github.com/GrapheneOS/hardened_malloc#tag=$pkgver?signed"
        'preload.sh')
sha256sums=('SKIP'
            'e6dbce7ac1d689fafbc94ffb17d8c4ae5271dd3580421828d35aac2c067b652d')
validpgpkeys=('65EEFE022108E2B708CBFCF7F9E712E59AF5F22A')

build() {
  cd "$pkgname"
  make
}

package() {
  cd "$pkgname"
  install -Dm755 --target-directory="$pkgdir/usr/lib" libhardened_malloc.so
  install -Dm755 "$srcdir/preload.sh" "$pkgdir/usr/bin/hardened_malloc_preload"
  install -Dm755 calculate_waste.py "$pkgdir/usr/bin/hardened_malloc_calculate_waste.py"
  install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

# vim:set ts=2 sw=2 et: