0013-invalid-tls-model.patch 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. From 3cdc85bcbcf6efe253b99ad357f105e221f5e4e8 Mon Sep 17 00:00:00 2001
  2. From: Szabolcs Nagy <nsz@port70.net>
  3. Date: Sun, 21 Jul 2019 21:23:53 +0000
  4. Subject: [PATCH 13/13] invalid tls model
  5. don't use initial-exec tls in shared libraries on musl targets.
  6. ---
  7. libgomp/configure.tgt | 3 +++
  8. libitm/configure.tgt | 3 +++
  9. 2 files changed, 6 insertions(+)
  10. diff --git a/libgomp/configure.tgt b/libgomp/configure.tgt
  11. index b88bf72fe3d..747d0485bf8 100644
  12. --- a/libgomp/configure.tgt
  13. +++ b/libgomp/configure.tgt
  14. @@ -17,6 +17,9 @@ if test $gcc_cv_have_tls = yes ; then
  15. *-*-k*bsd*-gnu*)
  16. ;;
  17. + *-*-musl*)
  18. + ;;
  19. +
  20. *-*-linux* | *-*-gnu*)
  21. XCFLAGS="${XCFLAGS} -ftls-model=initial-exec -DUSING_INITIAL_EXEC_TLS"
  22. ;;
  23. diff --git a/libitm/configure.tgt b/libitm/configure.tgt
  24. index 4c0b602034b..65e1c83550a 100644
  25. --- a/libitm/configure.tgt
  26. +++ b/libitm/configure.tgt
  27. @@ -31,6 +31,9 @@
  28. if test "$gcc_cv_have_tls" = yes ; then
  29. case "${target}" in
  30. + *-*-musl*)
  31. + ;;
  32. +
  33. # For x86, we use slots in the TCB head for most of our TLS.
  34. # The setup of those slots in beginTransaction can afford to
  35. # use the global-dynamic model.
  36. --
  37. 2.21.0