Skip to contentSkip to conversation

package/python-grpcio: disable for the MIPS n32 ABI

PATCH Superseded Yegor Yefremov via buildroot 1 participant 2 messages Sep 8 – Sep 16

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/python-grpcio: disable for the MIPS n32 ABI

From: Yegor Yefremov <[email protected]>

The bundled abseil-cpp only implements DirectMmap() with mmap2 for the o32 ABI on MIPS:

    #if ... (defined(__mips__) && _MIPS_SIM == _MIPS_SIM_ABI32) || ...

With the n32 ABI, the "remaining 64-bit architectures" fallback is selected instead, which fails to build because long is 32-bit there:

    third_party/abseil-cpp/absl/base/internal/direct_mmap.h:130:39:
        error: static assertion failed: Platform is not 64-bit
      130 |   static_assert(sizeof(unsigned long) == 8, "Platform is not 64-bit");
          |                 ~~~~~~~~~~~~~~~~~~~~~~^~~~
    third_party/abseil-cpp/absl/base/internal/direct_mmap.h:130:39:
        note: the comparison reduces to '(4 == 8)'

Upstream abseil has no support for the n32 ABI, so disable the package for that ABI. The o32 and n64 ABIs are unaffected.

Assisted-by Claude:claude-opus-5
---
 package/python-grpcio/Config.in | 5 +++++
 1 file changed, 5 insertions(+)
package/python-grpcio/Config.in +5 -0
index 6119991c7e..f52e19dc18 100644
@@ -6,6 +6,11 @@ config BR2_PACKAGE_PYTHON_GRPCIO_ARCH_SUPPORTS
 	default y if BR2_i386 || BR2_x86_64
 	default y if BR2_mips || BR2_mipsel || BR2_mips64 || BR2_mips64el
 	default y if BR2_riscv
+	# The bundled abseil-cpp only implements DirectMmap() for the o32
+	# ABI on MIPS, and its 64-bit fallback fails to build with the n32
+	# ABI, where long is 32-bit. See
+	# third_party/abseil-cpp/absl/base/internal/direct_mmap.h
+	depends on !BR2_MIPS_NABI32
 
 config BR2_PACKAGE_PYTHON_GRPCIO
 	bool "python-grpcio"
Signature · 6 lines
2.34.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#1 lore raw

Hello,

Thanks a lot for this patch. Number of questions below.

Quoted 10 lines · Yegor Yefremov via buildroot

From: Yegor Yefremov <[email protected]>

The bundled abseil-cpp only implements DirectMmap() with mmap2 for the o32 ABI on MIPS:

    #if ... (defined(__mips__) && _MIPS_SIM == _MIPS_SIM_ABI32) || ...

With the n32 ABI, the "remaining 64-bit architectures" fallback is selected instead, which fails to build because long is 32-bit there:

Quoted 6 lines
    third_party/abseil-cpp/absl/base/internal/direct_mmap.h:130:39:
        error: static assertion failed: Platform is not 64-bit
      130 |   static_assert(sizeof(unsigned long) == 8, "Platform is not 64-bit");
          |                 ~~~~~~~~~~~~~~~~~~~~~~^~~~
    third_party/abseil-cpp/absl/base/internal/direct_mmap.h:130:39:
        note: the comparison reduces to '(4 == 8)'

So assume this is fixing:

https://autobuild.buildroot.net/results/90405c0a3d0b2e929d5074305906e6fe3679298c/

?

If so, can you add a Fixes: tag?

Also, can you investigate since when this problem exists, so that our LTS maintainers can understand whether they need to backport this fix or not?

Quoted 2 lines

Upstream abseil has no support for the n32 ABI, so disable the package for that ABI. The o32 and n64 ABIs are unaffected.

But then doesn't package/abseil-cpp/Config.in also need to be modified?

And is it possible for python-grpcio to use the Buildroot-provided abseil, instead of using its bundled version?

Thanks a lot!

Thomas

Signature · 7 lines
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot