Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 12 Jan 2010 05:24:36 GMT
From:      bf <bf1783@gmail.com>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   ports/142736: [PATCH]www/firefox3*: unbreak with recent versions of GCC
Message-ID:  <201001120524.o0C5OaM0062177@www.freebsd.org>
Resent-Message-ID: <201001120530.o0C5U1ut097984@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         142736
>Category:       ports
>Synopsis:       [PATCH]www/firefox3*: unbreak with recent versions of GCC
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Jan 12 05:30:01 UTC 2010
>Closed-Date:
>Last-Modified:
>Originator:     bf
>Release:        9-CURRENT amd64
>Organization:
-
>Environment:
>Description:
After hiding many symbols, the mozilla team went to some trouble to provide wrappers for system headers, in order to prevent visibility problems, but their default arrangement fails for our converters/libiconv iconv.h.  To fix this, the FreeBSD gecko team hardcoded the inclusion of the libiconv iconv.h, but in doing so failed to arrange for it to have default rather than hidden visibility.  This causes problems, especially  with newer versions of GCC. (See, for example, http://gcc.gnu.org/wiki/Visibility .)

Unbreak www/firefox3-devel and firefox35 with recent versions of GCC by:

--restoring default visibility for iconv.h (patching the wrappers themselves, rather than the source files);

--likewise wrapping the inclusion of our system fenv.h, which is included by local patches, to provide default visibility (fedisableexcept is a weak symbol, particularly prone to visibility problems);

--fixing a criteria for the inclusion of dlfcn.h that only worked for GNU/Linux and Mac OSX; and

 --relaxing some linking checks to solve problems caused by the conversion of static archives into shared libraries with ld from devel/binutils.  

Tested with gcc 4.5, binutils 2.20, firefox-3.5.7, and firefox-3.6rc1 only. The changes in bsd.gecko.mk do not break builds for www/firefox3, firefox3-devel and firefox35 with the base system compiler on my box (9-CURRENT amd64 r202050), but they could be refined.  The patch is in three parts: I will include the bsd.gecko.mk changes with the opening of the PR, and the patches to firefox35 and firefox35 in subsequent addenda.

Regards,
                  b.
>How-To-Repeat:

>Fix:


Patch attached with submission follows:

--- bsd.gecko.mk.orig	2010-01-11 22:25:29.000000000 -0500
+++ bsd.gecko.mk	2010-01-11 22:06:50.000000000 -0500
@@ -503,9 +503,19 @@
 		s|"%FULL_NSPR_LIBS%"|`nspr-config --libs`|g' \
 			${MOZSRC}/build/unix/mozilla-config.in
 	@${REINPLACE_CMD} -e 's|<iconv.h>|\"${LOCALBASE}/include/iconv.h\"|g' \
-		${WRKSRC}/configure \
-		${MOZSRC}/intl/uconv/native/nsNativeUConvService.cpp \
-		${MOZSRC}/xpcom/io/nsNativeCharsetUtils.cpp
+		${WRKSRC}/configure
+.for subdir in config/system_wrappers nsprpub/config/system_wrappers js/src/config/system_wrappers_js
+	@${MKDIR} ${MOZSRC}/${subdir}
+	@${ECHO_CMD} "#pragma GCC system_header" >> ${MOZSRC}/${subdir}/iconv.h
+	@${ECHO_CMD} "#pragma GCC visibility push(default)" >> ${MOZSRC}/${subdir}/iconv.h
+	@${ECHO_CMD} "#include \"${LOCALBASE}/include/iconv.h\"" >> ${MOZSRC}/${subdir}/iconv.h
+	@${ECHO_CMD} "#pragma GCC visibility pop" >> ${MOZSRC}/${subdir}/iconv.h
+.endfor
+.for subdir in "" nsprpub js/src
+	@if [ -f ${MOZSRC}/${subdir}/config/system-headers ] ; then \
+		${ECHO_CMD} "fenv.h" >> ${MOZSRC}/${subdir}/config/system-headers ; \
+	fi
+.endfor
 	@${REINPLACE_CMD} -e 's|%%MOZILLA%%|${MOZILLA}|g' \
 		${WRKSRC}/config/autoconf.mk.in
 	@${REINPLACE_CMD} -e 's|-pthread|${PTHREAD_LIBS}|g ; \


>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201001120524.o0C5OaM0062177>