Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] package/directfb: enable on riscv32 again
@ 2024-06-27 10:34 Steffen Persvold
  2024-07-13 21:10 ` Thomas Petazzoni via buildroot
  2024-08-12 13:03 ` Peter Korsgaard
  0 siblings, 2 replies; 3+ messages in thread
From: Steffen Persvold @ 2024-06-27 10:34 UTC (permalink / raw)
  To: buildroot; +Cc: Steffen Persvold

Newer 32bit architectures like RISCV32 and ARC are using 64bit time_t
from the get go unlike other 32bit architectures, therefore aliasing
__NR_futex to __NR_futex_time64 avoids the build error mentioned
in cb6fd050.

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

Signed-off-by: Steffen Persvold <spersvold@gmail.com>
---
 ...-__NR_futex-on-32bit-architectures-u.patch | 40 +++++++++++++++++++
 package/directfb/Config.in                    |  2 -
 2 files changed, 40 insertions(+), 2 deletions(-)
 create mode 100644 package/directfb/0007-libdirect-define-__NR_futex-on-32bit-architectures-u.patch

diff --git a/package/directfb/0007-libdirect-define-__NR_futex-on-32bit-architectures-u.patch b/package/directfb/0007-libdirect-define-__NR_futex-on-32bit-architectures-u.patch
new file mode 100644
index 00000000..0dea27b7
--- /dev/null
+++ b/package/directfb/0007-libdirect-define-__NR_futex-on-32bit-architectures-u.patch
@@ -0,0 +1,40 @@
+From 8ffd68a8dfa1e8671dd8c01b96faffd681deca4e Mon Sep 17 00:00:00 2001
+From: Steffen Persvold <spersvold@gmail.com>
+Date: Tue, 25 Jun 2024 14:14:49 +0200
+Subject: [PATCH] libdirect: define __NR_futex on 32bit architectures using
+ 64-bit time_t
+
+Newer 32bit architectures like RISCV32 and ARC are using 64bit time_t
+from the get go unlike other 32bit architectures, therefore aliasing
+__NR_futex to __NR_futex_time64 helps avoid the below errors :
+
+system.c:242:21: error: '__NR_futex' undeclared (first use in this function)
+  242 |      ret = syscall( __NR_futex, uaddr, op, val, timeout, uaddr2, val3 );
+      |                     ^~~~~~~~~~
+---
+ lib/direct/os/linux/glibc/system.c | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/lib/direct/os/linux/glibc/system.c b/lib/direct/os/linux/glibc/system.c
+index 32086a25..7143442b 100644
+--- a/lib/direct/os/linux/glibc/system.c
++++ b/lib/direct/os/linux/glibc/system.c
+@@ -213,6 +213,10 @@ direct_getenv( const char *name )
+ 
+ /**********************************************************************************************************************/
+ 
++#if defined(__NR_futex_time64) && !defined(__NR_futex)
++#define __NR_futex __NR_futex_time64
++#endif
++
+ DirectResult
+ direct_futex( int *uaddr, int op, int val, const struct timespec *timeout, int *uaddr2, int val3 )
+ {
+@@ -245,4 +249,3 @@ direct_futex( int *uaddr, int op, int val, const struct timespec *timeout, int *
+ 
+      return DR_OK;
+ }
+-
+-- 
+2.40.1
+
diff --git a/package/directfb/Config.in b/package/directfb/Config.in
index f4d6b8cb..20481f56 100644
--- a/package/directfb/Config.in
+++ b/package/directfb/Config.in
@@ -1,6 +1,5 @@
 config BR2_PACKAGE_DIRECTFB
 	bool "directfb"
-	depends on !BR2_RISCV_32
 	depends on !BR2_STATIC_LIBS # static link issues
 	depends on BR2_TOOLCHAIN_HAS_THREADS_NPTL
 	depends on BR2_INSTALL_LIBSTDCPP
@@ -162,7 +161,6 @@ config BR2_PACKAGE_DIRECTFB_TESTS
 endif # BR2_PACKAGE_DIRECTFB
 
 comment "directfb needs a glibc or uClibc toolchain w/ C++, NPTL, gcc >= 4.5, dynamic library"
-	depends on !BR2_RISCV_32
 	depends on BR2_TOOLCHAIN_HAS_SYNC_4
 	depends on !BR2_TOOLCHAIN_HAS_THREADS_NPTL || !BR2_INSTALL_LIBSTDCPP || \
 		!BR2_TOOLCHAIN_GCC_AT_LEAST_4_5 || BR2_TOOLCHAIN_USES_MUSL || \
-- 
2.40.1

_______________________________________________
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] package/directfb: enable on riscv32 again
  2024-06-27 10:34 [Buildroot] [PATCH] package/directfb: enable on riscv32 again Steffen Persvold
@ 2024-07-13 21:10 ` Thomas Petazzoni via buildroot
  2024-08-12 13:03 ` Peter Korsgaard
  1 sibling, 0 replies; 3+ messages in thread
From: Thomas Petazzoni via buildroot @ 2024-07-13 21:10 UTC (permalink / raw)
  To: Steffen Persvold; +Cc: buildroot

Hello Steffen,

On Thu, 27 Jun 2024 12:34:57 +0200
Steffen Persvold <spersvold@gmail.com> wrote:

> Newer 32bit architectures like RISCV32 and ARC are using 64bit time_t
> from the get go unlike other 32bit architectures, therefore aliasing
> __NR_futex to __NR_futex_time64 avoids the build error mentioned
> in cb6fd050.
> 
> Fixes:
>  - http://autobuild.buildroot.org/results/c0f4168575fa85af933539441eea95a3b10dac91
> 
> Signed-off-by: Steffen Persvold <spersvold@gmail.com>
> ---
>  ...-__NR_futex-on-32bit-architectures-u.patch | 40 +++++++++++++++++++
>  package/directfb/Config.in                    |  2 -
>  2 files changed, 40 insertions(+), 2 deletions(-)
>  create mode 100644 package/directfb/0007-libdirect-define-__NR_futex-on-32bit-architectures-u.patch

Thanks for your contribution, applied to our master branch!

How of curiosity, are you actually using DirectFB on RISC-V 32-bit
platforms?

Best regards,

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
_______________________________________________
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] package/directfb: enable on riscv32 again
  2024-06-27 10:34 [Buildroot] [PATCH] package/directfb: enable on riscv32 again Steffen Persvold
  2024-07-13 21:10 ` Thomas Petazzoni via buildroot
@ 2024-08-12 13:03 ` Peter Korsgaard
  1 sibling, 0 replies; 3+ messages in thread
From: Peter Korsgaard @ 2024-08-12 13:03 UTC (permalink / raw)
  To: Steffen Persvold; +Cc: buildroot

>>>>> "Steffen" == Steffen Persvold <spersvold@gmail.com> writes:

 > Newer 32bit architectures like RISCV32 and ARC are using 64bit time_t
 > from the get go unlike other 32bit architectures, therefore aliasing
 > __NR_futex to __NR_futex_time64 avoids the build error mentioned
 > in cb6fd050.

 > Fixes:
 >  - http://autobuild.buildroot.org/results/c0f4168575fa85af933539441eea95a3b10dac91

 > Signed-off-by: Steffen Persvold <spersvold@gmail.com>

Committed to 2024.02.x and 2024.05.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:[~2024-08-12 13:03 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-27 10:34 [Buildroot] [PATCH] package/directfb: enable on riscv32 again Steffen Persvold
2024-07-13 21:10 ` Thomas Petazzoni via buildroot
2024-08-12 13:03 ` Peter Korsgaard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox