All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] libxshmfence: Build fixes for riscv32
@ 2021-04-07  8:08 Yu, Mingli
  2021-04-07 17:15 ` [OE-core] " Khem Raj
  0 siblings, 1 reply; 3+ messages in thread
From: Yu, Mingli @ 2021-04-07  8:08 UTC (permalink / raw)
  To: openembedded-core

From: Mingli Yu <mingli.yu@windriver.com>

NR_futex is not defined by newer architectures e.g. riscv32 as
they only have 64bit variant of time_t. Glibc defines SYS_futex
interface based on __NR_futex, since this is used in applications,
such applications start to fail to build for these newer architectures.

Define a fallback to alias __NR_futex to __NR_futex_time64 to make
SYS_futex keep working.

Reference: https://git.openembedded.org/openembedded-core/commit/?id=7a218adf9990f5e18d0b6a33eb34091969f979c7

Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
---
 ...h-Define-SYS_futex-if-it-does-not-ex.patch | 39 +++++++++++++++++++
 .../xorg-lib/libxshmfence_1.3.bb              |  4 +-
 2 files changed, 42 insertions(+), 1 deletion(-)
 create mode 100644 meta/recipes-graphics/xorg-lib/libxshmfence/0001-xshmfence_futex.h-Define-SYS_futex-if-it-does-not-ex.patch

diff --git a/meta/recipes-graphics/xorg-lib/libxshmfence/0001-xshmfence_futex.h-Define-SYS_futex-if-it-does-not-ex.patch b/meta/recipes-graphics/xorg-lib/libxshmfence/0001-xshmfence_futex.h-Define-SYS_futex-if-it-does-not-ex.patch
new file mode 100644
index 0000000000..3e87794d20
--- /dev/null
+++ b/meta/recipes-graphics/xorg-lib/libxshmfence/0001-xshmfence_futex.h-Define-SYS_futex-if-it-does-not-ex.patch
@@ -0,0 +1,39 @@
+From 5827f6389a227157958d14a687fb29223cb3a03a Mon Sep 17 00:00:00 2001
+From: Mingli Yu <mingli.yu@windriver.com>
+Date: Wed, 7 Apr 2021 07:48:42 +0000
+Subject: [PATCH] xshmfence_futex.h: Define SYS_futex if it does not exist
+
+_NR_futex is not defines by newer architectures e.g. riscv32 as
+they only have 64bit variant of time_t. Glibc defines SYS_futex
+interface based on __NR_futex, since this is used in applications,
+such applications start to fail to build for these newer architectures.
+This patch defines a fallback to alias __NR_futex to __NR_futex_time64
+to make SYS_futex keep working.
+
+Reference: https://git.openembedded.org/openembedded-core/commit/?id=7a218adf9990f5e18d0b6a33eb34091969f979c7
+
+Upstream-Status: Pending
+
+Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
+---
+ src/xshmfence_futex.h | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/src/xshmfence_futex.h b/src/xshmfence_futex.h
+index 673ac0e..a71efa5 100644
+--- a/src/xshmfence_futex.h
++++ b/src/xshmfence_futex.h
+@@ -53,6 +53,10 @@ static inline int futex_wait(int32_t *addr, int32_t value) {
+ #include <sys/time.h>
+ #include <sys/syscall.h>
+ 
++#if !defined(SYS_futex) && defined(SYS_futex_time64)
++#define SYS_futex SYS_futex_time64
++#endif
++
+ static inline long sys_futex(void *addr1, int op, int val1, struct timespec *timeout, void *addr2, int val3)
+ {
+ 	return syscall(SYS_futex, addr1, op, val1, timeout, addr2, val3);
+-- 
+2.29.2
+
diff --git a/meta/recipes-graphics/xorg-lib/libxshmfence_1.3.bb b/meta/recipes-graphics/xorg-lib/libxshmfence_1.3.bb
index cc45696530..d153c7a603 100644
--- a/meta/recipes-graphics/xorg-lib/libxshmfence_1.3.bb
+++ b/meta/recipes-graphics/xorg-lib/libxshmfence_1.3.bb
@@ -13,7 +13,9 @@ DEPENDS += "virtual/libx11"
 
 EXTRA_OECONF += "--with-shared-memory-dir=/dev/shm"
 
-BBCLASSEXTEND = "native nativesdk"
+SRC_URI += "file://0001-xshmfence_futex.h-Define-SYS_futex-if-it-does-not-ex.patch"
 
 SRC_URI[md5sum] = "42dda8016943dc12aff2c03a036e0937"
 SRC_URI[sha256sum] = "b884300d26a14961a076fbebc762a39831cb75f92bed5ccf9836345b459220c7"
+
+BBCLASSEXTEND = "native nativesdk"
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [OE-core] [PATCH] libxshmfence: Build fixes for riscv32
  2021-04-07  8:08 [PATCH] libxshmfence: Build fixes for riscv32 Yu, Mingli
@ 2021-04-07 17:15 ` Khem Raj
  2021-04-08  4:39   ` Yu, Mingli
  0 siblings, 1 reply; 3+ messages in thread
From: Khem Raj @ 2021-04-07 17:15 UTC (permalink / raw)
  To: Yu, Mingli; +Cc: Patches and discussions about the oe-core layer

On Wed, Apr 7, 2021 at 1:08 AM Yu, Mingli <mingli.yu@windriver.com> wrote:
>
> From: Mingli Yu <mingli.yu@windriver.com>
>
> NR_futex is not defined by newer architectures e.g. riscv32 as
> they only have 64bit variant of time_t. Glibc defines SYS_futex
> interface based on __NR_futex, since this is used in applications,
> such applications start to fail to build for these newer architectures.
>
> Define a fallback to alias __NR_futex to __NR_futex_time64 to make
> SYS_futex keep working.
>
> Reference: https://git.openembedded.org/openembedded-core/commit/?id=7a218adf9990f5e18d0b6a33eb34091969f979c7
>
> Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
> ---
>  ...h-Define-SYS_futex-if-it-does-not-ex.patch | 39 +++++++++++++++++++
>  .../xorg-lib/libxshmfence_1.3.bb              |  4 +-
>  2 files changed, 42 insertions(+), 1 deletion(-)
>  create mode 100644 meta/recipes-graphics/xorg-lib/libxshmfence/0001-xshmfence_futex.h-Define-SYS_futex-if-it-does-not-ex.patch
>
> diff --git a/meta/recipes-graphics/xorg-lib/libxshmfence/0001-xshmfence_futex.h-Define-SYS_futex-if-it-does-not-ex.patch b/meta/recipes-graphics/xorg-lib/libxshmfence/0001-xshmfence_futex.h-Define-SYS_futex-if-it-does-not-ex.patch
> new file mode 100644
> index 0000000000..3e87794d20
> --- /dev/null
> +++ b/meta/recipes-graphics/xorg-lib/libxshmfence/0001-xshmfence_futex.h-Define-SYS_futex-if-it-does-not-ex.patch
> @@ -0,0 +1,39 @@
> +From 5827f6389a227157958d14a687fb29223cb3a03a Mon Sep 17 00:00:00 2001
> +From: Mingli Yu <mingli.yu@windriver.com>
> +Date: Wed, 7 Apr 2021 07:48:42 +0000
> +Subject: [PATCH] xshmfence_futex.h: Define SYS_futex if it does not exist
> +
> +_NR_futex is not defines by newer architectures e.g. riscv32 as
> +they only have 64bit variant of time_t. Glibc defines SYS_futex
> +interface based on __NR_futex, since this is used in applications,
> +such applications start to fail to build for these newer architectures.
> +This patch defines a fallback to alias __NR_futex to __NR_futex_time64
> +to make SYS_futex keep working.
> +
> +Reference: https://git.openembedded.org/openembedded-core/commit/?id=7a218adf9990f5e18d0b6a33eb34091969f979c7
> +
> +Upstream-Status: Pending
> +
> +Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
> +---
> + src/xshmfence_futex.h | 4 ++++
> + 1 file changed, 4 insertions(+)
> +
> +diff --git a/src/xshmfence_futex.h b/src/xshmfence_futex.h
> +index 673ac0e..a71efa5 100644
> +--- a/src/xshmfence_futex.h
> ++++ b/src/xshmfence_futex.h
> +@@ -53,6 +53,10 @@ static inline int futex_wait(int32_t *addr, int32_t value) {
> + #include <sys/time.h>
> + #include <sys/syscall.h>
> +
> ++#if !defined(SYS_futex) && defined(SYS_futex_time64)
> ++#define SYS_futex SYS_futex_time64
> ++#endif
> ++
> + static inline long sys_futex(void *addr1, int op, int val1, struct timespec *timeout, void *addr2, int val3)
> + {
> +       return syscall(SYS_futex, addr1, op, val1, timeout, addr2, val3);
> +--
> +2.29.2
> +
> diff --git a/meta/recipes-graphics/xorg-lib/libxshmfence_1.3.bb b/meta/recipes-graphics/xorg-lib/libxshmfence_1.3.bb
> index cc45696530..d153c7a603 100644
> --- a/meta/recipes-graphics/xorg-lib/libxshmfence_1.3.bb
> +++ b/meta/recipes-graphics/xorg-lib/libxshmfence_1.3.bb
> @@ -13,7 +13,9 @@ DEPENDS += "virtual/libx11"
>
>  EXTRA_OECONF += "--with-shared-memory-dir=/dev/shm"
>
> -BBCLASSEXTEND = "native nativesdk"
> +SRC_URI += "file://0001-xshmfence_futex.h-Define-SYS_futex-if-it-does-not-ex.patch"
>
>  SRC_URI[md5sum] = "42dda8016943dc12aff2c03a036e0937"
>  SRC_URI[sha256sum] = "b884300d26a14961a076fbebc762a39831cb75f92bed5ccf9836345b459220c7"
> +
> +BBCLASSEXTEND = "native nativesdk"

 can you also. send a pull to meta-riscv to remove it from there ?

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [OE-core] [PATCH] libxshmfence: Build fixes for riscv32
  2021-04-07 17:15 ` [OE-core] " Khem Raj
