[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
02/05: gnu: nss: Prepare for GCC 10.
From: |
guix-commits |
Subject: |
02/05: gnu: nss: Prepare for GCC 10. |
Date: |
Sun, 6 Jun 2021 13:52:53 -0400 (EDT) |
mbakke pushed a commit to branch core-updates
in repository guix.
commit 1eee406b078c92a171493502bdd22bdd2bdf76c6
Author: Marius Bakke <marius@gnu.org>
AuthorDate: Sun Jun 6 18:57:19 2021 +0200
gnu: nss: Prepare for GCC 10.
* gnu/packages/patches/nss-getcwd-nonnull.patch: New file.
* gnu/local.mk (dist_patch_DATA): Adjust accordingly.
* gnu/packages/nss.scm (nss)[source](patches): Add it.
---
gnu/local.mk | 1 +
gnu/packages/nss.scm | 1 +
gnu/packages/patches/nss-getcwd-nonnull.patch | 30 +++++++++++++++++++++++++++
3 files changed, 32 insertions(+)
diff --git a/gnu/local.mk b/gnu/local.mk
index 7fa033c..fdd1227 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1439,6 +1439,7 @@ dist_patch_DATA =
\
%D%/packages/patches/network-manager-plugin-path.patch \
%D%/packages/patches/nginx-socket-cloexec.patch \
%D%/packages/patches/nsis-env-passthru.patch \
+ %D%/packages/patches/nss-getcwd-nonnull.patch \
%D%/packages/patches/nss-increase-test-timeout.patch \
%D%/packages/patches/nss-3.56-pkgconfig.patch \
%D%/packages/patches/ntfs-3g-CVE-2019-9755.patch \
diff --git a/gnu/packages/nss.scm b/gnu/packages/nss.scm
index 854205f..29fc21e 100644
--- a/gnu/packages/nss.scm
+++ b/gnu/packages/nss.scm
@@ -96,6 +96,7 @@ in the Mozilla clients.")
(file-name (git-file-name name version))
;; Create nss.pc and nss-config.
(patches (search-patches "nss-3.56-pkgconfig.patch"
+ "nss-getcwd-nonnull.patch"
"nss-increase-test-timeout.patch"))
(modules '((guix build utils)))
(snippet
diff --git a/gnu/packages/patches/nss-getcwd-nonnull.patch
b/gnu/packages/patches/nss-getcwd-nonnull.patch
new file mode 100644
index 0000000..d367c37
--- /dev/null
+++ b/gnu/packages/patches/nss-getcwd-nonnull.patch
@@ -0,0 +1,30 @@
+Disable -Werror=nonnull on getcwd(0, 4096) because GCC incorrectly warns that
+the second argument should be NULL with recent glibc. See:
+
+https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96832
+https://sourceware.org/bugzilla/show_bug.cgi?id=26545
+
+diff --git a/coreconf/nsinstall/nsinstall.c b/coreconf/nsinstall/nsinstall.c
+--- a/coreconf/nsinstall/nsinstall.c
++++ b/coreconf/nsinstall/nsinstall.c
+@@ -236,14 +236,20 @@ main(int argc, char **argv)
+ return 0;
+
+ if (!cwd) {
++#pragma GCC diagnostic push
++#pragma GCC diagnostic ignored "-Wnonnull"
+ cwd = GETCWD(0, PATH_MAX);
++#pragma GCC diagnostic pop
+ if (!cwd)
+ fail("could not get CWD");
+ }
+
+ /* make sure we can get into todir. */
+ xchdir(todir);
++#pragma GCC diagnostic push
++#pragma GCC diagnostic ignored "-Wnonnull"
+ todir = GETCWD(0, PATH_MAX);
++#pragma GCC diagnostic pop
+ if (!todir)
+ fail("could not get CWD in todir");
+ tdlen = strlen(todir);