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

Re: Bug#989399: nauty FTCBFS -- multiple reasons



Control: retitle -1 nauty: i386 baseline violation by using popcnt
Control: severity -1 serious
Control: tags -1 - patch

On Wed, Jun 02, 2021 at 09:59:23PM +0530, Nilesh Patra wrote:
> Nauty fails to cross build due to two reasons:
> 
> 1. It uses AC_RUN_IFELSE testing which cannot heppen during cross build
>    Simply replacing it by AC_LINK_IFELSE does the trick. Please find the
>    patch for this below, and consider applying

I'm sorry, but this is wrong on so many levels...

Replacing AC_RUN_IFELSE with AC_LINK_IFELSE only makes sense if the
result of the execution is not important. For this check however, it
really is. The check does not want to know whether the compiler supports
popcnt (which could be determined using AC_LINK_IFELSE), but whether the
CPU does and AC_LINK_IFELSE does not suffice here.

Unfortunately such opportunistic use of the popcnt instruction violates
the i386 baseline as it does not include SSE4 at this time. This is a
serious bug. For Debian, such detection is not appropriate. Debian
builds must pass --disable-popcnt for any-i386. If the package is deemed
unusable without such performance optimizations, it should at least
depend on the appropriate isa-support package likely sse4.2-support.

Since replacing AC_RUN_IFELSE with AC_LINK_IFELSE is not reasonable
here, another solution is required. The problem can be narrowed: The
check can be split into a compile and a separate run check. If the
popcnt instruction cannot be compiled (which likely happens for any !x86
system), the run check can be skipped. For x86 architectures there are
two reasonable approaches. One is providing explicit options for
instruction-selection. There already is --disable-popcnt. Skipping the
run check when either --disable-popcnt or --enable-popcnt is given would
be reasonable. Another option is introducing a cache variable using
AC_CACHE_CHECK.

I hope it's ok if I repurpose this bug for the i386 baseline violation.
Nilesh, can you file a new bug for the FTCBFS with a better patch?

Helmut


Reply to: