cat -l is needed during the installworld phase and other system's cat
don't support that flag. To avoid portability issues when compiling on
Linux/macOS (such as the the direct access to &fp->_mbstate), we
disable the entire multibyte support when building as a boostrap tool.
Details
- Reviewers
brooks emaste jhb - Commits
- rS356791: Allow building bin/cat on non-FreeBSD systems
Diff Detail
- Lint
Lint Passed - Unit
No Test Coverage - Build Status
Buildable 27536 Build 25760: arc lint + arc unit
Event Timeline
This patch was enough to make cat work enough to run installworld on Linux. But probably removing the whole wide stuff when not building for FreeBSD is better.
The other option here would be to write a small, portable build tool that take a file argument, opens and locks the file, and writes anything on stdin to the file until EOF.
This seems fine.
We got cat -l from NetBSD when I implemented the METALOG work. I do wonder if a dedicated (and easily bootstrapable) tool would make more sense.
I agree that a small separate tool would be nicer. I don't really have time to write one right now though. I'll wait before committing this until it's the last blocker for cross-building. Maybe by then I'll find some time to add a write_locked (or whatever name we want to choose) bootstrap tool.
I'll wait before committing this until it's the last blocker for cross-building.
In fact I think it's fine to commit this now, perhaps expanding the comment before main() mentioning the alternate path. We can always revert if the other approach makes it in.