brk(2) and sbrk(2) are obsolete system calls used for memory management. We would like to ship arm64 and risk-v without support for them. The first step is to find out how many ports break and what their usage pattern is. We've observed a few cases so far. The most common ones are calling sbrk(0) to attempt to see how much memory has been used (returning NULL would probably work for them) and using sbrk(XXX) to implement an allocator (a stub implementation that allocates a late range with mmap() underneath should be easy).
Exp-run results: http://package18.nyi.freebsd.org/build.html?mastername=headamd64PR207867-default&build=2016-03-10_09h47m15s 125 ports failed to build and 4150 ports were skipped You can sort the failed ports by "Skipped" in the web interface, the "biggest" are www/w3m lang/gcc graphics/graphviz lang/mono lang/guile2
Created attachment 168067 [details] Remove sbrk from devel/binutils Add a patch to stop using sbrk in devel/binutils
Created attachment 168068 [details] Patch to stop using sbrk in devel/boehm-gc Add a patch to stop using sbrk in devel/boehm-gc for w3m
Created attachment 168072 [details] Patch to remove use of sbrk in gcc48
We've made this change to arm64 and riscv. So far so good.