tech-pkg archive

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

Re: rapidfuzz failing 9.0 i386 2023Q2



Taylor R Campbell <campbell+netbsd-tech-pkg%mumble.net@localhost> writes:

>> Date: Mon, 03 Jul 2023 08:05:03 -0400
>> From: Greg Troxel <gdt%lexort.com@localhost>
>> 
>> And I can't say that declining to build avx2 is a bug, since pkgsrc
>> targets eiher i486 or i586.
>> 
>> I'll send you the full log, and happy to send it to anybody else.
>> 
>> But, I am thinking that we should just drop i386 from the avx2
>> conditional for PLIST.  I think it's only there because when fixing this
>> for "not x86" there was an assumption these files were generated on
>> "x86", rather than "architectures for which avx2 is guaranteed, meaning
>> x86_64".
>> 
>> So I'll try that and commit/pullup if it works.
>
> As far as I'm aware, AVX2 instructions should be available from 32-bit
> mode.  This kind of thing should generally be selected at run-time,
> not at compile-time, and certainly shouldn't depend on exactly which
> x86 CPU is in the machine building the package.

It's not about the build cpu at all.  pkgsrc uses the base compiler, and
on i386 NetBSD supports 486 and up, so the gcc config is:

  Target: i486--netbsdelf

and thus avx2 is not available.

> Now, if there's hand-written amd64 assembly that uses 64-bit general
> instructions as well as AVX2 instructions, yes, that won't work when
> MACHINE_ARCH is i386 -- but a priori, i386 does not imply no-AVX2.

The point is that i386 fails to imply avx2, and thus it can't just be
used.

It is totally fair to say that it should be probed for and used at
runtime, regardless of build target.  But it does not seem to do that.


Also, including mk/atomic64.mk adds -m586, but the don't-expect-avx
variant builds fine without that.




Right now, there are on the order of 500 failed packages in i386 bulk
builds for 2023Q2, and that's a big problem.  Failure to use avx2 on
i386 is a very minor problem.  So I'm going to commit a minimal change
"don't expect avx2" for i386 and request a pullup.


Then, if somebody wants to investigate runtime detection, have at it, as
long as:

  we get the same binary regardless of build cpu
  binary works on all cpus >= i486


Home | Main Index | Thread Index | Old Index