All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH V2 1/3] ruby: Use arm32 for coroutines on 32bit-arm
@ 2020-03-10  1:15 Khem Raj
  2020-03-10  1:15 ` [PATCH V2 2/3] valgrind: Fix timerfd syscall test to be 64bit time_t safe Khem Raj
  2020-03-10  1:15 ` [PATCH V2 3/3] dbus-test: Replace cp -a/-r with portable options Khem Raj
  0 siblings, 2 replies; 4+ messages in thread
From: Khem Raj @ 2020-03-10  1:15 UTC (permalink / raw)
  To: openembedded-core

in 2.7 [2] ruby enabled ucontext for coroutines on arm32 but it does not
work for musl since it uses glibc specific functions e.g.
getcontext/swapcontext/swapcontext also see [1]

This patch reverts back to using arm32 implementation for coroutines on
arm

[1] https://bugs.ruby-lang.org/issues/16455#change-83442
[2] https://github.com/ruby/ruby/commit/6c6bf9ffcbfeb8be9d9c342e7604b74ec819e88a#diff-7fccec8474e2184cd2518046bf39d54cL10

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
v2: No change

 meta/recipes-devtools/ruby/ruby_2.7.0.bb | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/meta/recipes-devtools/ruby/ruby_2.7.0.bb b/meta/recipes-devtools/ruby/ruby_2.7.0.bb
index 268b4bebd9..884bb0ef44 100644
--- a/meta/recipes-devtools/ruby/ruby_2.7.0.bb
+++ b/meta/recipes-devtools/ruby/ruby_2.7.0.bb
@@ -25,6 +25,8 @@ EXTRA_OECONF = "\
     --with-pkg-config=pkg-config \
 "
 
+EXTRA_OECONF_append_arm_libc-musl = " --with-coroutine=arm32"
+
 do_install() {
     oe_runmake 'DESTDIR=${D}' install
 }
-- 
2.25.1



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

* [PATCH V2 2/3] valgrind: Fix timerfd syscall test to be 64bit time_t safe
  2020-03-10  1:15 [PATCH V2 1/3] ruby: Use arm32 for coroutines on 32bit-arm Khem Raj
@ 2020-03-10  1:15 ` Khem Raj
  2020-03-10  1:15 ` [PATCH V2 3/3] dbus-test: Replace cp -a/-r with portable options Khem Raj
  1 sibling, 0 replies; 4+ messages in thread
From: Khem Raj @ 2020-03-10  1:15 UTC (permalink / raw)
  To: openembedded-core

This helps compile the testcase with musl on 32bit arches

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
v2: Use header check instead of function checks

 ...check-tests-Fix-timerfd-syscall-test.patch | 98 +++++++++++++++++++
 .../valgrind/valgrind_3.15.0.bb               |  1 +
 2 files changed, 99 insertions(+)
 create mode 100644 meta/recipes-devtools/valgrind/valgrind/0001-memcheck-tests-Fix-timerfd-syscall-test.patch

diff --git a/meta/recipes-devtools/valgrind/valgrind/0001-memcheck-tests-Fix-timerfd-syscall-test.patch b/meta/recipes-devtools/valgrind/valgrind/0001-memcheck-tests-Fix-timerfd-syscall-test.patch
new file mode 100644
index 0000000000..15fbbe954f
--- /dev/null
+++ b/meta/recipes-devtools/valgrind/valgrind/0001-memcheck-tests-Fix-timerfd-syscall-test.patch
@@ -0,0 +1,98 @@
+From 5d411fd147d652e9d7bb259f4048693c6e4742aa Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 9 Mar 2020 16:30:19 -0700
+Subject: [PATCH] memcheck/tests: Fix timerfd syscall test
+
+modern libc provides these functions, moreover this also ensures that we
+are 64bit time_t safe. Fallback to existing definitions if libc does not
+have the implementation or syscall is not defined
+
+Upstream-Status: Submitted [https://sourceforge.net/p/valgrind/mailman/message/36943897/]
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ config.h.in                            |  9 +++++++++
+ configure.ac                           |  3 +++
+ memcheck/tests/linux/timerfd-syscall.c | 10 ++++++++--
+ 5 files changed, 32 insertions(+), 2 deletions(-)
+
+--- a/config.h.in
++++ b/config.h.in
+@@ -301,6 +301,9 @@
+ /* Define to 1 if you have the <sys/sysnvl.h> header file. */
+ #undef HAVE_SYS_SYSNVL_H
+ 
++/* Define to 1 if you have the <sys/timerfd.h> header file. */
++#undef HAVE_SYS_TIMERFD_H
++
+ /* Define to 1 if you have the <sys/time.h> header file. */
+ #undef HAVE_SYS_TIME_H
+ 
+--- a/configure.ac
++++ b/configure.ac
+@@ -4098,6 +4098,7 @@ AC_CHECK_HEADERS([       \
+         sys/syscall.h    \
+         sys/sysnvl.h     \
+         sys/time.h       \
++        sys/timerfd.h    \
+         sys/types.h      \
+         ])
+ 
+--- a/memcheck/tests/linux/timerfd-syscall.c
++++ b/memcheck/tests/linux/timerfd-syscall.c
+@@ -45,6 +45,9 @@
+ #if defined(HAVE_SYS_TIME_H)
+ #include <sys/time.h>
+ #endif
++#if defined(HAVE_SYS_TIMERFD_H)
++#include <sys/timerfd.h>
++#endif
+ #if defined(HAVE_SYS_TYPES_H)
+ #include <sys/types.h>
+ #endif
+@@ -54,7 +57,8 @@
+  * timerfd_* system call numbers introduced in 2.6.23. These constants are
+  * not yet in the glibc 2.7 headers, that is why they are defined here.
+  */
+-#ifndef __NR_timerfd_create
++#if !defined(HAVE_SYS_TIMERFD_H)
++#if !defined(__NR_timerfd_create)
+ #if defined(__x86_64__)
+ #define __NR_timerfd_create  283
+ #elif defined(__i386__)
+@@ -67,8 +71,10 @@
+ #error Cannot detect your architecture!
+ #endif
+ #endif
++#endif
+ 
+-#ifndef __NR_timerfd_settime
++#if !defined(HAVE_SYS_TIMERFD_H)
++#if !defined(__NR_timerfd_settime)
+ #if defined(__x86_64__)
+ #define __NR_timerfd_settime 286
+ #define __NR_timerfd_gettime 287
+@@ -85,7 +91,7 @@
+ #error Cannot detect your architecture!
+ #endif
+ #endif
+-
++#endif
+ 
+ 
+ /* Definitions from include/linux/timerfd.h */
+@@ -127,6 +133,7 @@ void set_timespec(struct timespec *tmr,
+   tmr->tv_nsec = (long) (1000ULL * (ustime % 1000000ULL));
+ }
+ 
++#if !defined(HAVE_SYS_TIMERFD_H)
+ int timerfd_create(int clockid, int flags)
+ {
+   return syscall(__NR_timerfd_create, clockid, flags);
+@@ -142,6 +149,7 @@ int timerfd_gettime(int ufc, struct itim
+ {
+   return syscall(__NR_timerfd_gettime, ufc, otmr);
+ }
++#endif
+ 
+ long waittmr(int tfd, int timeo)
+ {
diff --git a/meta/recipes-devtools/valgrind/valgrind_3.15.0.bb b/meta/recipes-devtools/valgrind/valgrind_3.15.0.bb
index 1475ff841e..7954437a1a 100644
--- a/meta/recipes-devtools/valgrind/valgrind_3.15.0.bb
+++ b/meta/recipes-devtools/valgrind/valgrind_3.15.0.bb
@@ -41,6 +41,7 @@ SRC_URI = "https://sourceware.org/pub/valgrind/valgrind-${PV}.tar.bz2 \
            file://s390x_vec_op_t.patch \
            file://0001-none-tests-fdleak_cmsg.stderr.exp-adjust-tmp-paths.patch \
            file://0001-tests-Make-pthread_detatch-call-portable-across-plat.patch \
+           file://0001-memcheck-tests-Fix-timerfd-syscall-test.patch \
            "
 SRC_URI[md5sum] = "46e5fbdcbc3502a5976a317a0860a975"
 SRC_URI[sha256sum] = "417c7a9da8f60dd05698b3a7bc6002e4ef996f14c13f0ff96679a16873e78ab1"
-- 
2.25.1



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

* [PATCH V2 3/3] dbus-test: Replace cp -a/-r with portable options
  2020-03-10  1:15 [PATCH V2 1/3] ruby: Use arm32 for coroutines on 32bit-arm Khem Raj
  2020-03-10  1:15 ` [PATCH V2 2/3] valgrind: Fix timerfd syscall test to be 64bit time_t safe Khem Raj
@ 2020-03-10  1:15 ` Khem Raj
  2020-03-10  8:32   ` Richard Purdie
  1 sibling, 1 reply; 4+ messages in thread
From: Khem Raj @ 2020-03-10  1:15 UTC (permalink / raw)
  To: openembedded-core

-r are not posix defined and -a leaks UID of
build user into target

Errors like below are fixed when -a is used

bus/connection.h is owned by uid 1000, which is the same as t
he user running bitbake. This may be due to host contamination

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
v2: Improve commit message for clear reason for change

 meta/recipes-core/dbus/dbus-test_1.12.16.bb | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/meta/recipes-core/dbus/dbus-test_1.12.16.bb b/meta/recipes-core/dbus/dbus-test_1.12.16.bb
index bea0e74ed0..91e2ba69d2 100644
--- a/meta/recipes-core/dbus/dbus-test_1.12.16.bb
+++ b/meta/recipes-core/dbus/dbus-test_1.12.16.bb
@@ -70,11 +70,11 @@ do_install_ptest() {
 
 	install ${B}/test/test-segfault ${D}${PTEST_PATH}/test
 
-	cp -r ${B}/test/data ${D}${PTEST_PATH}/test
+	cp -R --no-dereference --preserve=mode,links ${B}/test/data ${D}${PTEST_PATH}/test
 	install ${B}/dbus/.libs/test-dbus ${D}${PTEST_PATH}/test
 
 	install -d ${D}${PTEST_PATH}/test/.libs
-	cp -a ${B}/dbus/.libs/*.so* ${D}${PTEST_PATH}/test/.libs
+	cp -R --no-dereference --preserve=mode,links ${B}/dbus/.libs/*.so* ${D}${PTEST_PATH}/test/.libs
 
 	# Remove build host references...
 	find "${D}${PTEST_PATH}/test/data" \( -name *.service -o -name *.conf -o -name "*.aaprofile" \) -type f -exec \
-- 
2.25.1



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

* Re: [PATCH V2 3/3] dbus-test: Replace cp -a/-r with portable options
  2020-03-10  1:15 ` [PATCH V2 3/3] dbus-test: Replace cp -a/-r with portable options Khem Raj
@ 2020-03-10  8:32   ` Richard Purdie
  0 siblings, 0 replies; 4+ messages in thread
From: Richard Purdie @ 2020-03-10  8:32 UTC (permalink / raw)
  To: Khem Raj, openembedded-core

On Mon, 2020-03-09 at 18:15 -0700, Khem Raj wrote:
> -r are not posix defined and -a leaks UID of
> build user into target
> 
> Errors like below are fixed when -a is used
> 
> bus/connection.h is owned by uid 1000, which is the same as t
> he user running bitbake. This may be due to host contamination
> 
> Signed-off-by: Khem Raj <raj.khem@gmail.com>
> ---
> v2: Improve commit message for clear reason for change
> 
>  meta/recipes-core/dbus/dbus-test_1.12.16.bb | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/meta/recipes-core/dbus/dbus-test_1.12.16.bb b/meta/recipes-core/dbus/dbus-test_1.12.16.bb
> index bea0e74ed0..91e2ba69d2 100644
> --- a/meta/recipes-core/dbus/dbus-test_1.12.16.bb
> +++ b/meta/recipes-core/dbus/dbus-test_1.12.16.bb
> @@ -70,11 +70,11 @@ do_install_ptest() {
>  
>  	install ${B}/test/test-segfault ${D}${PTEST_PATH}/test
>  
> -	cp -r ${B}/test/data ${D}${PTEST_PATH}/test
> +	cp -R --no-dereference --preserve=mode,links ${B}/test/data ${D}${PTEST_PATH}/test
>  	install ${B}/dbus/.libs/test-dbus ${D}${PTEST_PATH}/test
>  
>  	install -d ${D}${PTEST_PATH}/test/.libs
> -	cp -a ${B}/dbus/.libs/*.so* ${D}${PTEST_PATH}/test/.libs
> +	cp -R --no-dereference --preserve=mode,links ${B}/dbus/.libs/*.so* ${D}${PTEST_PATH}/test/.libs
>  
>  	# Remove build host references...
>  	find "${D}${PTEST_PATH}/test/data" \( -name *.service -o -name *.conf -o -name "*.aaprofile" \) -type f -exec \

I still want to understand why only you are seeing this first.

The implication is that we have to change most uses of "cp -r" for "cp -R --no-dereference --preserve=mode,links
" in OE-Core and every other OE layer.

If we have to do that, fine, but I do want to understand what set of
circumstances triggers the issue first.

Cheers,

Richard



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

end of thread, other threads:[~2020-03-10  8:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-10  1:15 [PATCH V2 1/3] ruby: Use arm32 for coroutines on 32bit-arm Khem Raj
2020-03-10  1:15 ` [PATCH V2 2/3] valgrind: Fix timerfd syscall test to be 64bit time_t safe Khem Raj
2020-03-10  1:15 ` [PATCH V2 3/3] dbus-test: Replace cp -a/-r with portable options Khem Raj
2020-03-10  8:32   ` Richard Purdie

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.