sync sh(1) with FreeBSD to 2020 version
sh(1) was untouched for 5 years, so there was quite a lot of work with it. Here's a set of commits that syncs our sh(1) with theirs.
The commit order directly reflects my workflow. Some of these commits could probably be squashed/reordered but I kept it this way to keep it simple and let others decide whether we need that many commits.
- [1/10] - nuke dfly's bin/sh and paste current FreeBSD
- [2/10] try to compile sh, see it fails on kill.c so I synced sync kill.c with FreeBSD
- [3/10] try to compile sh, see a compiler warning, spot a bug in kill.c, fix it
- [4/10] try to compile sh, see it fails on test.c, sync test.c with FreeBSD (7 years diff), my work got interrupted
- [5/10] try to compile sh, see it fails on printf.c, sync printf.c with FreeBSD
- [6/10] test.c does compile fine but it's not fully synced, so why not complete the sync
- [7/10] sh and its dependencies are fully synced, so we adapt sh's Makefile (we replaced dfly's Makefile with FreeBSD's) and a couple of source files until build passes. buildworld wasn't working on any of the commits [1/10]..[6/10]
- [8/10] Once we can buildworld, we start applying the dfly-specific changes present in our tree before I started the procedure. This is continued in [9/10]. I haven't synced all the dfly-specific Makefile changes at this stage because I couldn't figure this out.
- [9/10] A continuation of [8/10], but this time it's just a single patch ported back from the past. It has an extra #ifdef to silence compiler warning (and erroring) about an unused label in some cases.
- [10/10] In [8/10] I couldn't figure out how to use DFly's Makefile (and build optimizations), but this is solved now. We throw out FreeBSD's Makefile, put back DFly's Makefile together with pregenerated files and call it done.
checksums (can't have more than 10 attachments):