Re: How to re-compile sshd for a 386
Greg Troxel <[email protected]> Sun, 03 Aug 2025 10:12:56 -0400
| Newsgroups | gmane.os.netbsd.ports.i386 |
|---|---|
| Message-ID | <[email protected]> |
Mark Ter Morshuizen <[email protected]> writes: > Hi, > > On 2025/08/01 16:04, Greg Troxel wrote; >> I think NetBSD 4 still uses build.sh. But I don't remember the late >> 2000s in that kind of detail, as I stopped using NetBSD 4 about 2010. > > There is indeed a build.sh. Trying to follow the NetBSD Guide I should > be able to do > > =C2=A0 ./build.sh list-arch > > but that fails / is not implemented here. > > It's not listed under "Other operations" if I do ./build.sh help. > > Also as per the guide I could do > > =C2=A0 $ ./build.sh -U -u -j2 -O ~/obj -m evbarm -a aarch64 release > > or in my case > > =C2=A0 $ ./build.sh -U -u -O ./obj -m i386 -a <somearch> release > > but I can't find what exactly to use instead of "<somearch>". > > Like, how do I build for 386, 486, Pentium, etc? There are two separate concepts: what system arch NetBSD is being built for (but there are aliases): this is sort of the basic CPU type but also stuff about how the machine is put together. examples are i386 (which is the entire family of 32-bit intel processors), amd64, evbarm (32-bit ARM), aarch64, vax, sparc, sparc64, etc. And there is macppc and evbppc what cpu type (MACHINE_ARCH) within a cpu type, what are the cpu flags, in terms of telling the compiler what instrucitons it may generate, and also some instructions are use in the very small amounts of assembler. For i386, there is the most complexity because i386 was the first 32-bit CPU with enough VM to really run Unix (in a normal way), and then 486, pentium, P6, and later things added instructions. Generally, -a (ARCH) controls -m (MACHINE_ARCH). Read the docs for build.sh and build.sh itself. Long ago, NetBSD targeted the base i386. Maybe assumed there was an i387 installed. I had an i387 in my computer in 1993 when I installed NetBSD 0.8. There were just barely 486s then, or not quite. Later, NetBSD increased the min CPU to i486. This basically is a decision to allow instructions that the 486 has, but are missing on i386. The rationale in general is that they help with efficiency and that ~nobody still uses actual i386. Except a few people that are engaging in retrocomputing which is cool and appreciated, but not a justification for slowing everybody else down. So if you just build -a i386, it should be ok for i386, or maybe i386/i387. You may need to add -msoftfloat (spelled correctly) to mk.conf. Or it might work emulated. IDK -- I haven't tried to use a computer without hw floating point for a wicked long time! If your build host is (modern) i386, then -m i386 isn't needed but it shouldn't hurt. =20