Skip to content

Link libiconv on macOS - #418

Merged
evanmiller merged 1 commit into
WizardMac:devfrom
hadley:macos-link-iconv
Oct 20, 2026
Merged

evanmiller merged 1 commit into
WizardMac:devfrom
hadley:macos-link-iconv

Conversation

@hadley

@hadley hadley commented Oct 20, 2026

Copy link
Copy Markdown
Contributor

馃 Written by AI 馃

On macOS, libtool links libreadstat with -undefined dynamic_lookup, and configure only adds -liconv for mingw/cygwin. The iconv symbols are therefore bound flat-namespace and resolve to NULL at runtime, so test_readstat segfaults on the first iconv_open() call. Seen on macOS 27.0.1 / Apple clang 21; presumably older macOS happened to have iconv loaded already.

libtool links shared libraries on Darwin with -undefined dynamic_lookup,
so without -liconv the iconv symbols are left unresolved and
iconv_open() is NULL at runtime (seen on macOS 27, where test_readstat
segfaults).
@evanmiller
evanmiller merged commit f36b3dd into WizardMac:dev Oct 20, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants