Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) by mx.groups.io with SMTP id smtpd.web11.3973.1614118605378046505 for ; Tue, 23 Feb 2021 14:16:45 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gherzan.com header.s=fm1 header.b=F0fDba31; spf=pass (domain: gherzan.com, ip: 66.111.4.27, mailfrom: andrei@gherzan.com) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id 87F0A5C00A8; Tue, 23 Feb 2021 17:16:44 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Tue, 23 Feb 2021 17:16:44 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gherzan.com; h= from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; s=fm1; bh=cEGrNUcyT4ITBFiIIk7NQvWNSv e/VEcQ4/cogNuCKw0=; b=F0fDba31hSYgsYrq64LROROUK34cUW1n05tVN4Sr1U 3BV+qN0sJbB5aXi0stO7QkJABphm6ZZv0UpYcXnzeOQU1rMWyGOV1v6fXjVDKdth 42WENgIHVPJ+J6B/nq+xvr4HINWpnGAKFFw+xWuAGSc627EPE7aBQKPuVErn4GJ2 1VJ0mv+ggIGlKhV/bXQuLQhV0FRiLashE6GgPzfkuFVhGuQXaffq+He/xVINaob3 fA2P26L4L0SGmdgf4NAmImbySWEqWpMPi4oBUoULbCJnP2k9qeDxyqJT9hI80NeQ +wHZPt9/I1yNBsmFVKoZO/+fRV9HxzF3BJJ8BjKBeq5Q== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :message-id:mime-version:subject:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=cEGrNUcyT4ITBFiII k7NQvWNSve/VEcQ4/cogNuCKw0=; b=HKNKgU5i29t/oaMe37y2RRVeSWubZNcMW bSmF5zzqoQzRL1Hrm+yWZ+tCTfQ2ZTJoAMIzw+lcpIlXMq+18JjGByqA3yw7RHNT CpnnvtIIzJurzBue/jt3E/75+9ljpSivjkxqB3KV1HcsrnEdSg0le3SHU1n55EJr vv52EL5Lkf++vMexNI93Wsi/M8e8QzQefGXbLPrDBo6OIsbhf0kn4ElDzlt4NzhZ ziBd7wv73STE32u4aGLvfG+njl0IdL04+dM5Dq69qEPdOV0A4wRB8YHTn9CvNWlm oI/3VIxpKQ4MTNil8KDC94AnPWokRR49YT72ad+Yx8Nl9T0I3E8YA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrkeehgdduheekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgggfestdekredtre dttdenucfhrhhomheptehnughrvghiucfihhgvrhiirghnuceorghnughrvghisehghhgv rhiirghnrdgtohhmqeenucggtffrrghtthgvrhhnpedvteeutdeutdfhvefggfeifeehve ethfeuffekgeeiiefgkefhheehjeeijeejudenucfkphepuddtledrudegiedrfeejrddu kedvnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprg hnughrvghisehghhgvrhiirghnrdgtohhm X-ME-Proxy: Received: from qwirkle.internal (host109-146-37-182.range109-146.btcentralplus.com [109.146.37.182]) by mail.messagingengine.com (Postfix) with ESMTPA id 8053F108005C; Tue, 23 Feb 2021 17:16:43 -0500 (EST) From: "Andrei Gherzan" To: openembedded-devel@lists.openembedded.org Cc: Andrei Gherzan Subject: [meta-oe][PATCH v2] nss: Fix warnings generated by getcwd Date: Tue, 23 Feb 2021 22:16:37 +0000 Message-Id: <20210223221637.3901832-1-andrei@gherzan.com> X-Mailer: git-send-email 2.30.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Andrei Gherzan 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 --- meta-oe/recipes-support/nss/nss_3.60.1.bb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/meta-oe/recipes-support/nss/nss_3.60.1.bb b/meta-oe/recipes-support/nss/nss_3.60.1.bb index dc147efea..94ac7af43 100644 --- a/meta-oe/recipes-support/nss/nss_3.60.1.bb +++ b/meta-oe/recipes-support/nss/nss_3.60.1.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 -- 2.30.1