0004-gcc-xtensa-don-t-force-PIC-for-uclinux-target.patch 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. From 960a2552f7b418134cdf7a31e96023a3811b98dd Mon Sep 17 00:00:00 2001
  2. From: Max Filippov <jcmvbkbc@gmail.com>
  3. Date: Sun, 4 Nov 2018 23:55:59 -0800
  4. Subject: [PATCH] gcc: xtensa: don't force PIC for uclinux target
  5. xtensa-uclinux uses bFLT executable file format that cannot relocate
  6. fields representing offsets from data to code. C++ objects built as PIC
  7. use offsets to encode FDE structures. As a result C++ exception handling
  8. doesn't work correctly on xtensa-uclinux. Don't use PIC by default on
  9. xtensa-uclinux.
  10. gcc/
  11. 2018-11-05 Max Filippov <jcmvbkbc@gmail.com>
  12. * config/xtensa/uclinux.h (XTENSA_ALWAYS_PIC): Change to 0.
  13. Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
  14. ---
  15. Backported from: r265823
  16. gcc/config/xtensa/uclinux.h | 4 ++--
  17. 1 file changed, 2 insertions(+), 2 deletions(-)
  18. diff --git a/gcc/config/xtensa/uclinux.h b/gcc/config/xtensa/uclinux.h
  19. index ba26187c8f7a..c7743df9d97c 100644
  20. --- a/gcc/config/xtensa/uclinux.h
  21. +++ b/gcc/config/xtensa/uclinux.h
  22. @@ -59,8 +59,8 @@ along with GCC; see the file COPYING3. If not see
  23. #undef LOCAL_LABEL_PREFIX
  24. #define LOCAL_LABEL_PREFIX "."
  25. -/* Always enable "-fpic" for Xtensa Linux. */
  26. -#define XTENSA_ALWAYS_PIC 1
  27. +/* Don't enable "-fpic" for Xtensa uclinux. */
  28. +#define XTENSA_ALWAYS_PIC 0
  29. #undef TARGET_LIBC_HAS_FUNCTION
  30. #define TARGET_LIBC_HAS_FUNCTION no_c99_libc_has_function
  31. --
  32. 2.11.0