pkgsrc-Users archive

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

Re: Failure to build go on some 32bit port-i386 machines



On Mon, Apr 29, 2024 at 05:21:36PM -0400, Greg Troxel wrote:
> "Jonathan A. Kollasch" <jakllsch%kollasch.net@localhost> writes:
> 
> > https://github.com/prometheus/node_exporter/issues/1568
> 
> I guess we should be doing some flavor of that.  I'm fuzzy because my
> oldest machine is now not so old (only about 20 years), but I think
> NetBSD/i386 supports 486 and up.  If so, pkgsrc should be fixing the
> upstream bug of having a newer default and targeting 486.

Grabbed the node_exporter binary package via pkgin and ran it on the
Alix (AMD Geode LX). Died with SIGILL. So I ran it under gdb until it
died (during early startup) and looked at the disassembly. It dies
on:
 0x08098c9b <+27>:    xorps  %xmm0,%xmm0

Now xorps is Bitwise Logical XOR for Single-FP Values and was apparently
introduced with the Pentium3, which is much newer than the i586 (OG
Pentium) baseline that the Geode was built to provide.

Which would explain this exploding on qemu with -cpu=pentium, but being
happy with -cpu=n270.

Testing with qemu 9.0.0 and -cpu=pentium3, NetBSD 10.0 and current
pkgsrc results in the go118 build exploding with SIGILL, specifically
lang/go118/work/go/pkg/tool/netbsd_386/go_bootstrap. Running under
gdb and disassembling yields:

=> 0x080a5a95 <+21>:    mfence 

and the mfence instruction was introduced with the Pentium4, so of
course it causes SIGILL on Pentium3.

So, it looks like golang on port-i386 class machines (aka 32bit Intel
and friends, which apparently goes down all the way to the i486) is
basically no-can-do except for the very latest 32bit Intel CPUs.

Short of flagging golang as "forget it on port-i386", does anybody
have any better ideas of making the golang toolchain actually work
on some of the more, *cough* ancient 32bit Intel CPUs?

Kind regards,
           Alex.
-- 
"Opportunity is missed by most people because it is dressed in overalls and
 looks like work."                                      -- Thomas A. Edison


Home | Main Index | Thread Index | Old Index