Bug 207867 - test removing brk and sbrk symbols
Summary: test removing brk and sbrk symbols
Status: Closed Overcome By Events
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Ports Framework (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Brooks Davis
URL: https://reviews.freebsd.org/D5600
Keywords:
Depends on: 208255 208995
Blocks:
  Show dependency treegraph
 
Reported: 2016-03-10 04:28 UTC by Brooks Davis
Modified: 2016-09-02 22:39 UTC (History)
2 users (show)

See Also:
brooks: exp-run?


Attachments
Remove sbrk from devel/binutils (362 bytes, patch)
2016-03-13 00:42 UTC, Andrew Turner
no flags Details | Diff
Patch to stop using sbrk in devel/boehm-gc (916 bytes, patch)
2016-03-13 01:03 UTC, Andrew Turner
no flags Details | Diff
Patch to remove use of sbrk in gcc48 (969 bytes, patch)
2016-03-13 04:22 UTC, Brooks Davis
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Brooks Davis freebsd_committer freebsd_triage 2016-03-10 04:28:19 UTC
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).
Comment 1 Antoine Brodin freebsd_committer freebsd_triage 2016-03-11 06:35:28 UTC
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
Comment 2 Andrew Turner freebsd_committer freebsd_triage 2016-03-13 00:42:06 UTC
Created attachment 168067 [details]
Remove sbrk from devel/binutils

Add a patch to stop using sbrk in devel/binutils
Comment 3 Andrew Turner freebsd_committer freebsd_triage 2016-03-13 01:03:45 UTC
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
Comment 4 Brooks Davis freebsd_committer freebsd_triage 2016-03-13 04:22:06 UTC
Created attachment 168072 [details]
Patch to remove use of sbrk in gcc48
Comment 5 Brooks Davis freebsd_committer freebsd_triage 2016-09-02 22:39:48 UTC
We've made this change to arm64 and riscv.  So far so good.