summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrei Gherzan <andrei.gherzan@huawei.com>2021-02-23 22:17:55 +0000
committerArmin Kuster <akuster808@gmail.com>2021-03-16 08:40:06 -0700
commit453bd7845fb4f9f67937b93bc7fd2275ca8f203b (patch)
tree5d0beb944708f9b4e2fc26152d0235e3ce9893b4
parentf12e852c56ca897139220894d8b41e7967a70a58 (diff)
downloadmeta-openembedded-453bd7845fb4f9f67937b93bc7fd2275ca8f203b.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: Armin Kuster <akuster808@gmail.com>
-rw-r--r--meta-oe/recipes-support/nss/nss_3.51.1.bb6
1 files changed, 5 insertions, 1 deletions
diff --git a/meta-oe/recipes-support/nss/nss_3.51.1.bb b/meta-oe/recipes-support/nss/nss_3.51.1.bb
index 3e3c3a3fdf..0e127975b4 100644
--- a/meta-oe/recipes-support/nss/nss_3.51.1.bb
+++ b/meta-oe/recipes-support/nss/nss_3.51.1.bb
@@ -62,7 +62,6 @@ do_configure_prepend_libc-musl () {
62do_compile_prepend_class-native() { 62do_compile_prepend_class-native() {
63 export NSPR_INCLUDE_DIR=${STAGING_INCDIR_NATIVE}/nspr 63 export NSPR_INCLUDE_DIR=${STAGING_INCDIR_NATIVE}/nspr
64 export NSPR_LIB_DIR=${STAGING_LIBDIR_NATIVE} 64 export NSPR_LIB_DIR=${STAGING_LIBDIR_NATIVE}
65 export NSS_ENABLE_WERROR=0
66} 65}
67 66
68do_compile_prepend_class-nativesdk() { 67do_compile_prepend_class-nativesdk() {
@@ -81,6 +80,11 @@ do_compile() {
81 export NATIVE_CC="${BUILD_CC}" 80 export NATIVE_CC="${BUILD_CC}"
82 # Additional defines needed on Centos 7 81 # Additional defines needed on Centos 7
83 export NATIVE_FLAGS="${BUILD_CFLAGS} -DLINUX -Dlinux" 82 export NATIVE_FLAGS="${BUILD_CFLAGS} -DLINUX -Dlinux"
83
84 # POSIX.1-2001 states that the behaviour of getcwd() when passing a null
85 # pointer as the buf argument, is unspecified.
86 export NATIVE_FLAGS="${NATIVE_FLAGS} -DGETCWD_CANT_MALLOC"
87
84 export BUILD_OPT=1 88 export BUILD_OPT=1
85 89
86 export FREEBL_NO_DEPEND=1 90 export FREEBL_NO_DEPEND=1