[Mesa-dev] [PATCH] util: import sha1 implementation from OpenBSD

Matt Turner mattst88 at gmail.com
Fri Jan 13 19:53:42 UTC 2017


On Fri, Jan 13, 2017 at 11:51 AM, Dylan Baker <dylan at pnwbakers.com> wrote:
> Quoting Emil Velikov (2017-01-13 08:51:31)
>> From: Emil Velikov <emil.velikov at collabora.com>
>>
>> At the moment we support 5+ different implementations each with varying
>> amount of bugs - from thread safely problems [1], to outright broken
>> implementation(s) [2]
>>
>> In order to accommodate these we have 150+ lines of configure script and
>> extra two configure toggles. Whist an actual implementation being
>> ~200loc and our current compat wrapping ~250.
>>
>> Let's not forget that different people use different code paths, thus
>> effectively makes it harder to test and debug since the default
>> implementation is automatically detected.
>>
>> To minimise all these lovely experiences, import the "100% Public
>> Domain" OpenBSD sha1 implementation. Clearly document any changes needed
>> to get building correctly, since many/most of those can be upstreamed
>> making future syncs easier.
>>
>> As an added bonus this will avoid all the 'fun' experiences trying to
>> integrate it with the Android and SCons builds.
>>
>> Bugzilla [1]: https://bugs.freedesktop.org/show_bug.cgi?id=94904
>> Bugzilla [2]: https://bugs.freedesktop.org/show_bug.cgi?id=97967
>> Cc: Mark Janes <mark.a.janes at intel.com>
>> Cc: Vinson Lee <vlee at freedesktop.org>
>> Cc: Tapani Pälli <tapani.palli at intel.com>
>> Cc: Jonathan Gray <jsg at jsg.id.au>
>> Signed-off-by: Emil Velikov <emil.velikov at collabora.com>
>> ---
>>  configure.ac                         | 161 +----------------------
>>  src/compiler/glsl/tests/cache_test.c |   5 -
>>  src/mesa/main/shaderapi.c            |   6 -
>>  src/util/Makefile.am                 |   3 -
>>  src/util/Makefile.sources            |   2 +
>>  src/util/SConscript                  |   5 -
>>  src/util/disk_cache.c                |   4 -
>>  src/util/disk_cache.h                |  42 ------
>>  src/util/mesa-sha1.c                 | 242 +----------------------------------
>>  src/util/sha1/README                 |  55 ++++++++
>>  src/util/sha1/sha1.c                 | 173 +++++++++++++++++++++++++
>>  src/util/sha1/sha1.h                 |  47 +++++++
>>  12 files changed, 279 insertions(+), 466 deletions(-)
>>  create mode 100644 src/util/sha1/README
>>  create mode 100644 src/util/sha1/sha1.c
>>  create mode 100644 src/util/sha1/sha1.h
>>
>> diff --git a/configure.ac b/configure.ac
>> index 459f3e8b0a..5772b378c7 100644
>> --- a/configure.ac
>> +++ b/configure.ac
>> @@ -9,7 +9,6 @@ dnl Copyright © 2009-2014 Jon TURNEY
>>  dnl Copyright © 2011-2012 Benjamin Franzke
>>  dnl Copyright © 2008-2014 David Airlie
>>  dnl Copyright © 2009-2013 Brian Paul
>> -dnl Copyright © 2003-2007 Keith Packard, Daniel Stone
>
> This change seems like a mistake?

Actually no, since that line was added in commit a24bdce46 which was
the import of all of the SHA1 configuration machinery from the
xserver.


More information about the mesa-dev mailing list