0001-libpthread-modify-CFLAGS-pthread_once.c-to-avoid-ear.patch 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. From 82cc57d5a508dbd7a2f578dc13f91dafda4d6cd9 Mon Sep 17 00:00:00 2001
  2. From: Yang Yingliang <yangyingliang@huawei.com>
  3. Date: Fri, 29 Aug 2014 11:21:30 +0800
  4. Subject: [PATCH] libpthread: modify CFLAGS-pthread_once.c to avoid earlier
  5. setting being replaced
  6. I use uclibc in arch arm. The CFLAGS-pthread_once.c has been set
  7. to -DNOT_IN_libc -DIS_IN_libpthread in
  8. libpthread/nptl/sysdeps/unix/sysv/linux/arm/Makefile.arch.
  9. But it will be replaced by -fexceptions -fasynchronous-unwind-tables in
  10. libpthread/nptl/Makefile.in.
  11. If CFLAGS-pthread_once.c has no -DIS_IN_libpthread the testcase
  12. tst-once3 in test/nptl/ will be failed. The reason is pthread_once
  13. calls another pthread_cleanup_push() which is not under IS_IN_libpthread
  14. so that clear_once_control do not be called when the thread is canceled.
  15. So pthread_once will hang up when it's called second time.
  16. Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
  17. Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
  18. ---
  19. libpthread/nptl/Makefile.in | 2 +-
  20. 1 file changed, 1 insertion(+), 1 deletion(-)
  21. diff --git a/libpthread/nptl/Makefile.in b/libpthread/nptl/Makefile.in
  22. index 0008822..1b9ba8c 100644
  23. --- a/libpthread/nptl/Makefile.in
  24. +++ b/libpthread/nptl/Makefile.in
  25. @@ -186,7 +186,7 @@ CFLAGS-forward.c = -fexceptions
  26. CFLAGS-pthread_testcancel.c = -fexceptions
  27. CFLAGS-pthread_join.c = -fexceptions -fasynchronous-unwind-tables
  28. CFLAGS-pthread_timedjoin.c = -fexceptions -fasynchronous-unwind-tables
  29. -CFLAGS-pthread_once.c = $(uses-callbacks) -fexceptions \
  30. +CFLAGS-pthread_once.c += $(uses-callbacks) -fexceptions \
  31. -fasynchronous-unwind-tables
  32. CFLAGS-pthread_cond_wait.c = -fexceptions -fasynchronous-unwind-tables
  33. CFLAGS-pthread_cond_timedwait.c = -fexceptions -fasynchronous-unwind-tables
  34. --
  35. 2.0.1