3 ms·
FreeBSD statically links LLVM into Clang faster build times (2020). (The difference is pretty marginal, but it's at least a percent or two faster.) So my /usr
by loeg 6y ago
FreeBSD statically links LLVM into Clang faster build times (2020). (The difference is pretty marginal, but it's at least a percent or two faster.) So my /usr/bin/clang is a 70 megabyte file.
The vast majority of the contents are r-x text (code) and r-- read-only data. I don't know if the kernel is capable of sharing read-only paged memory references or not.
- toast0 6y ago> I don't know if the kernel is capable of sharing read-only paged memory references or not. Any pages mapped from disk should be shared, as a consequence of the FreeBSD unified buffer cache; this is why if you write to a binary in-place with cp instead of unlinking first (like install), currently executing copies are changed, and usually crash :). Read-write program sections will be mapped so their changes are private though, so you get copy on write semantics. Trailing parts that aren't page sized will be copied into a full page, I think.
- loeg 6y ago> this is why if you write to a binary in-place with cp instead of unlinking first (like install), currently executing copies are changed, and usually crash This is not true, or no longer true: opening a running program's backing file with O_RDWR or O_WRONLY is prevented via the "writecount" mechanism (and vice versa: files being written cannot be executed).
- toast0 6y agoHmmm does that also apply to dynamic libraries? Now that I'm thinking about the fateful day, I pushed an updated library, not an executable. I'm guessing it was on FreeBSD 8.x, but it could have been 9.x.