GrapheneOS / hardened_malloc

Hardened allocator designed for modern systems. It has integration into Android's Bionic libc and can be used externally with musl and glibc as a dynamic library for use on other Linux-based platforms. It will gain more portability / integration over time.
https://grapheneos.org/
MIT License
1.26k stars 96 forks source link

'__int128' is not supported on this target #156

Closed waja closed 2 years ago

waja commented 2 years ago

Hi,

your project is used in one or two docker images. Actually, I'm trying to implement multiarch support for those. Possible plattforms are:

Platforms: linux/amd64, linux/arm64, linux/riscv64, linux/ppc64le, linux/s390x, linux/386, linux/mips64le, linux/mips64, linux/arm/v7, linux/arm/v6

Actually I tried i386 and armv6 and building them failed:

#46 76.44 cc  -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 -Werror -Wmissing-prototypes  -D_GNU_SOURCE -I include -DCONFIG_SEAL_METADATA=false -DZERO_ON_FREE=true -DWRITE_AFTER_FREE_CHECK=true -DSLOT_RANDOMIZE=true -DSLAB_CANARY=true -DSLAB_QUARANTINE_RANDOM_LENGTH=1 -DSLAB_QUARANTINE_QUEUE_LENGTH=1 -DCONFIG_EXTENDED_SIZE_CLASSES=true -DCONFIG_LARGE_SIZE_CLASSES=true -DGUARD_SLABS_INTERVAL=1 -DGUARD_SIZE_DIVISOR=2 -DREGION_QUARANTINE_RANDOM_LENGTH=256 -DREGION_QUARANTINE_QUEUE_LENGTH=1024 -DREGION_QUARANTINE_SKIP_THRESHOLD=33554432  -DFREE_SLABS_QUARANTINE_RANDOM_LENGTH=32 -DCONFIG_CLASS_REGION_SIZE=34359738368  -DN_ARENA=4 -DCONFIG_STATS=false  -c -o chacha.o chacha.c
#46 78.93 In file included from chacha.h:4,
#46 78.93                  from chacha.c:5:
#46 78.93 util.h:41:18: error: '__int128' is not supported on this target
#46 78.93    41 | typedef unsigned __int128 u128;
#46 78.93       |                  ^~~~~~~~
#46 80.27 make: *** [<builtin>: chacha.o] Error 1

Building on a 64-bit arch seems to work fine.

It looks like libffi had similar issues:

https://github.com/libffi/libffi/pull/526 https://github.com/libffi/libffi/issues/531 https://github.com/libffi/libffi/pull/532 https://github.com/spack/spack/issues/16602 https://github.com/spack/spack/pull/17043

Maybe you can look into it, indeed there could also be a problem in how I try to setup things on 32 bit.

Many thank, Jan.

thestinger commented 2 years ago

hardened_malloc is only for 64-bit. That's the problem.

waja commented 2 years ago

Thanks!