Subject: bug#46111: closed (Re: bug#46111: Reverting fns.c hash function due to OpenBSD/SPARC64 compile breaking)

From: [email-masked] (GNU bug Tracking System)
Date: Thu, 28 Jan 2021 17:31:02 +0000

Your bug report

#46111: Reverting fns.c hash function due to OpenBSD/SPARC64 compile breaking

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
46111: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=46111
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#46111: Reverting fns.c hash function due to OpenBSD/SPARC64 compile breaking
From: Stefan Monnier <[email-masked]>
To: Eli Zaretskii <[email-masked]>
Cc: [email-masked], [email-masked]
Date: Thu, 28 Jan 2021 12:30:22 -0500
List-Id: <debbugs-submit.debbugs.gnu.org>

> AFAIK, memcpy itself optimizes: once it gets to aligned address, it
> starts copying words instead of bytes.

I don't know what this `memcpy` code expands to on sparc64, but since it
turns into a plain `mov` on x86, I simplified the code to always use
`memcpy`.

        Stefan

Subject: Reverting fns.c hash function due to OpenBSD/SPARC64 compile breaking
From: Ahmed Khanzada <[email-masked]>
To: [email-masked]
Date: Mon, 25 Jan 2021 22:37:53 -0800
List-Id: <debbugs-submit.debbugs.gnu.org>

I'm not an expert on C, OpenBSD, or SPARC64, but I did notice
emacs-current was not compiling.

During a gmake, bootstrap-emacs would get a SIGBUS and fail. Running
gdb led me to the hash_string function where it seemed to be failing.

Reverting the hash_string function to a previous version seems to have
fixed the issue.

If I had to guess, it may have something to do with SPARC64 alignment.

I don't have an updated AMD64 OpenBSD box running at the moment, but if you
would like me to test there, I could find a way.

I understand that reverting this function might not be the best way
forward, but wrote a patch just in case that reverts hash_string to an
earlier version that compiles on OpenBSD/SPARC64.

I am already signed all my GNU contributor docs.

--[[text/plain; type=patch; name="0001-Reverting-hash_string-function-due-to-problem-on-Ope.patch"
Content-Disposition: attachment; filename="0001-Reverting-hasattach filh_string-function-due-to-problem-on-Ope.patch"][base64]]