summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Watson <davejwatson@fb.com>2019-04-11 09:04:03 -0700
committerDave Watson <davejwatson@fb.com>2019-04-11 09:10:23 -0700
commit19f980485e901299dba03526a0bb923349bfb956 (patch)
treef9413dda09d956ce7e21dfb96efba63c4ad7b168
parent4ac3bbd869357c4e61ae849d3b0a5c6861f92471 (diff)
downloadlibunwind-19f980485e901299dba03526a0bb923349bfb956.tar.gz
x86_64: Fix tdep_init_done when built with libatomic_ops
Use correct size variable.
-rw-r--r--include/tdep-x86_64/libunwind_i.h4
-rw-r--r--src/x86_64/Gglobal.c6
2 files changed, 9 insertions, 1 deletions
diff --git a/include/tdep-x86_64/libunwind_i.h b/include/tdep-x86_64/libunwind_i.h
index 283525c1..93d925f2 100644
--- a/include/tdep-x86_64/libunwind_i.h
+++ b/include/tdep-x86_64/libunwind_i.h
@@ -232,7 +232,11 @@ dwarf_put (struct dwarf_cursor *c, dwarf_loc_t loc, unw_word_t val)
#define tdep_get_ip(c) ((c)->dwarf.ip)
#define tdep_big_endian(as) 0
+#ifdef HAVE_ATOMIC_OPS_H
+extern AO_t tdep_init_done;
+#else
extern int tdep_init_done;
+#endif
extern void tdep_init (void);
extern void tdep_init_mem_validate (void);
diff --git a/src/x86_64/Gglobal.c b/src/x86_64/Gglobal.c
index d0560582..9a7b1957 100644
--- a/src/x86_64/Gglobal.c
+++ b/src/x86_64/Gglobal.c
@@ -30,7 +30,11 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
#include "dwarf_i.h"
HIDDEN define_lock (x86_64_lock);
-HIDDEN sig_atomic_t tdep_init_done;
+#ifdef HAVE_ATOMIC_OPS_H
+ HIDDEN AO_t tdep_init_done;
+#else
+ HIDDEN int tdep_init_done;
+#endif
/* See comments for svr4_dbx_register_map[] in gcc/config/i386/i386.c. */