Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) by mx.groups.io with SMTP id smtpd.web08.3740.1614118283292293246 for ; Tue, 23 Feb 2021 14:11:23 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gherzan.com header.s=fm1 header.b=DS0SZ1Fk; spf=pass (domain: gherzan.com, ip: 66.111.4.27, mailfrom: andrei@gherzan.com) Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 6BA495C00AF; Tue, 23 Feb 2021 17:11:22 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Tue, 23 Feb 2021 17:11:22 -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=HAQXaF8wfBNv0CffcfI614IJzW e1WdaqNFoco7xnGDk=; b=DS0SZ1Fk3H7DgPQGhz4CvnVv8yJ8Cf5yg4nRJwwrGG 9ybvYZ2Xi82FMrzr9pvTWHtOXqTaBFYfWursf6cNTD6uspsdMgTe5A8VEuZ7iRuS Eu8Hl9NWfJVi0xgbtgAPdkghNBzqQT3WSytkFACPMysRtMwLJZy2FbXmBxPbf0hA 0gZqAYnwJsMFoDbKBMlkrmWgs18xgRy+vhMQVR5hPpr5dxD/KQB5URRxu0xAe0XQ reQatqGRaGfTjLjQdxCjWqyKT7oYFaYTq5MXogDqDYxmwd9bJeE8tkItQCq3XQit /rRq4HtBawzCP+nCPAVVX58pcm4b8zKrjBtc7wk+7+UA== 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=HAQXaF8wfBNv0Cffc fI614IJzWe1WdaqNFoco7xnGDk=; b=kOTNOX84eZPLGk1sCLPgL7MXuQsHAN8ln eQuuUtv7oNeAnxT+xwss2dtYQ1wc5vMoPwrH+zoF3g30SeV/IEk9jGjK/cBzXsyc 71Vq0ynURrTHYyOjiytVtxcBLNLNZ1FZR/tVaVjIEFY5RQq3g3FNMEHhZMSnU0gG 1uUcPfLzmiaZyU4tDo2MMEDHf2+XQ8QarOJUcChdqesLPMf5cH1RRdEBAZcqtoBd FSxEMZivWthtdpR+67QTvQRLvqAVWlnA5m5aWJh9Sd2QzwThFU0OXWQwS0wupflH zo0QStg2aYlXFuhuUU2pLYdcjS7O5bdug1lrKm/zq3VZPYtUSdUCA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrkeehgdduheejucetufdoteggodetrfdotf 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 43A9524005A; Tue, 23 Feb 2021 17:11:21 -0500 (EST) From: "Andrei Gherzan" To: openembedded-devel@lists.openembedded.org Cc: Andrei Gherzan Subject: [meta-oe][PATCH] nss: Fix warnings generated by getcwd Date: Tue, 23 Feb 2021 22:11:08 +0000 Message-Id: <20210223221108.3893408-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.51.1.bb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 3e3c3a3fd..0e127975b 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 () { do_compile_prepend_class-native() { export NSPR_INCLUDE_DIR=${STAGING_INCDIR_NATIVE}/nspr export NSPR_LIB_DIR=${STAGING_LIBDIR_NATIVE} - export NSS_ENABLE_WERROR=0 } do_compile_prepend_class-nativesdk() { @@ -81,6 +80,11 @@ do_compile() { export NATIVE_CC="${BUILD_CC}" # Additional defines needed on Centos 7 export NATIVE_FLAGS="${BUILD_CFLAGS} -DLINUX -Dlinux" + + # 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 BUILD_OPT=1 export FREEBL_NO_DEPEND=1 -- 2.30.1