* [Buildroot] [PATCH 1/1] package/openblas: fix some x86 32bit builds
@ 2023-09-15 19:33 Julien Olivain
2023-09-15 20:51 ` Yann E. MORIN
2023-09-24 18:32 ` Peter Korsgaard
0 siblings, 2 replies; 3+ messages in thread
From: Julien Olivain @ 2023-09-15 19:33 UTC (permalink / raw)
To: buildroot; +Cc: Julien Olivain
OpenBLAS Makefile normally needs to explicitly define the CPU
architecture size (32 or 64bit) in the BINARY macro. See [1].
When an architecture supports both 64 and 32bit, the 32bit support
is sometimes implemented in OpenBLAS by overriding a fallback to an
anterior architecture. For example, if the build target architecture
is x86 Haswell 32bit, OpenBLAS build will override the arch to
Nehalem. See [2].
If the BINARY macro is undefined, the 32bit fallback will not happen,
sometimes leading to a link failure, with output:
i686-buildroot-linux-gnu/bin/ar: strmm_kernel_LN.o: No such file or directory
This commit fixes those issues by explicitly defining the BINARY
macro. This issue has also been discussed upstream in [3] and [4].
Note: this issue was not introduced recently ([3] dates back from 2015),
and was also see in previous package version, for example in [5].
Fixes:
http://autobuild.buildroot.net/results/e1e/e1e2034a78799abe1bd28b036fa6f7d13322e42f
[1] https://github.com/xianyi/OpenBLAS/blob/v0.3.24/Makefile.rule#L50
[2] https://github.com/xianyi/OpenBLAS/blob/v0.3.24/Makefile.system#L113
[3] https://github.com/xianyi/OpenBLAS/issues/657
[4] https://github.com/xianyi/OpenBLAS/issues/1106
[5] http://autobuild.buildroot.net/results/5cd/5cdccd106b1de275ac75c39783e536107a31651f
Signed-off-by: Julien Olivain <ju.o@free.fr>
---
Patch tested on branch master at commit 3557a7b with commands:
make check-package
...
0 warnings generated
utils/test-pkg -a -p openblas
...
45 builds, 25 skipped, 0 build failed, 0 legal-info failed, 0 show-info failed
support/testing/run-tests \
-d dl -o output_folder \
tests.package.test_openblas
...
OK
---
package/openblas/openblas.mk | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/package/openblas/openblas.mk b/package/openblas/openblas.mk
index 0d0e8e56dd..aacfc74b53 100644
--- a/package/openblas/openblas.mk
+++ b/package/openblas/openblas.mk
@@ -49,6 +49,12 @@ ifeq ($(BR2_STATIC_LIBS),y)
OPENBLAS_MAKE_OPTS += NO_SHARED=1
endif
+ifeq ($(BR2_ARCH_IS_64),y)
+OPENBLAS_MAKE_OPTS += BINARY=64
+else
+OPENBLAS_MAKE_OPTS += BINARY=32
+endif
+
# binutils version <= 2.23.2 has a bug
# (https://sourceware.org/bugzilla/show_bug.cgi?id=14887) where
# whitespaces in ARM register specifications such as [ r1, #12 ] or [
--
2.41.0
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [Buildroot] [PATCH 1/1] package/openblas: fix some x86 32bit builds
2023-09-15 19:33 [Buildroot] [PATCH 1/1] package/openblas: fix some x86 32bit builds Julien Olivain
@ 2023-09-15 20:51 ` Yann E. MORIN
2023-09-24 18:32 ` Peter Korsgaard
1 sibling, 0 replies; 3+ messages in thread
From: Yann E. MORIN @ 2023-09-15 20:51 UTC (permalink / raw)
To: Julien Olivain; +Cc: buildroot
Julien, All,
On 2023-09-15 21:33 +0200, Julien Olivain spake thusly:
> OpenBLAS Makefile normally needs to explicitly define the CPU
> architecture size (32 or 64bit) in the BINARY macro. See [1].
>
> When an architecture supports both 64 and 32bit, the 32bit support
> is sometimes implemented in OpenBLAS by overriding a fallback to an
> anterior architecture. For example, if the build target architecture
> is x86 Haswell 32bit, OpenBLAS build will override the arch to
> Nehalem. See [2].
>
> If the BINARY macro is undefined, the 32bit fallback will not happen,
> sometimes leading to a link failure, with output:
>
> i686-buildroot-linux-gnu/bin/ar: strmm_kernel_LN.o: No such file or directory
>
> This commit fixes those issues by explicitly defining the BINARY
> macro. This issue has also been discussed upstream in [3] and [4].
>
> Note: this issue was not introduced recently ([3] dates back from 2015),
> and was also see in previous package version, for example in [5].
>
> Fixes:
> http://autobuild.buildroot.net/results/e1e/e1e2034a78799abe1bd28b036fa6f7d13322e42f
>
> [1] https://github.com/xianyi/OpenBLAS/blob/v0.3.24/Makefile.rule#L50
> [2] https://github.com/xianyi/OpenBLAS/blob/v0.3.24/Makefile.system#L113
> [3] https://github.com/xianyi/OpenBLAS/issues/657
> [4] https://github.com/xianyi/OpenBLAS/issues/1106
> [5] http://autobuild.buildroot.net/results/5cd/5cdccd106b1de275ac75c39783e536107a31651f
>
> Signed-off-by: Julien Olivain <ju.o@free.fr>
Thanks *a lot* for this very detailed and convincing explanation, with
appropriate references. That's exactly the kind of information that
increases confidence in a patch! 👍
Applied to master, thanks.
Regards,
Yann E. MORIN.
> ---
> Patch tested on branch master at commit 3557a7b with commands:
>
> make check-package
> ...
> 0 warnings generated
>
> utils/test-pkg -a -p openblas
> ...
> 45 builds, 25 skipped, 0 build failed, 0 legal-info failed, 0 show-info failed
>
> support/testing/run-tests \
> -d dl -o output_folder \
> tests.package.test_openblas
> ...
> OK
> ---
> package/openblas/openblas.mk | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/package/openblas/openblas.mk b/package/openblas/openblas.mk
> index 0d0e8e56dd..aacfc74b53 100644
> --- a/package/openblas/openblas.mk
> +++ b/package/openblas/openblas.mk
> @@ -49,6 +49,12 @@ ifeq ($(BR2_STATIC_LIBS),y)
> OPENBLAS_MAKE_OPTS += NO_SHARED=1
> endif
>
> +ifeq ($(BR2_ARCH_IS_64),y)
> +OPENBLAS_MAKE_OPTS += BINARY=64
> +else
> +OPENBLAS_MAKE_OPTS += BINARY=32
> +endif
> +
> # binutils version <= 2.23.2 has a bug
> # (https://sourceware.org/bugzilla/show_bug.cgi?id=14887) where
> # whitespaces in ARM register specifications such as [ r1, #12 ] or [
> --
> 2.41.0
>
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot
--
.-----------------.--------------------.------------------.--------------------.
| Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ |
| +33 561 099 427 `------------.-------: X AGAINST | \e/ There is no |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Buildroot] [PATCH 1/1] package/openblas: fix some x86 32bit builds
2023-09-15 19:33 [Buildroot] [PATCH 1/1] package/openblas: fix some x86 32bit builds Julien Olivain
2023-09-15 20:51 ` Yann E. MORIN
@ 2023-09-24 18:32 ` Peter Korsgaard
1 sibling, 0 replies; 3+ messages in thread
From: Peter Korsgaard @ 2023-09-24 18:32 UTC (permalink / raw)
To: Julien Olivain; +Cc: buildroot
>>>>> "Julien" == Julien Olivain <ju.o@free.fr> writes:
> OpenBLAS Makefile normally needs to explicitly define the CPU
> architecture size (32 or 64bit) in the BINARY macro. See [1].
> When an architecture supports both 64 and 32bit, the 32bit support
> is sometimes implemented in OpenBLAS by overriding a fallback to an
> anterior architecture. For example, if the build target architecture
> is x86 Haswell 32bit, OpenBLAS build will override the arch to
> Nehalem. See [2].
> If the BINARY macro is undefined, the 32bit fallback will not happen,
> sometimes leading to a link failure, with output:
> i686-buildroot-linux-gnu/bin/ar: strmm_kernel_LN.o: No such file or directory
> This commit fixes those issues by explicitly defining the BINARY
> macro. This issue has also been discussed upstream in [3] and [4].
> Note: this issue was not introduced recently ([3] dates back from 2015),
> and was also see in previous package version, for example in [5].
> Fixes:
> http://autobuild.buildroot.net/results/e1e/e1e2034a78799abe1bd28b036fa6f7d13322e42f
> [1] https://github.com/xianyi/OpenBLAS/blob/v0.3.24/Makefile.rule#L50
> [2] https://github.com/xianyi/OpenBLAS/blob/v0.3.24/Makefile.system#L113
> [3] https://github.com/xianyi/OpenBLAS/issues/657
> [4] https://github.com/xianyi/OpenBLAS/issues/1106
> [5] http://autobuild.buildroot.net/results/5cd/5cdccd106b1de275ac75c39783e536107a31651f
> Signed-off-by: Julien Olivain <ju.o@free.fr>
Committed to 2023.02.x, 2023.05.x and 2023.08.x, thanks.
--
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-09-24 18:32 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-15 19:33 [Buildroot] [PATCH 1/1] package/openblas: fix some x86 32bit builds Julien Olivain
2023-09-15 20:51 ` Yann E. MORIN
2023-09-24 18:32 ` Peter Korsgaard
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox