Skip to content

Fixing linking on macOS - iconv lib would not get picked up#260

Closed
mauritium wants to merge 1 commit intodovecot:mainfrom
mauritium:pr/bugfix-libiconv-linker
Closed

Fixing linking on macOS - iconv lib would not get picked up#260
mauritium wants to merge 1 commit intodovecot:mainfrom
mauritium:pr/bugfix-libiconv-linker

Conversation

@mauritium
Copy link

Fixing linking on macOS - iconv lib would not get picked up by linker, need to add -liconv explicitly where needed

@sirainen
Copy link
Contributor

This library isn't wanted/needed with Linux. So it should be somehow conditionally added by a configure check.

@mauritium
Copy link
Author

Aah, I didn't know that. Unfortunately, I have little knowledge of autoconf/automake. My first impression, however, is that src/lib-charset/charset-iconv.c is compiled unconditionally, and it includes `<iconv.h> unconditionally here:

#include <iconv.h>
. This means even on Linux? If there was a config flag for iconv, we could of course make it conditional, but I don't see it unfortunately :(

I regret this is beyond my expertise, and I also lack the context/background on what's needed for dovecot specifically.

The fact is, however, that in its current form the code fails to build on macOS because somehow iconv code is compiled but not linked with the iconv library.

@cmouse
Copy link
Contributor

cmouse commented Jan 14, 2026

We'll take a look on how to fix this.

@mauritium
Copy link
Author

Thanks! I notice that

#ifdef HAVE_ICONV
has a reference to HAVE_ICONV, but this does not seem to be defined anywhere.

@cmouse
Copy link
Contributor

cmouse commented Jan 21, 2026

@cmouse cmouse closed this Jan 21, 2026
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.

3 participants