From owner-freebsd-ports@FreeBSD.ORG Sat Aug 17 22:34:33 2013 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id B60A2FC2; Sat, 17 Aug 2013 22:34:33 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (unknown [IPv6:2001:7b8:3a7:1:2d0:b7ff:fea0:8c26]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7903A2FA5; Sat, 17 Aug 2013 22:34:33 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7::ddd4:7f4b:3bda:d27d] (unknown [IPv6:2001:7b8:3a7:0:ddd4:7f4b:3bda:d27d]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 834BD5C43; Sun, 18 Aug 2013 00:34:26 +0200 (CEST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 6.5 \(1508\)) Subject: Re: svn commit: r254273 - in head: . include lib lib/libc/iconv lib/libiconv_compat lib/libkiconv share/mk sys/sys tools/build/mk From: Dimitry Andric In-Reply-To: <201308130715.r7D7F1nu076335@svn.freebsd.org> Date: Sun, 18 Aug 2013 00:34:30 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: <3887D7C7-D766-40DF-B154-D05768B86AA6@FreeBSD.org> References: <201308130715.r7D7F1nu076335@svn.freebsd.org> To: Peter Wemm X-Mailer: Apple Mail (2.1508) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, FreeBSD Ports X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Aug 2013 22:34:33 -0000 On Aug 13, 2013, at 09:15, Peter Wemm wrote: > Author: peter > Date: Tue Aug 13 07:15:01 2013 > New Revision: 254273 > URL: http://svnweb.freebsd.org/changeset/base/254273 >=20 > Log: > The iconv in libc did two things - implement the standard APIs, the = GNU > extensions and also tried to be link time compatible with ports = libiconv. > This splits that functionality and enables the parts that shouldn't > interfere with the port by default. >=20 > WITH_ICONV (now on by default) - adds iconv.h, iconv_open(3) etc. > WITH_LIBICONV_COMPAT (off by default) adds the libiconv_open etc API, = linker > symbols and even a stub libiconv.so.3 that are good enough to be able > to 'pkg delete -f libiconv' on a running system and reasonably expect = it > to work. >=20 > I have tortured many machines over the last few days to try and = reduce > the possibilities of foot-shooting as much as I can. I've = successfully > recompiled to enable and disable the libiconv_compat modes, ports = that use > libiconv alongside system iconv etc. If you don't enable the > WITH_LIBICONV_COMPAT switch, they don't share symbol space. >=20 > This is an extension of behavior on other system. iconv(3) is a = standard > libc interface and libiconv port expects to be able to run alongside = it on > systems that have it. Unfortunately I expect this will break many ports, when the libiconv port is installed. A simple example is the following: #include int main(void) { iconv_t ic =3D iconv_open("UTF-8", "ISO-8859-1"); iconv_close(ic); return 0; } If you compile this on a system after r254273 with -I/usr/local/include, and the libiconv port installed, it will result in: $ cc -I/usr/local/include iconv-test.c -o iconv-test /tmp/iconv-test-I1ltw1.o: In function `main': iconv-test.c:(.text+0x21): undefined reference to `libiconv_open' iconv-test.c:(.text+0x2f): undefined reference to `libiconv_close' cc: error: linker command failed with exit code 1 (use -v to see = invocation) This is because libiconv's iconv.h does: #define iconv_open libiconv_open ... #define iconv_close libiconv_close and so on for most of its functions. -Dimitry