]> git.eshelyaron.com Git - emacs.git/commit
Avoid name clashes with static GnuTLS
authorPaul Eggert <eggert@cs.ucla.edu>
Sun, 20 Apr 2025 01:44:52 +0000 (18:44 -0700)
committerEshel Yaron <me@eshelyaron.com>
Mon, 21 Apr 2025 20:41:19 +0000 (22:41 +0200)
commitac24e1ec38093ab6d94516cc4cb1ad5122d4cc2e
tree63159c4bac655aae553d04318e46f37e4f9425a5
parent4174737fe7b59b2e680006c69c398f5af1b9932b
Avoid name clashes with static GnuTLS

Work around a bug in GnuTLS 3.7.11 and earlier: when built
statically, its mistakenly exports symbols hash_lookup and
hash_string, which collide with Emacs symbols of the same name,
preventing temacs from linking statically.  Problem reported by
Greg A. Woods (Bug#77476).

Because GnuTLS never uses hash_lookup or hash_string this issue
ordinarily doesn’t seem to prevent temacs from linking to GnuTLS
on GNU/Linux, as it’s linked dynamically and the dynamic linker
never needs to resolve references to either symbol.  However, I
suppose a clash or bug could occur even with dynamic linking if
Emacs later loads a module that uses either symbol.

Although GnuTLS should be fixed, Emacs should link statically to
current and older GnuTLS versions in the meantime, and it should
avoid potential problems with dynamic linking.  Renaming the two
clashing names is an easy way to do this.  For consistency with
the new name for hash_lookup, also rename hash_lookup_with_hash
and hash_lookup_get_hash.

* src/fns.c (hash_find_with_hash): Rename from hash_lookup_with_hash.
(hash_find): Rename from hash_lookup.
(hash_find_get_hash): Rename from hash_lookup_get_hash.
(hash_char_array): Rename from hash_string.
All uses changed.

(cherry picked from commit c8eed90eb4d0583dc3463edfad176b9d3f98d11f)
15 files changed:
src/bytecode.c
src/category.c
src/ccl.c
src/charset.c
src/charset.h
src/coding.h
src/composite.c
src/emacs-module.c
src/fns.c
src/image.c
src/json.c
src/lisp.h
src/lread.c
src/macfont.m
src/minibuf.c