aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2013-01-09 14:58:01 -0800
committerOtavio Salvador <otavio@ossystems.com.br>2013-01-10 08:59:36 -0200
commite037c1461d884084bbd06138a1fc448dfb0555bf (patch)
tree98c17e94a4bfe9467a3c0c6865649668299a7b35
parenta5dee3d63e4c55ee54e4c84086114acf09bdde67 (diff)
nss: Fix build for 64bit targets
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@gmail.com>
-rw-r--r--recipes-support/nss/nss-3.13.3/native_cc.patch27
-rw-r--r--recipes-support/nss/nss_3.13.3.bb11
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@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}