Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 25 Jan 2006 19:26:39 -0500
From:      Mikhail Teterin <mi+mx@aldan.algebra.com>
To:        gnome@freebsd.org
Subject:   minor improvements for Firefox, etc.
Message-ID:  <200601251926.39246.mi%2Bmx@aldan.algebra.com>

next in thread | raw e-mail | index | archive | help
--Boundary-00=_/cB2DIq633gNON9
Content-Type: text/plain;
  charset="us-ascii"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Hello!

The attached patch improves Firefox as follows:

	1. Use -fpic instead of -fPIC an all platforms except sparc64
	   and always define PIC (-DPIC) -- this is how bsd.lib.mk
	   compiles shared objects.

	2. Use the system's libz instead of compiling Mozilla's own libmozz.

	3. Use system's libbz2 instead of compiling Mozilla's own.

Yes, the 2. should be the case automatically, but is not, because Mozilla's 
configure insists on libz-1.2.3 and we still use 1.2.2. The reason for 
Mozilla's insistance, however, is in the security promblems found in 1.2.2. 
FreeBSD's standard libz, however, has this problems patched long ago (without 
bumping the version).

The goal of 1. is achieved in Firefox' own post-configure target -- it should, 
probably, migrate into mozilla/Makefile.common. With 2. and 3. taken care of, 
mozilla/Makefile.common should be ammended as per the second attachement to 
avoid any API-ABI (header-library) conflicts.

Yours,

	-mi

--Boundary-00=_/cB2DIq633gNON9
Content-Type: text/x-diff;
  charset="us-ascii";
  name="firefox.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
	filename="firefox.diff"

Index: Makefile
===================================================================
RCS file: /meow/ncvs/ports/www/firefox/Makefile,v
retrieving revision 1.145
diff -U2 -r1.145 Makefile
--- Makefile	15 Dec 2005 17:11:32 -0000	1.145
+++ Makefile	26 Jan 2006 00:14:25 -0000
@@ -9,5 +9,5 @@
 PORTNAME=	firefox
 DISTVERSION=	1.5
-PORTREVISION=	5
+PORTREVISION=	6
 PORTEPOCH=	1
 CATEGORIES=	www
@@ -59,4 +59,12 @@
 .endif
 
+post-configure:
+	# Be sure to always define PIC, when compiling a shared object.
+	# For slightly better efficiency, be sure to also use -fpic
+	# instead of -fPIC on all arches except sparc64:
+	${REINPLACE_CMD} \
+	    -e 's,-fPIC,-DPIC ${ARCH:S/sparc64/-fPIC/:C/^[^-].*/-fpic/},' \
+		${WRKSRC}/config/autoconf.mk
+
 post-extract::
 	@${SED} -e 's|@FIREFOX_ICON@|${FIREFOX_ICON}|' \
Index: files/patch-configure
===================================================================
RCS file: /meow/ncvs/ports/www/firefox/files/patch-configure,v
retrieving revision 1.2
diff -U2 -r1.2 patch-configure
--- files/patch-configure	29 Nov 2005 21:12:28 -0000	1.2
+++ files/patch-configure	25 Jan 2006 22:19:25 -0000
@@ -1,4 +1,11 @@
 --- configure.orig	Tue Oct  4 02:01:48 2005
 +++ configure	Wed Nov 23 11:07:17 2005
+@@ -1019,5 +1019,5 @@
+ MOZJPEG=62
+ MOZPNG=10207
+-MOZZLIB=1.2.3
++MOZZLIB=1.2.2
+ NSPR_VERSION=4
+ 
 @@ -10016,7 +10016,7 @@
    echo $ac_n "(cached) $ac_c" 1>&6
