From tijl@coosemans.org  Mon Feb 17 15:41:20 2014
Return-Path: <tijl@coosemans.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 ESMTPS id D4C0390A
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 17 Feb 2014 15:41:20 +0000 (UTC)
Received: from mailrelay004.isp.belgacom.be (mailrelay004.isp.belgacom.be [195.238.6.170])
	by mx1.freebsd.org (Postfix) with ESMTP id 6E7FA1FD1
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 17 Feb 2014 15:41:19 +0000 (UTC)
Received: from 103.139-176-91.adsl-dyn.isp.belgacom.be (HELO kalimero.tijl.coosemans.org) ([91.176.139.103])
  by relay.skynet.be with ESMTP; 17 Feb 2014 16:41:12 +0100
Received: from kalimero.tijl.coosemans.org (kalimero.tijl.coosemans.org [127.0.0.1])
	by kalimero.tijl.coosemans.org (8.14.8/8.14.8) with ESMTP id s1HFfBwR019335
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO)
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 17 Feb 2014 16:41:11 +0100 (CET)
	(envelope-from tijl@kalimero.tijl.coosemans.org)
Received: (from tijl@localhost)
	by kalimero.tijl.coosemans.org (8.14.8/8.14.8/Submit) id s1HFfBsH019334;
	Mon, 17 Feb 2014 16:41:11 +0100 (CET)
	(envelope-from tijl)
Message-Id: <201402171541.s1HFfBsH019334@kalimero.tijl.coosemans.org>
Date: Mon, 17 Feb 2014 16:41:11 +0100 (CET)
From: Tijl Coosemans <tijl@FreeBSD.org>
Reply-To: Tijl Coosemans <tijl@FreeBSD.org>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: [patch] converters/libiconv: compilation with -Oz broken
X-Send-Pr-Version: 3.114
X-GNATS-Notify:

>Number:         186846
>Category:       ports
>Synopsis:       [patch] converters/libiconv: compilation with -Oz broken
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    gnome
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Mon Feb 17 15:50:01 UTC 2014
>Closed-Date:    Sun Mar 23 14:39:41 CET 2014
>Last-Modified:  Sun Mar 23 14:39:41 CET 2014
>Originator:     Tijl Coosemans
>Release:        FreeBSD 11.0-CURRENT i386
>Organization:
>Environment:
>Description:
Compilation is currently broken with clang and "env CFLAGS=-Oz make".

libtool: link: cc -Oz -fno-strict-aliasing iconv_no_i18n.o -o .libs/iconv_no_i18
n  ../srclib/libicrt.a ../lib/.libs/libiconv.so -Wl,-rpath -Wl,/usr/local/lib
../lib/.libs/libiconv.so: undefined reference to `aliases2_lookup'
cc: error: linker command failed with exit code 1 (use -v to see invocation)
*** Error code 1

aliases2_lookup is an inline function that isn't inlined with -Oz so it
must be exported, meaning the code expects gnu89 semantics for the inline
keyword.

The patch below also enables -fvisibility=hidden and adds a patch to keep
some symbols like iconv_open visible.  It was disabled because it caused
these symbols to be hidden:
http://www.marcuscom.com:8080/cgi-bin/cvsweb.cgi/ports/converters/libiconv/Attic/Makefile?rev=1.2&content-type=text/x-cvsweb-markup
>How-To-Repeat:
>Fix:

--- libiconv.patch begins here ---
Index: converters/libiconv/Makefile
===================================================================
--- converters/libiconv/Makefile	(revision 344709)
+++ converters/libiconv/Makefile	(working copy)
@@ -3,21 +3,21 @@
 
 PORTNAME=	libiconv
 PORTVERSION=	1.14
-PORTREVISION=	1
+PORTREVISION=	2
 CATEGORIES=	converters devel
 MASTER_SITES=	GNU
 
 MAINTAINER=	gnome@FreeBSD.org
-COMMENT=	A character set conversion library
+COMMENT=	Character set conversion library
 
 GNU_CONFIGURE=	yes
 CONFIGURE_ARGS=	--enable-static \
 		--without-libintl-prefix \
 		--docdir=${DOCSDIR}
-CONFIGURE_ENV=	gl_cv_cc_visibility="no" \
-		am_cv_func_iconv="yes" \
+CONFIGURE_ENV=	am_cv_func_iconv="yes" \
 		am_cv_proto_iconv_arg1="const"
 MAKE_JOBS_UNSAFE=	yes
+USE_CSTD=	gnu89
 USE_LDCONFIG=	yes
 
 OPTIONS_DEFINE=	ENCODINGS PATCHES
Index: converters/libiconv/files/patch-lib-iconv.c
===================================================================
--- converters/libiconv/files/patch-lib-iconv.c	(revision 0)
+++ converters/libiconv/files/patch-lib-iconv.c	(working copy)
@@ -0,0 +1,11 @@
+--- lib/iconv.c.orig
++++ lib/iconv.c
+@@ -598,7 +598,7 @@
+    It wants to define the symbols 'iconv_open', 'iconv', 'iconv_close'.  */
+ #define strong_alias(name, aliasname) _strong_alias(name, aliasname)
+ #define _strong_alias(name, aliasname) \
+-  extern __typeof (name) aliasname __attribute__ ((alias (#name)));
++  extern LIBICONV_DLL_EXPORTED __typeof (name) aliasname __attribute__ ((alias (#name)));
+ #undef iconv_open
+ #undef iconv
+ #undef iconv_close

Property changes on: converters/libiconv/files/patch-lib-iconv.c
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: fbsd:nokeywords
## -0,0 +1 ##
+yes
\ No newline at end of property
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
--- libiconv.patch ends here ---

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->gnome 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Mon Feb 17 15:50:10 UTC 2014 
Responsible-Changed-Why:  
Over to maintainer (via the GNATS Auto Assign Tool) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=186846 

From: Tijl Coosemans <tijl@FreeBSD.org>
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/186846: [patch] converters/libiconv: compilation with -Oz
 broken
Date: Wed, 19 Feb 2014 19:32:28 +0100

 --MP_/a1dP7fDT.6pF01Msx5erdEj
 Content-Type: text/plain; charset=US-ASCII
 Content-Transfer-Encoding: 7bit
 Content-Disposition: inline
 
 Updated patch which adds a DOCS option and includes changes from
 http://www.freebsd.org/cgi/query-pr.cgi?pr=186590
 --MP_/a1dP7fDT.6pF01Msx5erdEj
 Content-Type: text/x-patch
 Content-Transfer-Encoding: 7bit
 Content-Disposition: attachment; filename=libiconv.patch
 
 Index: converters/libiconv/Makefile
 ===================================================================
 --- converters/libiconv/Makefile	(revision 345014)
 +++ converters/libiconv/Makefile	(working copy)
 @@ -3,24 +3,24 @@
  
  PORTNAME=	libiconv
  PORTVERSION=	1.14
 -PORTREVISION=	1
 +PORTREVISION=	2
  CATEGORIES=	converters devel
  MASTER_SITES=	GNU
  
  MAINTAINER=	gnome@FreeBSD.org
 -COMMENT=	A character set conversion library
 +COMMENT=	Character set conversion library
  
  GNU_CONFIGURE=	yes
  CONFIGURE_ARGS=	--enable-static \
  		--without-libintl-prefix \
  		--docdir=${DOCSDIR}
 -CONFIGURE_ENV=	gl_cv_cc_visibility="no" \
 -		am_cv_func_iconv="yes" \
 +CONFIGURE_ENV=	am_cv_func_iconv="yes" \
  		am_cv_proto_iconv_arg1="const"
  MAKE_JOBS_UNSAFE=	yes
 +USE_CSTD=	gnu89
  USE_LDCONFIG=	yes
  
 -OPTIONS_DEFINE=	ENCODINGS PATCHES
 +OPTIONS_DEFINE=	DOCS ENCODINGS PATCHES
  OPTIONS_DEFAULT=ENCODINGS
  ENCODINGS_DESC=	Include extra character sets
  PATCHES_DESC=	Apply patches to fix CP932, add EUCJP-MS
 Index: converters/libiconv/files/patch-lib-iconv.c
 ===================================================================
 --- converters/libiconv/files/patch-lib-iconv.c	(revision 0)
 +++ converters/libiconv/files/patch-lib-iconv.c	(working copy)
 @@ -0,0 +1,11 @@
 +--- lib/iconv.c.orig
 ++++ lib/iconv.c
 +@@ -598,7 +598,7 @@
 +    It wants to define the symbols 'iconv_open', 'iconv', 'iconv_close'.  */
 + #define strong_alias(name, aliasname) _strong_alias(name, aliasname)
 + #define _strong_alias(name, aliasname) \
 +-  extern __typeof (name) aliasname __attribute__ ((alias (#name)));
 ++  extern LIBICONV_DLL_EXPORTED __typeof (name) aliasname __attribute__ ((alias (#name)));
 + #undef iconv_open
 + #undef iconv
 + #undef iconv_close
 
 Property changes on: converters/libiconv/files/patch-lib-iconv.c
 ___________________________________________________________________
 Added: fbsd:nokeywords
 ## -0,0 +1 ##
 +yes
 \ No newline at end of property
 Added: svn:eol-style
 ## -0,0 +1 ##
 +native
 \ No newline at end of property
 Added: svn:mime-type
 ## -0,0 +1 ##
 +text/plain
 \ No newline at end of property
 Index: converters/libiconv/pkg-plist
 ===================================================================
 --- converters/libiconv/pkg-plist	(revision 345014)
 +++ converters/libiconv/pkg-plist	(working copy)
 @@ -17,10 +17,10 @@ man/man3/iconv_open.3.gz
  man/man3/iconv_open_into.3.gz
  man/man3/iconv_close.3.gz
  man/man3/iconvctl.3.gz
 -%%DOCSDIR%%/iconv.1.html
 -%%DOCSDIR%%/iconv.3.html
 -%%DOCSDIR%%/iconv_close.3.html
 -%%DOCSDIR%%/iconv_open.3.html
 -%%DOCSDIR%%/iconv_open_into.3.html
 -%%DOCSDIR%%/iconvctl.3.html
 -@dirrm %%DOCSDIR%%
 +%%PORTDOCS%%%%DOCSDIR%%/iconv.1.html
 +%%PORTDOCS%%%%DOCSDIR%%/iconv.3.html
 +%%PORTDOCS%%%%DOCSDIR%%/iconv_close.3.html
 +%%PORTDOCS%%%%DOCSDIR%%/iconv_open.3.html
 +%%PORTDOCS%%%%DOCSDIR%%/iconv_open_into.3.html
 +%%PORTDOCS%%%%DOCSDIR%%/iconvctl.3.html
 +%%PORTDOCS%%@dirrm %%DOCSDIR%%
 
 --MP_/a1dP7fDT.6pF01Msx5erdEj--

From: Tijl Coosemans <tijl@FreeBSD.org>
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/186846: [patch] converters/libiconv: compilation with -Oz
 broken
Date: Mon, 3 Mar 2014 22:41:24 +0100

 --MP_/aIFnkSmogHwB=c2v52SaRKn
 Content-Type: text/plain; charset=US-ASCII
 Content-Transfer-Encoding: 7bit
 Content-Disposition: inline
 
 Patch rebased against r346968.
 --MP_/aIFnkSmogHwB=c2v52SaRKn
 Content-Type: text/x-patch
 Content-Transfer-Encoding: 7bit
 Content-Disposition: attachment; filename=libiconv.patch
 
 Index: converters/libiconv/Makefile
 ===================================================================
 --- converters/libiconv/Makefile	(revision 346969)
 +++ converters/libiconv/Makefile	(working copy)
 @@ -3,24 +3,24 @@
  
  PORTNAME=	libiconv
  PORTVERSION=	1.14
 -PORTREVISION=	2
 +PORTREVISION=	3
  CATEGORIES=	converters devel
  MASTER_SITES=	GNU
  
  MAINTAINER=	gnome@FreeBSD.org
 -COMMENT=	A character set conversion library
 +COMMENT=	Character set conversion library
  
  GNU_CONFIGURE=	yes
  CONFIGURE_ARGS=	--enable-static \
  		--without-libintl-prefix \
  		--docdir=${DOCSDIR}
 -CONFIGURE_ENV=	gl_cv_cc_visibility="no" \
 -		am_cv_func_iconv="yes" \
 +CONFIGURE_ENV=	am_cv_func_iconv="yes" \
  		am_cv_proto_iconv_arg1="const"
  MAKE_JOBS_UNSAFE=	yes
 +USE_CSTD=	gnu89
  USE_LDCONFIG=	yes
  
 -OPTIONS_DEFINE=	ENCODINGS PATCHES
 +OPTIONS_DEFINE=	DOCS ENCODINGS PATCHES
  OPTIONS_DEFAULT=ENCODINGS
  ENCODINGS_DESC=	Include extra character sets
  PATCHES_DESC=	Apply patches to fix CP932, add EUCJP-MS
 Index: converters/libiconv/files/patch-lib-iconv.c
 ===================================================================
 --- converters/libiconv/files/patch-lib-iconv.c	(revision 0)
 +++ converters/libiconv/files/patch-lib-iconv.c	(working copy)
 @@ -0,0 +1,11 @@
 +--- lib/iconv.c.orig
 ++++ lib/iconv.c
 +@@ -598,7 +598,7 @@
 +    It wants to define the symbols 'iconv_open', 'iconv', 'iconv_close'.  */
 + #define strong_alias(name, aliasname) _strong_alias(name, aliasname)
 + #define _strong_alias(name, aliasname) \
 +-  extern __typeof (name) aliasname __attribute__ ((alias (#name)));
 ++  extern LIBICONV_DLL_EXPORTED __typeof (name) aliasname __attribute__ ((alias (#name)));
 + #undef iconv_open
 + #undef iconv
 + #undef iconv_close
 
 Property changes on: converters/libiconv/files/patch-lib-iconv.c
 ___________________________________________________________________
 Added: fbsd:nokeywords
 ## -0,0 +1 ##
 +yes
 \ No newline at end of property
 Added: svn:eol-style
 ## -0,0 +1 ##
 +native
 \ No newline at end of property
 Added: svn:mime-type
 ## -0,0 +1 ##
 +text/plain
 \ No newline at end of property
 
 --MP_/aIFnkSmogHwB=c2v52SaRKn--

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/186846: commit references a PR
Date: Sun, 23 Mar 2014 13:26:25 +0000 (UTC)

 Author: tijl
 Date: Sun Mar 23 13:26:20 2014
 New Revision: 348854
 URL: http://svnweb.freebsd.org/changeset/ports/348854
 QAT: https://qat.redports.org/buildarchive/r348854/
 
 Log:
   - Remove indefinite article from COMMENT.
   - Enable -fvisibility=hidden.
   - Add USE_CSTD=gnu89 to fix compilation with -O0 and -Oz.
   - Add DOCS option.
   
   PR:		ports/186846
   Approved by:	kwm, marcus
 
 Added:
   head/converters/libiconv/files/patch-lib-iconv.c   (contents, props changed)
 Modified:
   head/converters/libiconv/Makefile
 
 Modified: head/converters/libiconv/Makefile
 ==============================================================================
 --- head/converters/libiconv/Makefile	Sun Mar 23 12:54:01 2014	(r348853)
 +++ head/converters/libiconv/Makefile	Sun Mar 23 13:26:20 2014	(r348854)
 @@ -3,24 +3,24 @@
  
  PORTNAME=	libiconv
  PORTVERSION=	1.14
 -PORTREVISION=	2
 +PORTREVISION=	3
  CATEGORIES=	converters devel
  MASTER_SITES=	GNU
  
  MAINTAINER=	gnome@FreeBSD.org
 -COMMENT=	A character set conversion library
 +COMMENT=	Character set conversion library
  
  GNU_CONFIGURE=	yes
  CONFIGURE_ARGS=	--enable-static \
  		--without-libintl-prefix \
  		--docdir=${DOCSDIR}
 -CONFIGURE_ENV=	gl_cv_cc_visibility="no" \
 -		am_cv_func_iconv="yes" \
 +CONFIGURE_ENV=	am_cv_func_iconv="yes" \
  		am_cv_proto_iconv_arg1="const"
  MAKE_JOBS_UNSAFE=	yes
 +USE_CSTD=	gnu89
  USE_LDCONFIG=	yes
  
 -OPTIONS_DEFINE=	ENCODINGS PATCHES
 +OPTIONS_DEFINE=	DOCS ENCODINGS PATCHES
  OPTIONS_DEFAULT=ENCODINGS
  ENCODINGS_DESC=	Include extra character sets
  PATCHES_DESC=	Apply patches to fix CP932, add EUCJP-MS
 
 Added: head/converters/libiconv/files/patch-lib-iconv.c
 ==============================================================================
 --- /dev/null	00:00:00 1970	(empty, because file is newly added)
 +++ head/converters/libiconv/files/patch-lib-iconv.c	Sun Mar 23 13:26:20 2014	(r348854)
 @@ -0,0 +1,11 @@
 +--- lib/iconv.c.orig
 ++++ lib/iconv.c
 +@@ -598,7 +598,7 @@
 +    It wants to define the symbols 'iconv_open', 'iconv', 'iconv_close'.  */
 + #define strong_alias(name, aliasname) _strong_alias(name, aliasname)
 + #define _strong_alias(name, aliasname) \
 +-  extern __typeof (name) aliasname __attribute__ ((alias (#name)));
 ++  extern LIBICONV_DLL_EXPORTED __typeof (name) aliasname __attribute__ ((alias (#name)));
 + #undef iconv_open
 + #undef iconv
 + #undef iconv_close
 _______________________________________________
 svn-ports-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-ports-all
 To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: open->closed 
State-Changed-By: tijl 
State-Changed-When: Sun Mar 23 14:39:00 CET 2014 
State-Changed-Why:  
Committed in r348854. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=186846 
>Unformatted:
