+2018-07-25 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR target/86560
+ * asan/asan_interceptors.cc (swapcontext) Cherry-pick
+ compiler-rt revision 337603.
+ * sanitizer_common/sanitizer_internal_defs.h (__has_attribute):
+ Likewise.
+
2018-07-05 Jakub Jelinek <jakub@redhat.com>
Revert
uptr stack, ssize;
ReadContextStack(ucp, &stack, &ssize);
ClearShadowMemoryForContextStack(stack, ssize);
+#if __has_attribute(__indirect_return__) && \
+ (defined(__x86_64__) || defined(__i386__))
+ int (*real_swapcontext)(struct ucontext_t *, struct ucontext_t *)
+ __attribute__((__indirect_return__))
+ = REAL(swapcontext);
+ int res = real_swapcontext(oucp, ucp);
+#else
int res = REAL(swapcontext)(oucp, ucp);
+#endif
// swapcontext technically does not return, but program may swap context to
// "oucp" later, that would look as if swapcontext() returned 0.
// We need to clear shadow for ucp once again, as it may be in arbitrary
# define __has_feature(x) 0
#endif
+// Older GCCs do not understand __has_attribute.
+#if !defined(__has_attribute)
+# define __has_attribute(x) 0
+#endif
+
// For portability reasons we do not include stddef.h, stdint.h or any other
// system header, but we do need some basic types that are not defined
// in a portable way by the language itself.