Bug 186846 - [patch] converters/libiconv: compilation with -Oz broken
Summary: [patch] converters/libiconv: compilation with -Oz broken
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-gnome (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-02-17 15:50 UTC by Tijl Coosemans
Modified: 2014-03-23 13:39 UTC (History)
0 users

See Also:


Attachments
libiconv.patch (1.86 KB, patch)
2014-02-17 15:50 UTC, Tijl Coosemans
no flags Details | Diff
libiconv.patch (2.83 KB, patch)
2014-02-19 18:32 UTC, Tijl Coosemans
no flags Details | Diff
libiconv.patch (2.03 KB, patch)
2014-03-03 21:41 UTC, Tijl Coosemans
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tijl Coosemans freebsd_committer freebsd_triage 2014-02-17 15:50:01 UTC
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
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2014-02-17 15:50:10 UTC
Responsible Changed
From-To: freebsd-ports-bugs->gnome

Over to maintainer (via the GNATS Auto Assign Tool)
Comment 2 Tijl Coosemans freebsd_committer freebsd_triage 2014-02-19 18:32:28 UTC
Updated patch which adds a DOCS option and includes changes from
http://www.freebsd.org/cgi/query-pr.cgi?pr=186590
Comment 3 Tijl Coosemans freebsd_committer freebsd_triage 2014-03-03 21:41:24 UTC
Patch rebased against r346968.
Comment 4 dfilter service freebsd_committer freebsd_triage 2014-03-23 13:26:25 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"
Comment 5 Tijl Coosemans freebsd_committer freebsd_triage 2014-03-23 13:39:00 UTC
State Changed
From-To: open->closed

Committed in r348854.