* [Buildroot] [PATCH] package/uclibc-ng-test: Fix musl build
@ 2024-07-25 6:44 Dmitry Chestnykh
2024-07-25 8:03 ` Thomas Petazzoni via buildroot
0 siblings, 1 reply; 2+ messages in thread
From: Dmitry Chestnykh @ 2024-07-25 6:44 UTC (permalink / raw)
To: buildroot; +Cc: Dmitry Chestnykh
Musl doesn't provide sys/asm.h header
so we should add some defines inside
mips-specific header file to avoid build errors
Signed-off-by: Dmitry Chestnykh <dm.chestnykh@gmail.com>
---
.../0001-Fix-error-absent-sys-asm-h.patch | 57 +++++++++++++++++++
1 file changed, 57 insertions(+)
create mode 100644 package/uclibc-ng-test/0001-Fix-error-absent-sys-asm-h.patch
diff --git a/package/uclibc-ng-test/0001-Fix-error-absent-sys-asm-h.patch b/package/uclibc-ng-test/0001-Fix-error-absent-sys-asm-h.patch
new file mode 100644
index 0000000000..ec88102e56
--- /dev/null
+++ b/package/uclibc-ng-test/0001-Fix-error-absent-sys-asm-h.patch
@@ -0,0 +1,57 @@
+From 556292ce354d33a94c54e7555dd999a9395c0a2d Mon Sep 17 00:00:00 2001
+From: Dmitry Chestnykh <dm.chestnykh@gmail.com>
+Date: Thu, 25 Jul 2024 09:15:11 +0300
+Subject: [PATCH] Fix errors due to absent sys/asm.h in mips64 musl build
+
+---
+ test/tls/tls-macros-mips.h | 33 +++++++++++++++++++++++++++++++++
+ 1 file changed, 33 insertions(+)
+
+diff --git a/test/tls/tls-macros-mips.h b/test/tls/tls-macros-mips.h
+index eed0938..bd4c5c4 100644
+--- a/test/tls/tls-macros-mips.h
++++ b/test/tls/tls-macros-mips.h
+@@ -1,7 +1,40 @@
+ /* Macros to support TLS testing in times of missing compiler support. */
+
+ #include <sys/cdefs.h>
++#if defined(__has_include) && __has_include(<sys/asm.h>)
+ #include <sys/asm.h>
++#else
++
++#define __STRING(x) #x
++
++#if ((_MIPS_SIM == _MIPS_SIM_ABI32 || _MIPS_SIM == _ABI32) && _MIPS_SZPTR == 32)
++#define PTR_ADDIU addiu
++#define PTR_L lw
++#endif
++
++#if _MIPS_SIM == _MIPS_SIM_NABI32 || _MIPS_SIM == _NABI32
++
++#if !defined __mips_isa_rev || __mips_isa_rev < 6
++#define PTR_ADDU add
++#define PTR_ADDIU addi
++#else
++#define PTR_ADDU addu
++#define PTR_ADDIU addiu
++#endif
++
++#define PTR_L lw
++#endif
++
++#if ((_MIPS_SIM == _MIPS_SIM_ABI32 || _MIPS_SIM == _ABI32) && _MIPS_SZPTR == 64) \
++ || _MIPS_SIM == _MIPS_SIM_ABI64 || _MIPS_SIM == _ABIN32
++
++#define PTR_ADDU daddu
++#define PTR_ADDIU daddiu
++#define PTR_L ld
++
++#endif
++
++#endif
+
+ #define __STRING2(X) __STRING(X)
+ #define ADDU __STRING2(PTR_ADDU)
+--
+2.45.2
+
--
2.45.2
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [Buildroot] [PATCH] package/uclibc-ng-test: Fix musl build
2024-07-25 6:44 [Buildroot] [PATCH] package/uclibc-ng-test: Fix musl build Dmitry Chestnykh
@ 2024-07-25 8:03 ` Thomas Petazzoni via buildroot
0 siblings, 0 replies; 2+ messages in thread
From: Thomas Petazzoni via buildroot @ 2024-07-25 8:03 UTC (permalink / raw)
To: Dmitry Chestnykh; +Cc: buildroot
Hello Dmitry,
On Thu, 25 Jul 2024 09:44:02 +0300
Dmitry Chestnykh <dm.chestnykh@gmail.com> wrote:
> Musl doesn't provide sys/asm.h header
> so we should add some defines inside
> mips-specific header file to avoid build errors
>
> Signed-off-by: Dmitry Chestnykh <dm.chestnykh@gmail.com>
Thanks a lot for the patch!
Could you include in your commit message the following:
Fixes:
http://autobuild.buildroot.net/results/af7a1d00930485f87f77762b34cae01873a8cd41/
also, do we know since when this error is occurring? Indeed, we want to
understand if this fix should be backported to our LTS branch or not.
And the only way to figure this out it to understand when the issue has
been introduced. Is this a recent regression? Something that has always
been occurring?
> diff --git a/package/uclibc-ng-test/0001-Fix-error-absent-sys-asm-h.patch b/package/uclibc-ng-test/0001-Fix-error-absent-sys-asm-h.patch
> new file mode 100644
> index 0000000000..ec88102e56
> --- /dev/null
> +++ b/package/uclibc-ng-test/0001-Fix-error-absent-sys-asm-h.patch
> @@ -0,0 +1,57 @@
> +From 556292ce354d33a94c54e7555dd999a9395c0a2d Mon Sep 17 00:00:00 2001
> +From: Dmitry Chestnykh <dm.chestnykh@gmail.com>
> +Date: Thu, 25 Jul 2024 09:15:11 +0300
> +Subject: [PATCH] Fix errors due to absent sys/asm.h in mips64 musl build
> +
We need the patch to contain an "Upstream:" tag which points to your
posting of this patch to the upstream project mailing list, or pointing
to the pull request.
We also need the patch to contain your Signed-off-by line.
You can get such things verified by running "make check-package" prior
to sending your patch.
> +diff --git a/test/tls/tls-macros-mips.h b/test/tls/tls-macros-mips.h
> +index eed0938..bd4c5c4 100644
> +--- a/test/tls/tls-macros-mips.h
> ++++ b/test/tls/tls-macros-mips.h
> +@@ -1,7 +1,40 @@
> + /* Macros to support TLS testing in times of missing compiler support. */
> +
> + #include <sys/cdefs.h>
> ++#if defined(__has_include) && __has_include(<sys/asm.h>)
> + #include <sys/asm.h>
> ++#else
> ++
> ++#define __STRING(x) #x
> ++
> ++#if ((_MIPS_SIM == _MIPS_SIM_ABI32 || _MIPS_SIM == _ABI32) && _MIPS_SZPTR == 32)
> ++#define PTR_ADDIU addiu
> ++#define PTR_L lw
> ++#endif
> ++
> ++#if _MIPS_SIM == _MIPS_SIM_NABI32 || _MIPS_SIM == _NABI32
> ++
> ++#if !defined __mips_isa_rev || __mips_isa_rev < 6
> ++#define PTR_ADDU add
> ++#define PTR_ADDIU addi
> ++#else
> ++#define PTR_ADDU addu
> ++#define PTR_ADDIU addiu
> ++#endif
> ++
> ++#define PTR_L lw
> ++#endif
> ++
> ++#if ((_MIPS_SIM == _MIPS_SIM_ABI32 || _MIPS_SIM == _ABI32) && _MIPS_SZPTR == 64) \
> ++ || _MIPS_SIM == _MIPS_SIM_ABI64 || _MIPS_SIM == _ABIN32
> ++
> ++#define PTR_ADDU daddu
> ++#define PTR_ADDIU daddiu
> ++#define PTR_L ld
> ++
> ++#endif
I can't really comment on whether this is all needed or not. It seems
complicated for a test suite, but maybe it's needed :-)
Thanks a lot!
Thomas
--
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-07-25 8:03 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-25 6:44 [Buildroot] [PATCH] package/uclibc-ng-test: Fix musl build Dmitry Chestnykh
2024-07-25 8:03 ` Thomas Petazzoni via buildroot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox