[oe] [meta-browser][PATCH] nss: Fix build for 64bit targets

Khem Raj raj.khem at gmail.com
Wed Jan 9 22:58:01 UTC 2013


it would fair to compile for x86-64 since native flags
would pass 64bit flags but internally it would append
32bit flags to linker cmdline since we did not ask for
64bit build.

This patch asks for 64bit build on x86_64 and additionally
nullifies ARCHFLAG when NATIVE_CC is set, ARCHFLAG is
one which sets the 32bit/64bit ness of ABI

Signed-off-by: Khem Raj <raj.khem at gmail.com>
---
 recipes-support/nss/nss-3.13.3/native_cc.patch |   27 ++++++++++++++++++++----
 recipes-support/nss/nss_3.13.3.bb              |   11 +++++++---
 2 files changed, 31 insertions(+), 7 deletions(-)

diff --git a/recipes-support/nss/nss-3.13.3/native_cc.patch b/recipes-support/nss/nss-3.13.3/native_cc.patch
index e0c2232..41d4980 100644
--- a/recipes-support/nss/nss-3.13.3/native_cc.patch
+++ b/recipes-support/nss/nss-3.13.3/native_cc.patch
@@ -1,7 +1,12 @@
+we need to override ARCHFLAG as well since this is set to either -m32 or -m64
+and LDFLAGS add it explicitly which means when NATIVE_CC is defined then we build
+the objects as 64bit but link them to be 32bit binary which may not fly
+
+Signed-off-by: Khem Raj <raj.khem at gmail.com>
 Index: mozilla/security/coreconf/mkdepend/Makefile
 ===================================================================
---- mozilla.orig/security/coreconf/mkdepend/Makefile	2012-02-20 18:18:35.237845874 +0100
-+++ mozilla/security/coreconf/mkdepend/Makefile	2012-02-20 18:19:15.977844984 +0100
+--- mozilla.orig/security/coreconf/mkdepend/Makefile	2013-01-09 13:23:51.747694602 -0800
++++ mozilla/security/coreconf/mkdepend/Makefile	2013-01-09 13:56:27.003734720 -0800
 @@ -64,11 +64,11 @@
  endif
  
@@ -18,8 +23,8 @@ Index: mozilla/security/coreconf/mkdepend/Makefile
  include $(DEPTH)/coreconf/rules.mk
 Index: mozilla/security/coreconf/nsinstall/Makefile
 ===================================================================
---- mozilla.orig/security/coreconf/nsinstall/Makefile	2012-02-20 18:18:28.693846017 +0100
-+++ mozilla/security/coreconf/nsinstall/Makefile	2012-02-20 18:19:40.881844444 +0100
+--- mozilla.orig/security/coreconf/nsinstall/Makefile	2013-01-09 13:23:51.747694602 -0800
++++ mozilla/security/coreconf/nsinstall/Makefile	2013-01-09 13:56:11.775734407 -0800
 @@ -58,11 +58,11 @@
  endif
  
@@ -34,3 +39,17 @@ Index: mozilla/security/coreconf/nsinstall/Makefile
  endif
  
  include $(DEPTH)/coreconf/rules.mk
+Index: mozilla/security/coreconf/Linux.mk
+===================================================================
+--- mozilla.orig/security/coreconf/Linux.mk	2013-01-09 13:50:01.427726808 -0800
++++ mozilla/security/coreconf/Linux.mk	2013-01-09 13:55:58.815734141 -0800
+@@ -98,6 +98,9 @@
+ endif
+ endif
+ 
++ifdef NATIVE_FLAGS
++    override ARCHFLAG=
++endif
+ 
+ LIBC_TAG		= _glibc
+ 
diff --git a/recipes-support/nss/nss_3.13.3.bb b/recipes-support/nss/nss_3.13.3.bb
index bb602b1..8b5c663 100644
--- a/recipes-support/nss/nss_3.13.3.bb
+++ b/recipes-support/nss/nss_3.13.3.bb
@@ -1,7 +1,7 @@
 DESCRIPTION = "Mozilla's SSL and TLS implementation"
 HOMEPAGE = "http://www.mozilla.org/projects/security/pki/nss/"
 
-PR = "r1"
+PR = "r2"
 
 LICENSE = "MPL1.1 GPL LGPL"
 LIC_FILES_CHKSUM = "file://security/nss/manifest.mn;md5=d71978748f23eae3156c38ac2a691924"
@@ -24,6 +24,9 @@ TD = "${S}/tentative-dist"
 
 PARALLEL_MAKE = ""
 
+USE64BIT_x86-64 = "USE_64=1"
+USE64BIT ?= ""
+
 do_compile() {
 #	sed -e 's:SOURCE_PREFIX = $(CORE_DEPTH)/\.\./dist:SOURCE_PREFIX = $(CORE_DEPTH)/dist:' -i ${S}/security/coreconf/source.mk
 	make -C security/nss \
@@ -49,7 +52,8 @@ do_compile() {
 		CXX="${CXX}" \
 		RANLIB="${RANLIB}" \
 		NATIVE_CC="${BUILD_CC}" \
-		NATIVE_FLAGS="${BUILD_CFLAGS}"
+		NATIVE_FLAGS="${BUILD_CFLAGS}" \
+		${USE64BIT}
 }
 
 do_install() {
@@ -67,7 +71,8 @@ do_install() {
 		NSS_USE_SYSTEM_SQLITE=1 \
 		NSS_ENABLE_ECC=1 \
 		SOURCE_LIB_DIR="${TD}/${libdir}" \
-		SOURCE_BIN_DIR="${TD}/${bindir}"
+		SOURCE_BIN_DIR="${TD}/${bindir}" \
+		${USE64BIT}
 
 	install -d ${D}/${libdir}
 
-- 
1.7.9.5





More information about the Openembedded-devel mailing list