On Fri 03/03/2023 01:55, Theo Buehler wrote:
> zstd is broken on sparc64 due to unaligned accesses resulting in bus
> errors. Since __GNUC__ is defined and MEM_FORCE_MEMORY_ACCESS isn't
> defined, it defaults to 1, and we run into these:
>
> https://github.com/facebook/zstd/blob/1be95291a89160be121c987c2e385331a65a4a0e/lib/common/mem.h#L192-L199
>
> One simple fix is to define MEM_FORCE_MEMORY_ACCESS to 0 via CPPFLAGS.
> This forces all platforms to use memcpy, which may or may not result in
> some slowdown. We can consider more elaborate platform-specific fixes if
> that is desired, but then I need instructions.
>
> With this diff, the cmake test for zstd doesn't abort with a bus error,
> which allows me to build qt6/qtbase on sparc64, and in turn we should
> get a sizable chunk of the tree back to building.
I did some light benchmarking using your patch and first impression,
i.e. looking at the numbers, is that there is no slow dowm. I did *not*
perform statistical analysis to underpin this observation.
That said I have a slight preference for making this change platform
specific, and tested https://pbot.rmdir.de/9-6H2Qy6ah89TpUnMYCzeg.
OK for the latter.
No comments:
Post a Comment