Project

General

Profile

Bug #4329

-liconv fails to link

Added by Martin Bednar over 7 years ago. Updated over 7 years ago.

Status:
Invalid
Priority:
Normal
Assignee:
-
Category:
Configuration
Target version:
-
Start date:
2017-04-22
Due date:
% Done:

0%

Estimated time:
Found in version:
4.2.1
Affected Versions:

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
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 '

History

#1

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 '

#2

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?

#3

Updated by Jaroslav Kysela over 7 years ago

This is a right configure output for libc based systems:

  checking for cc libiconv ...                      fail
#4

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...

#5

Updated by Jaroslav Kysela over 7 years ago

yes, iconv is mandatory for tvh.. see src/intlconv.c

#6

Updated by Jaroslav Kysela over 7 years ago

  • Status changed from New to Invalid
#7

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.

#8

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.

Also available in: Atom PDF