Bug #4329
-liconv fails to link
0%
Description
Under linux, iconv is part of libc, and adding -liconv to LDFLAGS makes linking fail.
Under Gentoo, I hackishly patched the build to make the iconv configure test pass:
--- a/Makefile
++ b/Makefile@ -59,9 +59,6
@ else
LDFLAGS += ldl -lpthread -lm a/configure
endif
LDFLAGS += -pie -Wl,-z,now
-ifeq ($(CONFIG_LIBICONV),yes)
-LDFLAGS += -liconv
-endif
ifeq ($(PLATFORM), darwin)
LDFLAGS += -framework CoreServices
else
diff --git a/configure b/configure
index 3a266ed..bc4cf8e 100755
--
++ b/configure@ -259,7 +259,7
@ int test(void)
iconv_t ic = iconv_open("ASCII", "ASCII");
return 0;
}
-' -liconv
+'
if enabled_or_auto dvben50221; then
check_cc_snippet libdvben50221 '
History
Updated by Martin Bednar over 7 years ago
patch with pre tags :
--- a/Makefile +++ b/Makefile @@ -59,9 +59,6 @@ else LDFLAGS += -ldl -lpthread -lm endif LDFLAGS += -pie -Wl,-z,now -ifeq ($(CONFIG_LIBICONV),yes) -LDFLAGS += -liconv -endif ifeq ($(PLATFORM), darwin) LDFLAGS += -framework CoreServices else diff --git a/configure b/configure index 3a266ed..bc4cf8e 100755 --- a/configure +++ b/configure @@ -259,7 +259,7 @@ int test(void) iconv_t ic = iconv_open("ASCII", "ASCII"); return 0; } -' -liconv +' if enabled_or_auto dvben50221; then check_cc_snippet libdvben50221 '
Updated by Jaroslav Kysela over 7 years ago
This is a wrong fix. The 'configure' script should detect the iconv library:
check_cc_snippet libiconv ' #include <iconv.h> int test(void) { iconv_t ic = iconv_open("ASCII", "ASCII"); return 0; } ' -liconv
Could you check why check_cc_snippet does not fail in your system?
Updated by Jaroslav Kysela over 7 years ago
This is a right configure output for libc based systems:
checking for cc libiconv ... fail
Updated by Martin Bednar over 7 years ago
So even though the libiconv test fails (mine is a glibc system), iconv is used ( or something else for format conversions)?
Sorry to be nitpicking, I just want to package it right...
Updated by saen acro over 7 years ago
Jaroslav Kysela wrote:
yes, iconv is mandatory for tvh.. see src/intlconv.c
What is idea of function duplication of libraries?
Better to change result message in configure.
Updated by Jaroslav Kysela over 7 years ago
The configuration output is correct libiconv means external iconv library, the build-in iconv in libc is a different thing.