-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FreeBSD 14] Build breaks on arm64: ld: error: undefined symbol: brk #1499
Comments
Thanks for bug report. So looking closer, looks like our mmap hooks simply assumes that FreeBSD can do sbrk and looks like perhaps 14.0 doesn't anymore. I.e. without even looking at config.h where we have indication of sbrk availability. I welcome patch to fix this. As for more general matter of not using sbrk. So, yes, in principle we should consider. But in practical terms, just doing our current version of mmap allocator will actually break large heap fragmentation unittest. Yes, this test's specific case is quite subtle, but it is one way to show that sbrk's built-in feature of allocating memory sequentially does give us substantial benefit. There is also potential for another benefit (and potential security downside) which is that brk area being immediately after bss makes certain TLB-miss effects cheaper. I.e. heap sitting closer (likely same pmd) to .bss/.data has possibly measurable performance benefit by having shorter page table walks. So, yes, I will accept patches and benchmarks towards doing mmap-only allocation, but we cannot simply amputate sbrk just yet. |
It looks like brk was just accidentally removed on ARM platforms on FreeBSD. |
Apparently some recent FreeBSDs occasionally lack brk. So our code which previously hard-coded that this OS has brk (which we use to implement hooked sbrk) fails to compile. Our configure scripts already detects sbrk, so we simply need to pay attention. Fixes github issue #1499
sbrk and brk have intentionally never been in a release of FreeBSD on arm64 since first released in 11.0 in 2016. |
brk isn't supposed to be used in general.
Version: 2.15
FreeBSD 14.0
The text was updated successfully, but these errors were encountered: