[Top][All Lists]

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

bug#35650: [PATCH] Improving HP-UX support

From: Paul Eggert
Subject: bug#35650: [PATCH] Improving HP-UX support
Date: Sat, 11 May 2019 16:45:00 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1

On 5/10/19 4:49 AM, Pádraig Brady wrote:
this file comes from blake2 upstream source on github,
so you might want to broach the change there.

I'll cc: this email to address@hidden to let them know about the problem (if you're just catching up you can see the thread at <https://bugs.gnu.org/35650>).

We shouldn't simply push this problem upstream to the BLAKE2 maintainers, as the BLAKE2 code is now in coreutils and if it breaks a build then it's our responsibility to fix it. So for now I installed the attached patch into coreutils, which I hope works around the BLAKE2 code's problem.

The underlying problem is that the reference code's definition of the BLAKE2_PACKED macro assumes that the compiler is compatible with either GCC or with Microsoft's C compiler, and HP-UX aCC is neither. As far as I can see, for blake2.h on typical current platforms, there is no need to use __attribute__ ((oacked)) or the Microsoft equivalent because the data structure is already packed well enough, so the attached patch simply skips the attribute unless we know that it will work.

I also noticed that the BLAKE2 code is not portable code according to either POSIX or to the C standard, since it assumes types like uint64_t that both standards say are optional. If that's OK with the BLAKE2 maintainers then the attached patch should suffice, as it should be "good enough" for most common platforms. If you want the code to be portable, you'll need to arrange for it to pack and unpack by hand, at least on platforms that don't support a packed attribute and/or don't support types like uint64_t.

Attachment: 0001-b2sum-port-to-HP-UX-C.txt
Description: Text document

reply via email to

[Prev in Thread] Current Thread [Next in Thread]