From: Stuart Henderson Subject: Re: -current Haskell ports aborting with SIGILL To: Evan Silberman Cc: Greg Steuck , Greg Steuck , ports@openbsd.org, Antoine Jacoutot Date: Fri, 23 Feb 2024 19:45:18 +0000 oops, thanks - fix committed. On 2024/02/23 11:35, Evan Silberman wrote: > Stuart Henderson wrote: > > Index: patches/patch-libraries_text_cbits_measure_off_c > > =================================================================== > > RCS file: patches/patch-libraries_text_cbits_measure_off_c > > diff -N patches/patch-libraries_text_cbits_measure_off_c > > --- /dev/null 1 Jan 1970 00:00:00 -0000 > > +++ patches/patch-libraries_text_cbits_measure_off_c 21 Feb 2024 12:35:13 -0000 > > @@ -0,0 +1,23 @@ > > +Don't attempt to use avx512 kernels when the OS doesn't support them > > + > > +Index: libraries/text/cbits/measure_off.c > > +--- libraries/text/cbits/measure_off.c.orig > > ++++ libraries/text/cbits/measure_off.c > > +@@ -44,12 +44,16 @@ > > + bool has_avx512_vl_bw() { > > + #if (__GNUC__ >= 7 || __GNUC__ == 6 && __GNUC_MINOR__ >= 3) || defined(__clang_major__) > > + uint32_t eax = 0, ebx = 0, ecx = 0, edx = 0; > > ++ uint64_t xcr0; > > + __get_cpuid_count(7, 0, &eax, &ebx, &ecx, &edx); > > + // https://en.wikipedia.org/wiki/CPUID#EAX=7,_ECX=0:_Extended_Features > > ++ // __asm__("xgetbv\n\t" : "=a" (xcr0) : "c" (0)); > > Whoopsie daisy, looks like this committed with the __asm__ that actually > does the thing commented out. (Only spotted this because I sent the > patch upstream, cf https://github.com/haskell/text/pull/566) > > Evan