Pádraig Brady <p...@draigbrady.com> writes:

> The attached 2 patches, add a new cpu-supports module,
> and updates the crc-x86_64 module to use it.
> This ensures that any users of the crc-x86_64 module
> will honor the GLIBC_TUNABLES environment variable.
> Specifically it will allow disabling of the hardware acceleration
> used by crc-x86_64 using:
>
>   export GLIBC_TUNABLES=glibc.cpu.hwcaps=-AVX
>
> Note this is a general mechanism provided by glibc
> to tune hardware acceleration within glibc and also
> determines what libs are loaded with its dynamic dispatch mechanism:
> On my "x86-64-v3" system for example:
...
> +      if ((GLIBC_TUNABLES = getenv ("GLIBC_TUNABLES")))
> +License:
> +GPL

Ouch.

The crc module is a low-level module that is used by libraries.  Getenv
can be a complicated function, and didn't use to be thread-safe
everywhere and GPL is not LGPL-compatible.  It seems unfortunate that
this change makes it harder to use the crc-x86_64 optimization from
these low-level libraries, not simpler, so I'll have to drop the
optimization and only use the core 'crc' module instead for these
usages.  Or merely vendor a static copy the ~20 lines of code for the
CRC implementation where this module started from...

/Simon

Attachment: signature.asc
Description: PGP signature

Reply via email to