tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: changing the default i386 compilation target? sse2?





пт, 4 апр. 2025 г., 13:07 Hans Rosenfeld <hans%netbsd.org@localhost>:
On Wed, Apr 02, 2025 at 10:01:43AM -0400, Greg Troxel wrote:
> Recently a lot of rusty packages got marked as not building on i386
> because (if I followed) upstream insists on sse2.
>
> With x86_64, lots of extensions are always present, and are thus part of
> the base compiler target.
>
> With i386, I believe NetBSD targets i486, and thus no sse2.

OT:

Given that amd64 hit the market 22 years ago, I really wonder what
purpose the i386 port still serves other than supporting vintage
computers.

> While I think it's useful for pkgsrc to work on i386 in general, I am
> not sure if anyone is using an actual i486, or any hardware that is pre
> sse2.  I would not have said this 10 years ago.
>
> I note that mk/atomic.mk has:
>
>   .if ${MACHINE_ARCH} == "i386"
>   .  if empty(CFLAGS:M*march=*)
>   CFLAGS+=        -march=i586
>   .  endif
>   .endif
>
> which is basically saying that if a package is marked for atomic
> operations, it won't run on a true i486.  I have not seen any
> complaints.
>
> I therefore wonder:
>
>   Do any actual people use pkgsrc (2024Q4 or later) on a i386 cpu that
>   lacks pentium stuff and sse2?

Yes. I do run NetBSD 10 and pkgsrc on an AMD K6-2 system.

(I also keep a Pentium MMX (P55C), a Pentium Overdrive (P24T), a
486SLC2-66, and even a 386DX-40 around running NetBSD at least from time
to time. The latter two are currently well served by running 1.5 with a
small set of contemporary packages, but for the Pentiums moving to 10
and latest pkgsrc would be interesting, provided I can find the time to
do that and get X running on their old graphics chips.)

>   Should pkgsrc say that i386 means to compile for sse2, so that default
>   binary packages won't work on i486 (that nobody uses)?  (As I
>   understand it, sse2 arrived with Pentium 4, so ~all "i586" and various
>   "i686" processors lack sse2.)

That would limit pkgsrc on i386 to run pretty much only on the latest
32bit x86 CPUs, locking out a decade worth of CPUs that could still
reasonably run a significant subset of the packages provided by pkgsrc.

>   Should we have a mk/sse2.mk that flips this on, even if it isn't in
>   general?  That's an icky name so maybe some other way, but the point
>   is a declarative way to enable sse2 use and avoid a general failure,
>   making the failing case just on the very old hardware.

I guess that would mean all official pre-built packages will need sse2,
because the build systems used support it?

>   (Perhaps NetBSD should change i386 to mean sse2 or later, but that's
>   for another list, and having found that there are i686 w/o sse2, seems
>   premature; maybe in 2030.)

I tend to disagree with that. Actually, I think NetBSD/i386 should bring
back support for real 386 CPUs and 387 FPUs, given that by now IA32 is a
vintage architecture just like VAX, and is really only slightly more
modern. :)



branching in this direction I definitely recall ao486 (FPGA core for MiSTER like boards) and emulation in general - tend to nerf your cpu by 8 to 500 times!

https://misterfpga.org/viewtopic.php?t=8587&sid=ed330d43dac393e9fe882e8a8b2f151a

some advantage of i386 is that earlier C/c++ compilers can be used - much smaller than modern gcc targeting effectively aarch64 or whatever we tend to have handy (writing from android tablet).

tinycc is also c99 IIRC




Hans


--
%SYSTEM-F-ANARCHISM, The operating system has been overthrown


Home | Main Index | Thread Index | Old Index