diff mbox series

[1/1] package/openblas: fix build without MMU

Message ID 20240310182439.441668-1-fontaine.fabrice@gmail.com
State New
Headers show
Series [1/1] package/openblas: fix build without MMU | expand

Commit Message

Fabrice Fontaine March 10, 2024, 6:24 p.m. UTC
Fix the following build failure without MMU:

/home/buildroot/autobuild/instance-1/output-1/host/riscv64-buildroot-linux-uclibc/bin/ld.real: test_fork.o: in function `.L6':
test_fork.c:(.text+0x120): undefined reference to `fork'

autobuilder failure is raised since the addition of RISC-V support by
commit c789bcddf0fb17580bef0cdc45b5334a90ecdf13

Fixes:
 - http://autobuild.buildroot.org/results/b9d097ae077f2cb40fc60de94bf25423636af005

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
---
 ...ding-against-an-uClibc-that-does-not.patch | 28 +++++++++++++++++++
 ...-uclibc-that-does-not-implement-fork.patch | 28 +++++++++++++++++++
 2 files changed, 56 insertions(+)
 create mode 100644 package/openblas/0002-Skip-the-fork-test-when-building-against-an-uClibc-that-does-not.patch
 create mode 100644 package/openblas/0003-Skip-test-when-building-with-a-uclibc-that-does-not-implement-fork.patch
diff mbox series

Patch

diff --git a/package/openblas/0002-Skip-the-fork-test-when-building-against-an-uClibc-that-does-not.patch b/package/openblas/0002-Skip-the-fork-test-when-building-against-an-uClibc-that-does-not.patch
new file mode 100644
index 0000000000..9b52dbfe05
--- /dev/null
+++ b/package/openblas/0002-Skip-the-fork-test-when-building-against-an-uClibc-that-does-not.patch
@@ -0,0 +1,28 @@ 
+From 30e8d255de4cfdfa2fdd7272e12d1efd6e74bc7b Mon Sep 17 00:00:00 2001
+From: Martin Kroeker <martin@ruby.chemie.uni-freiburg.de>
+Date: Sun, 10 Mar 2024 00:05:01 +0100
+Subject: [PATCH] Skip the fork test when building against an uClibc that does
+ not implement fork
+
+Signed-off-bt: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+Upstream: https://github.com/OpenMathLib/OpenBLAS/commit/91b1fb7f9b9f053919e79e9b898060b90f5b0af3
+---
+ utest/test_fork.c | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/utest/test_fork.c b/utest/test_fork.c
+index bd531e7fb8..558026031b 100644
+--- a/utest/test_fork.c
++++ b/utest/test_fork.c
+@@ -64,6 +64,11 @@ static void check_dgemm(double *a, double *b, double *result, double *expected,
+ 
+ CTEST(fork, safety)
+ {
++#ifdef __UCLIBC__
++#if !defined __UCLIBC_HAS_STUBS__ && !defined __ARCH_USE_MMU__
++exit(0);
++#endif
++#endif
+ #ifndef BUILD_DOUBLE
+ exit(0);
+ #else
diff --git a/package/openblas/0003-Skip-test-when-building-with-a-uclibc-that-does-not-implement-fork.patch b/package/openblas/0003-Skip-test-when-building-with-a-uclibc-that-does-not-implement-fork.patch
new file mode 100644
index 0000000000..2e46266331
--- /dev/null
+++ b/package/openblas/0003-Skip-test-when-building-with-a-uclibc-that-does-not-implement-fork.patch
@@ -0,0 +1,28 @@ 
+From 8a665f0d57a355932e9571449f4cf30caed56ae1 Mon Sep 17 00:00:00 2001
+From: Martin Kroeker <martin@ruby.chemie.uni-freiburg.de>
+Date: Sun, 10 Mar 2024 19:08:03 +0100
+Subject: [PATCH] Skip test when building with a uclibc that does not implement
+ fork
+
+Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+Upstream: https://github.com/OpenMathLib/OpenBLAS/pull/4546
+---
+ utest/test_post_fork.c | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/utest/test_post_fork.c b/utest/test_post_fork.c
+index 9370a02cee..6d640aebb6 100644
+--- a/utest/test_post_fork.c
++++ b/utest/test_post_fork.c
+@@ -67,6 +67,11 @@ static void check_dgemm(double *a, double *b, double *result, double *expected,
+ 
+ CTEST(fork, safety_after_fork_in_parent)
+ {
++#ifdef __UCLIBC__
++#if !defined __UCLIBC_HAS_STUBS__ && !defined __ARCH_USE_MMU__
++exit(0);
++#endif
++#endif
+ #ifndef BUILD_DOUBLE
+ exit(0);
+ #else