Index: files/patch-directory-c-sdk-config-FreeBSD.mk
===================================================================
RCS file: files/patch-directory-c-sdk-config-FreeBSD.mk
diff -N files/patch-directory-c-sdk-config-FreeBSD.mk
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ files/patch-directory-c-sdk-config-FreeBSD.mk	25 Jan 2006 20:01:18 -0000
@@ -0,0 +1,12 @@
+--- directory/c-sdk/config/FreeBSD.mk	Tue Mar 26 16:51:46 2002
++++ directory/c-sdk/config/FreeBSD.mk	Wed Jan 25 14:39:23 2006
+@@ -75,5 +75,9 @@
+ endif
+ 
++ifeq ($(OS_TEST),sparc64)
+ DSO_CFLAGS		= -fPIC
++else
++DSO_CFLAGS		= -fpic
++endif
+ DSO_LDOPTS		= -Bshareable
+ 
Index: files/patch-security-coreconf-FreeBSD.mk
===================================================================
RCS file: /meow/ncvs/ports/www/firefox/files/patch-security-coreconf-FreeBSD.mk,v
retrieving revision 1.3
diff -U2 -r1.3 patch-security-coreconf-FreeBSD.mk
--- files/patch-security-coreconf-FreeBSD.mk	22 Nov 2004 04:04:52 -0000	1.3
+++ files/patch-security-coreconf-FreeBSD.mk	25 Jan 2006 19:56:25 -0000
@@ -1,6 +1,5 @@
---- security/coreconf/FreeBSD.mk.orig	Wed Mar 26 20:17:25 2003
-+++ security/coreconf/FreeBSD.mk	Sun Nov 21 22:59:49 2004
-@@ -43,8 +43,12 @@
- ifeq ($(OS_TEST),alpha)
+--- security/coreconf/FreeBSD.mk	Sun Apr 25 11:02:17 2004
++++ security/coreconf/FreeBSD.mk	Wed Jan 25 14:49:09 2006
+@@ -46,10 +46,18 @@
  CPU_ARCH		= alpha
  else
@@ -14,6 +13,12 @@
  OS_CFLAGS		= $(DSO_CFLAGS) -ansi -Wall -DFREEBSD -DHAVE_STRERROR -DHAVE_BSD_FLOCK
  
-@@ -71,7 +75,11 @@
- DLL_SUFFIX		= so.1.0
++ifeq ($(OS_TEST),sparc64)
+ DSO_CFLAGS		= -fPIC
++else
++DSO_CFLAGS		= -fpic
++endif
+ DSO_LDOPTS		= -shared -Wl,-soname -Wl,$(notdir $@)
+ 
+@@ -74,5 +82,9 @@
  endif
  
@@ -26,3 +31,2 @@
  ifdef MAPFILE
  # Add LD options to restrict exported symbols to those in the map file
- endif
Index: files/patch-sysbz2
===================================================================
RCS file: files/patch-sysbz2
diff -N files/patch-sysbz2
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ files/patch-sysbz2	26 Jan 2006 00:00:18 -0000
@@ -0,0 +1,14 @@
+--- toolkit/mozapps/update/src/updater/Makefile.in	Wed Sep 14 10:09:18 2005
++++ toolkit/mozapps/update/src/updater/Makefile.in	Wed Jan 25 19:00:11 2006
+@@ -53,9 +53,9 @@
+ PROGRAM = updater$(BIN_SUFFIX)
+ 
+-REQUIRES = libmar libbz2
++REQUIRES = libmar
+ 
+ LIBS += \
+ 	$(DIST)/lib/$(LIB_PREFIX)mar.$(LIB_SUFFIX) \
+-	$(DIST)/lib/$(LIB_PREFIX)bz2.$(LIB_SUFFIX) \
++	-lbz2 \
+ 	$(NULL)
+ 
Index: files/patch-sysnss
===================================================================
RCS file: /meow/ncvs/ports/www/firefox/files/patch-sysnss,v
retrieving revision 1.1
diff -U2 -r1.1 patch-sysnss
--- files/patch-sysnss	28 Aug 2005 07:59:05 -0000	1.1
+++ files/patch-sysnss	25 Jan 2006 22:25:53 -0000
@@ -8,4 +8,10 @@
  ifndef MOZ_NATIVE_JPEG
  tier_1_dirs	+= jpeg
+@@ -127,5 +125,4 @@
+ 
+ ifdef MOZ_UPDATER
+-tier_1_dirs += modules/libbz2
+ tier_1_dirs += modules/libmar
+ endif
 --- security/manager/Makefile.in	Mon Mar 28 19:56:36 2005
 +++ security/manager/Makefile.in	Tue Aug  2 09:02:50 2005

--Boundary-00=_/cB2DIq633gNON9
Content-Type: text/x-diff;
  charset="us-ascii";
  name="mozilla.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
	filename="mozilla.diff"

Index: Makefile.common
===================================================================
RCS file: /meow/ncvs/ports/www/mozilla/Makefile.common,v
retrieving revision 1.5
diff -U2 -r1.5 Makefile.common
--- Makefile.common	24 Jan 2006 18:39:12 -0000	1.5
+++ Makefile.common	25 Jan 2006 21:52:59 -0000
@@ -102,4 +102,6 @@
 			--exclude */nsprpub/*			\
 			--exclude mozilla/modules/libimg/png	\
+			--exclude mozilla/modules/libbz2	\
+			--exclude mozilla/modules/zlib		\
 			--exclude mozilla/jpeg			\
 			--exclude mozilla/dbm			\

--Boundary-00=_/cB2DIq633gNON9--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200601251926.39246.mi%2Bmx>