diff options
author | maya <maya@pkgsrc.org> | 2019-06-14 17:30:13 +0000 |
---|---|---|
committer | maya <maya@pkgsrc.org> | 2019-06-14 17:30:13 +0000 |
commit | 942d80c54c322d9f08a472dc80345b91c9a76a7f (patch) | |
tree | 4d117208bfe77fd7952e2c4d035147bba2ad8902 /lang | |
parent | 35b29cd2f0258e120e198b341f6e7b63f79fa0ce (diff) | |
download | pkgsrc-942d80c54c322d9f08a472dc80345b91c9a76a7f.tar.gz |
gprolog: avoid GCC optimizing calloc into an infinite loop.
Diffstat (limited to 'lang')
-rw-r--r-- | lang/gprolog/distinfo | 3 | ||||
-rw-r--r-- | lang/gprolog/patches/patch-src_EnginePl_dl__malloc.c | 19 |
2 files changed, 21 insertions, 1 deletions
diff --git a/lang/gprolog/distinfo b/lang/gprolog/distinfo index e04f2176cf9..c9c1965b823 100644 --- a/lang/gprolog/distinfo +++ b/lang/gprolog/distinfo @@ -1,6 +1,7 @@ -$NetBSD: distinfo,v 1.13 2015/11/03 22:50:36 agc Exp $ +$NetBSD: distinfo,v 1.14 2019/06/14 17:30:13 maya Exp $ SHA1 (gprolog-1.4.4.tar.gz) = 658b0efa5d916510dcddbbd980d90bc4d43a6e58 RMD160 (gprolog-1.4.4.tar.gz) = 081ad0e6a2edd47de63db79ab1dc65a0e0d341da SHA512 (gprolog-1.4.4.tar.gz) = b6227a06794d31162f2c790a025f7372a6676c1891a76e880d2152aeab6322d3341aeab85e11d9be6d97ff1c69801bee73fa3ea6b0659af61f55990a455dc212 Size (gprolog-1.4.4.tar.gz) = 3538152 bytes +SHA1 (patch-src_EnginePl_dl__malloc.c) = 6146a8af0a6d64eba8446fe21374b2cea7e39420 diff --git a/lang/gprolog/patches/patch-src_EnginePl_dl__malloc.c b/lang/gprolog/patches/patch-src_EnginePl_dl__malloc.c new file mode 100644 index 00000000000..cd5785a36ab --- /dev/null +++ b/lang/gprolog/patches/patch-src_EnginePl_dl__malloc.c @@ -0,0 +1,19 @@ +$NetBSD: patch-src_EnginePl_dl__malloc.c,v 1.1 2019/06/14 17:30:13 maya Exp $ + +(from editors/emacs20): +Work around bug in gcc 5.x that makes calloc into a call to itself, +resulting in an infinite loop. + +--- src/EnginePl/dl_malloc.c.orig 2013-04-15 07:24:10.000000000 +0000 ++++ src/EnginePl/dl_malloc.c +@@ -4773,6 +4773,10 @@ void* dlcalloc(size_t n_elements, size_t + req = MAX_SIZE_T; /* force downstream failure on overflow */ + } + mem = dlmalloc(req); ++#ifdef __GNUC__ ++/* Work around a gcc bug that converts calloc into a call to itself. */ ++ __asm volatile("" : "+r" (mem)); ++#endif + if (mem != 0 && calloc_must_clear(mem2chunk(mem))) + memset(mem, 0, req); + return mem; |