giflib 6.1.1: Missing symbol
A library and utilities for processing GIFs
Brought to you by:
abadger1999,
esr
Actually, there are two problems:
1) the source file is not proerly versioned and lacks an extention.
2) the Makefile is missing a file. I get a missing symbol
/opt/local/var/macports/build/giflib6-9a26c042/work/compwrap/cc/usr/bin/clang -Os -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk -arch arm64 -std=gnu99 -fPIC -Wall -Os -dynamiclib -current_version 7.2.0 qprintf.o getarg.o -o libutil.dylib
Undefined symbols for architecture arm64:
"_GifErrorString", referenced from:
_PrintGifError in qprintf.o
ld: symbol(s) not found for architecture arm64
until I add gif_err.c to USOURCES
USOURCES = qprintf.c getarg.c gif_err.c
Which "source file" are you referring to? Can you suggest a specific change to fix the problem you're seeing? And what werer you tryong to build?
Pleae show me the command sequence,
Last edit: Eric S. Raymond 2026-03-10
As another data point, in Homebrew we also saw undefined symbols error in 6.1.2 release. This is specific to macOS builds and can be reproduced with a
make allin a fresh download of release tarball. Or isolated to specific problem target viamake libutil.dylib, e.g.Error is macOS ld default behavior. Original post mentioned one way of resolving, which was to provide symbol by duplicating object file in libutil.
An alternative is to change the default behavior by
-Wl,-undefined,dynamic_lookupor a more fine-grain-Wl,-U,_GifErrorString, e.g. withor
binary symbol table and linkage looks like:
A 3rd option is to link in
$(LIBGIFSO)instead:It is also possible to just not build
$(LIBUTILSO)given it isn't linked to any binaries or installed. So, in the current release, a workaround via Make variable override ismake all LIBUTILSO=No, the real problem is you have a crappy single-pass linker. The library builds just fine on systems without broken toolchains.
Last edit: Eric S. Raymond 2026-04-12