Bug#854472: libreswan FTBFS on mips and mipsel: error: "_ABI64" is not defined [-Werror=undef]

2023-02-22 Thread Daniel Kahn Gillmor
I've now uploaded the patch below to debian's DELAYED/15 queue as nspr 4.35-1.1.

On Fri 2023-02-10 16:06:33 -0500, Daniel Kahn Gillmor wrote:
> Control: tags 854472 + patch
>
> On Thu 2017-02-02 12:02:59 +, Radovan Birdic wrote:
>>> In file included from /usr/include/nspr/prtypes.h:26:0,
>>>  from /usr/include/nspr/plarena.h:15,
>>>  from /usr/include/nss/cert.h:13,
>>>  from /«PKGBUILDDIR»/lib/libswan/nss_copies.c:6:
>>> /usr/include/nspr/prcpucfg.h:511:18: error: "_ABI64" is not defined 
>>> [-Werror=undef]
>>>  #if _MIPS_SIM == _ABI64
>>>   ^~
>>> cc1: all warnings being treated as errors
>>> ../../../mk/depend.mk:28: recipe for target 'nss_copies.o' failed
>>> make[5]: *** [nss_copies.o] Error 1
>
> This failure has started happening again on 32-bit mipsel since nspr
> 4.35.
>
> I tracked it down to a libmusl-related fix upstream, as reported here:
> https://bugzilla.mozilla.org/show_bug.cgi?id=1815947
>
> The attached patch was suggested by Giulio Benetti
> , cc'ed here.
>
> I've also made it as a merge request on salsa:
>
> https://salsa.debian.org/mozilla-team/nspr/-/merge_requests/3
>
> Please consider applying this so that libreswan can build on mipsel!
>
>  --dkg
>
> From 4b5482f4e8ceb621367a49f7c937b32f9d1132a7 Mon Sep 17 00:00:00 2001
> From: Daniel Kahn Gillmor 
> Date: Fri, 10 Feb 2023 15:57:30 -0500
> Subject: [PATCH] Avoid libreswan build failures on mipsel (Closes: #854472)
>
> ---
>  ...build-failures-on-mipsel-Closes-8544.patch | 30 +++
>  debian/patches/series |  1 +
>  2 files changed, 31 insertions(+)
>  create mode 100644 
> debian/patches/0001-Avoid-libreswan-build-failures-on-mipsel-Closes-8544.patch
>  create mode 100644 debian/patches/series
>
> diff --git 
> a/debian/patches/0001-Avoid-libreswan-build-failures-on-mipsel-Closes-8544.patch
>  
> b/debian/patches/0001-Avoid-libreswan-build-failures-on-mipsel-Closes-8544.patch
> new file mode 100644
> index 000..fcf3e11
> --- /dev/null
> +++ 
> b/debian/patches/0001-Avoid-libreswan-build-failures-on-mipsel-Closes-8544.patch
> @@ -0,0 +1,30 @@
> +From: Daniel Kahn Gillmor 
> +Date: Fri, 10 Feb 2023 15:55:36 -0500
> +Subject: Avoid libreswan build failures on mipsel (Closes: #854472)
> +
> +Forwarded: https://bugzilla.mozilla.org/show_bug.cgi?id=1815947
> +
> +Bug 1815947 - Fix build failure with glibc and uclibc while including 
> sgidefs.h
> +
> +Let's include glibc and uclibc  while with musl let's include 
> Linux
> +.
> +---
> + nspr/pr/include/md/_linux.cfg | 4 
> + 1 file changed, 4 insertions(+)
> +
> +diff --git a/nspr/pr/include/md/_linux.cfg b/nspr/pr/include/md/_linux.cfg
> +index 2232820..009d5e5 100644
> +--- a/nspr/pr/include/md/_linux.cfg
>  b/nspr/pr/include/md/_linux.cfg
> +@@ -499,7 +499,11 @@
> + #elif defined(__mips__)
> + 
> + /* For _ABI64 */
> ++#if defined(__GLIBC__) || defined(__UCLIBC__)
> ++#include 
> ++#else
> + #include 
> ++#endif
> + 
> + #ifdef __MIPSEB__
> + #define IS_BIG_ENDIAN 1
> diff --git a/debian/patches/series b/debian/patches/series
> new file mode 100644
> index 000..6529bf9
> --- /dev/null
> +++ b/debian/patches/series
> @@ -0,0 +1 @@
> +0001-Avoid-libreswan-build-failures-on-mipsel-Closes-8544.patch
> -- 
> 2.39.1


signature.asc
Description: PGP signature


Bug#854472: libreswan FTBFS on mips and mipsel: error: "_ABI64" is not defined [-Werror=undef]

2023-02-10 Thread Daniel Kahn Gillmor
Control: tags 854472 + patch

On Thu 2017-02-02 12:02:59 +, Radovan Birdic wrote:
>> In file included from /usr/include/nspr/prtypes.h:26:0,
>>  from /usr/include/nspr/plarena.h:15,
>>  from /usr/include/nss/cert.h:13,
>>  from /«PKGBUILDDIR»/lib/libswan/nss_copies.c:6:
>> /usr/include/nspr/prcpucfg.h:511:18: error: "_ABI64" is not defined 
>> [-Werror=undef]
>>  #if _MIPS_SIM == _ABI64
>>   ^~
>> cc1: all warnings being treated as errors
>> ../../../mk/depend.mk:28: recipe for target 'nss_copies.o' failed
>> make[5]: *** [nss_copies.o] Error 1

This failure has started happening again on 32-bit mipsel since nspr
4.35.

I tracked it down to a libmusl-related fix upstream, as reported here:
https://bugzilla.mozilla.org/show_bug.cgi?id=1815947

The attached patch was suggested by Giulio Benetti
, cc'ed here.

I've also made it as a merge request on salsa:

https://salsa.debian.org/mozilla-team/nspr/-/merge_requests/3

Please consider applying this so that libreswan can build on mipsel!

 --dkg

From 4b5482f4e8ceb621367a49f7c937b32f9d1132a7 Mon Sep 17 00:00:00 2001
From: Daniel Kahn Gillmor 
Date: Fri, 10 Feb 2023 15:57:30 -0500
Subject: [PATCH] Avoid libreswan build failures on mipsel (Closes: #854472)

---
 ...build-failures-on-mipsel-Closes-8544.patch | 30 +++
 debian/patches/series |  1 +
 2 files changed, 31 insertions(+)
 create mode 100644 debian/patches/0001-Avoid-libreswan-build-failures-on-mipsel-Closes-8544.patch
 create mode 100644 debian/patches/series

diff --git a/debian/patches/0001-Avoid-libreswan-build-failures-on-mipsel-Closes-8544.patch b/debian/patches/0001-Avoid-libreswan-build-failures-on-mipsel-Closes-8544.patch
new file mode 100644
index 000..fcf3e11
--- /dev/null
+++ b/debian/patches/0001-Avoid-libreswan-build-failures-on-mipsel-Closes-8544.patch
@@ -0,0 +1,30 @@
+From: Daniel Kahn Gillmor 
+Date: Fri, 10 Feb 2023 15:55:36 -0500
+Subject: Avoid libreswan build failures on mipsel (Closes: #854472)
+
+Forwarded: https://bugzilla.mozilla.org/show_bug.cgi?id=1815947
+
+Bug 1815947 - Fix build failure with glibc and uclibc while including sgidefs.h
+
+Let's include glibc and uclibc  while with musl let's include Linux
+.
+---
+ nspr/pr/include/md/_linux.cfg | 4 
+ 1 file changed, 4 insertions(+)
+
+diff --git a/nspr/pr/include/md/_linux.cfg b/nspr/pr/include/md/_linux.cfg
+index 2232820..009d5e5 100644
+--- a/nspr/pr/include/md/_linux.cfg
 b/nspr/pr/include/md/_linux.cfg
+@@ -499,7 +499,11 @@
+ #elif defined(__mips__)
+ 
+ /* For _ABI64 */
++#if defined(__GLIBC__) || defined(__UCLIBC__)
++#include 
++#else
+ #include 
++#endif
+ 
+ #ifdef __MIPSEB__
+ #define IS_BIG_ENDIAN 1
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 000..6529bf9
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+0001-Avoid-libreswan-build-failures-on-mipsel-Closes-8544.patch
-- 
2.39.1



signature.asc
Description: PGP signature