@ 2021-04-08  4:39   ` Yu, Mingli
  0 siblings, 0 replies; 3+ messages in thread
From: Yu, Mingli @ 2021-04-08  4:39 UTC (permalink / raw)
  To: Khem Raj; +Cc: Patches and discussions about the oe-core layer



On 4/8/21 1:15 AM, Khem Raj wrote:
> [Please note: This e-mail is from an EXTERNAL e-mail address]
> 
> On Wed, Apr 7, 2021 at 1:08 AM Yu, Mingli <mingli.yu@windriver.com> wrote:
>>
>> From: Mingli Yu <mingli.yu@windriver.com>
>>
>> NR_futex is not defined by newer architectures e.g. riscv32 as
>> they only have 64bit variant of time_t. Glibc defines SYS_futex
>> interface based on __NR_futex, since this is used in applications,
>> such applications start to fail to build for these newer architectures.
>>
>> Define a fallback to alias __NR_futex to __NR_futex_time64 to make
>> SYS_futex keep working.
>>
>> Reference: https://git.openembedded.org/openembedded-core/commit/?id=7a218adf9990f5e18d0b6a33eb34091969f979c7
>>
>> Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
>> ---
>>   ...h-Define-SYS_futex-if-it-does-not-ex.patch | 39 +++++++++++++++++++
>>   .../xorg-lib/libxshmfence_1.3.bb              |  4 +-
>>   2 files changed, 42 insertions(+), 1 deletion(-)
>>   create mode 100644 meta/recipes-graphics/xorg-lib/libxshmfence/0001-xshmfence_futex.h-Define-SYS_futex-if-it-does-not-ex.patch
>>
>> diff --git a/meta/recipes-graphics/xorg-lib/libxshmfence/0001-xshmfence_futex.h-Define-SYS_futex-if-it-does-not-ex.patch b/meta/recipes-graphics/xorg-lib/libxshmfence/0001-xshmfence_futex.h-Define-SYS_futex-if-it-does-not-ex.patch
>> new file mode 100644
>> index 0000000000..3e87794d20
>> --- /dev/null
>> +++ b/meta/recipes-graphics/xorg-lib/libxshmfence/0001-xshmfence_futex.h-Define-SYS_futex-if-it-does-not-ex.patch
>> @@ -0,0 +1,39 @@
>> +From 5827f6389a227157958d14a687fb29223cb3a03a Mon Sep 17 00:00:00 2001
>> +From: Mingli Yu <mingli.yu@windriver.com>
>> +Date: Wed, 7 Apr 2021 07:48:42 +0000
>> +Subject: [PATCH] xshmfence_futex.h: Define SYS_futex if it does not exist
>> +
>> +_NR_futex is not defines by newer architectures e.g. riscv32 as
>> +they only have 64bit variant of time_t. Glibc defines SYS_futex
>> +interface based on __NR_futex, since this is used in applications,
>> +such applications start to fail to build for these newer architectures.
>> +This patch defines a fallback to alias __NR_futex to __NR_futex_time64
>> +to make SYS_futex keep working.
>> +
>> +Reference: https://git.openembedded.org/openembedded-core/commit/?id=7a218adf9990f5e18d0b6a33eb34091969f979c7
>> +
>> +Upstream-Status: Pending
>> +
>> +Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
>> +---
>> + src/xshmfence_futex.h | 4 ++++
>> + 1 file changed, 4 insertions(+)
>> +
>> +diff --git a/src/xshmfence_futex.h b/src/xshmfence_futex.h
>> +index 673ac0e..a71efa5 100644
>> +--- a/src/xshmfence_futex.h
>> ++++ b/src/xshmfence_futex.h
>> +@@ -53,6 +53,10 @@ static inline int futex_wait(int32_t *addr, int32_t value) {
>> + #include <sys/time.h>
>> + #include <sys/syscall.h>
>> +
>> ++#if !defined(SYS_futex) && defined(SYS_futex_time64)
>> ++#define SYS_futex SYS_futex_time64
>> ++#endif
>> ++
>> + static inline long sys_futex(void *addr1, int op, int val1, struct timespec *timeout, void *addr2, int val3)
>> + {
>> +       return syscall(SYS_futex, addr1, op, val1, timeout, addr2, val3);
>> +--
>> +2.29.2
>> +
>> diff --git a/meta/recipes-graphics/xorg-lib/libxshmfence_1.3.bb b/meta/recipes-graphics/xorg-lib/libxshmfence_1.3.bb
>> index cc45696530..d153c7a603 100644
>> --- a/meta/recipes-graphics/xorg-lib/libxshmfence_1.3.bb
>> +++ b/meta/recipes-graphics/xorg-lib/libxshmfence_1.3.bb
>> @@ -13,7 +13,9 @@ DEPENDS += "virtual/libx11"
>>
>>   EXTRA_OECONF += "--with-shared-memory-dir=/dev/shm"
>>
>> -BBCLASSEXTEND = "native nativesdk"
>> +SRC_URI += "file://0001-xshmfence_futex.h-Define-SYS_futex-if-it-does-not-ex.patch"
>>
>>   SRC_URI[md5sum] = "42dda8016943dc12aff2c03a036e0937"
>>   SRC_URI[sha256sum] = "b884300d26a14961a076fbebc762a39831cb75f92bed5ccf9836345b459220c7"
>> +
>> +BBCLASSEXTEND = "native nativesdk"
> 
>   can you also. send a pull to meta-riscv to remove it from there ?

Sure, will send the patch to meta-riscv once this patch in oe-core is 
merged.

Thanks,

> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-04-08  4:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-07  8:08 [PATCH] libxshmfence: Build fixes for riscv32 Yu, Mingli
2021-04-07 17:15 ` [OE-core] " Khem Raj
2021-04-08  4:39   ` Yu, Mingli

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.