diff options
author | Brooks Davis <brooks@FreeBSD.org> | 2022-11-09 21:27:29 +0000 |
---|---|---|
committer | Brooks Davis <brooks@FreeBSD.org> | 2022-11-09 21:27:29 +0000 |
commit | f9809df4c15f6b0f3b0c5a236aa70374d9d1637c (patch) | |
tree | afa5f8807a9c83117ab513ae93dd8a6f6cfc692b | |
parent | 1b29ddc7040809062eb9486238276526758a8ca0 (diff) | |
download | ports-f9809df4c15f6b0f3b0c5a236aa70374d9d1637c.tar.gz ports-f9809df4c15f6b0f3b0c5a236aa70374d9d1637c.zip |
devel/ksh93: remove sbrk() use
ksh supports multiple sources of heap memory. Completely disable the
use of sbrk() as a memory source in favor of mmap(). This allows
compilation on aarch64 (and presumably riscv64).
Approved by: cy
Differential Revision: https://reviews.freebsd.org/D37312
-rw-r--r-- | shells/ksh93/Makefile | 5 | ||||
-rw-r--r-- | shells/ksh93/files/patch-src_lib_libast_vmalloc_vmbest.c | 25 |
2 files changed, 26 insertions, 4 deletions
diff --git a/shells/ksh93/Makefile b/shells/ksh93/Makefile index 438365ce743d..9814c5114408 100644 --- a/shells/ksh93/Makefile +++ b/shells/ksh93/Makefile @@ -14,7 +14,7 @@ PORTNAME= ksh93 DISTVERSION= 93u -PORTREVISION= 1 +PORTREVISION= 2 PORTEPOCH= 2 CATEGORIES= shells DIST_SUBDIR= ksh93 @@ -25,9 +25,6 @@ WWW= http://www.kornshell.com/ LICENSE= EPL -BROKEN_aarch64= Fails to compile: needs sbrk -BROKEN_riscv64= Fails to compile: needs sbrk - USES= compiler:c11 USE_GITHUB= yes diff --git a/shells/ksh93/files/patch-src_lib_libast_vmalloc_vmbest.c b/shells/ksh93/files/patch-src_lib_libast_vmalloc_vmbest.c new file mode 100644 index 000000000000..07cfd72b922c --- /dev/null +++ b/shells/ksh93/files/patch-src_lib_libast_vmalloc_vmbest.c @@ -0,0 +1,25 @@ +--- src/lib/libast/vmalloc/vmbest.c.orig ++++ src/lib/libast/vmalloc/vmbest.c +@@ -1169,6 +1169,7 @@ + } + #endif /* _mem_win32 */ + ++#undef _mem_sbrk + #if _mem_sbrk /* getting space via brk/sbrk - not concurrent-ready */ + static Void_t* sbrkmem(Void_t* caddr, size_t csize, size_t nsize) + { +@@ -1265,10 +1266,13 @@ + } + } + else if(nsize == 0) +- { Vmuchar_t *addr = (Vmuchar_t*)sbrk(0); ++ { ++#if 0 ++ Vmuchar_t *addr = (Vmuchar_t*)sbrk(0); + if(addr < (Vmuchar_t*)caddr ) /* in sbrk space */ + return NIL(Void_t*); + else ++#endif + { (void)munmap(caddr, csize); + return caddr; + } |