aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrei Gherzan <andrei.gherzan@huawei.com>2021-02-23 22:16:37 +0000
committerArmin Kuster <akuster808@gmail.com>2021-03-07 07:48:59 -0800
commitbe89766e7b1e79e95e44fae5f43f002df79555e9 (patch)
treef915adafbc11c74c4d0867ab9e498aa4e4c61e76
parent945f062ff098dc9c8ba8d22c5eef88adec60730d (diff)
downloadmeta-openembedded-contrib-be89766e7b1e79e95e44fae5f43f002df79555e9.tar.gz
nss: Fix warnings generated by getcwd
getcwd() conforms to POSIX.1-2001 which leaves the behaviour when the buf argument is NULL, undefined. This makes gcc 10+ throw the following warning: argument 1 is null but the corresponding size argument 2 value is 4096 Initially, this was fixed by disabling NSS_ENABLE_WERROR. This patch re-enables NSS_ENABLE_WERROR (by leaving it to its default value) and takes advantage of the existing functionality in nss that wraps the getcwd call into a function making sure that the buf argument is always properly allocated. Signed-off-by: Andrei Gherzan <andrei.gherzan@huawei.com> Signed-off-by: Khem Raj <raj.khem@gmail.com> (cherry picked from commit dad2aef6be76564103952e0ad78a7d666b49f72e) Signed-off-by: Armin Kuster <akuster808@gmail.com>
-rw-r--r--meta-oe/recipes-support/nss/nss_3.57.bb5
1 files changed, 4 insertions, 1 deletions
diff --git a/meta-oe/recipes-support/nss/nss_3.57.bb b/meta-oe/recipes-support/nss/nss_3.57.bb
index 5d9318a922..411707feca 100644
--- a/meta-oe/recipes-support/nss/nss_3.57.bb
+++ b/meta-oe/recipes-support/nss/nss_3.57.bb
@@ -68,7 +68,6 @@ do_compile_prepend_class-native() {
do_compile() {
export NSPR_INCLUDE_DIR=${STAGING_INCDIR}/nspr
- export NSS_ENABLE_WERROR=0
export CROSS_COMPILE=1
export NATIVE_CC="${BUILD_CC}"
@@ -76,6 +75,10 @@ do_compile() {
export NATIVE_FLAGS="${BUILD_CFLAGS} -DLINUX -Dlinux"
export BUILD_OPT=1
+ # POSIX.1-2001 states that the behaviour of getcwd() when passing a null
+ # pointer as the buf argument, is unspecified.
+ export NATIVE_FLAGS="${NATIVE_FLAGS} -DGETCWD_CANT_MALLOC"
+
export FREEBL_NO_DEPEND=1
export FREEBL_LOWHASH=1