From d7bbdfe0e0222aea2a7af1c8c76dfd868f23694d Mon Sep 17 00:00:00 2001 From: Yichao Yu Date: Sun, 8 Oct 2017 20:56:41 -0400 Subject: [PATCH] Misc threading related compilation fixes * Without threading enabled * On archs without known way to emit ELF thread pointers (ARMv6, power) Fix #24051 --- src/julia_threads.h | 4 ++-- src/llvm-ptls.cpp | 1 + src/tls.h | 4 +++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/julia_threads.h b/src/julia_threads.h index d76ee0212b3d1..ac0289c5be146 100644 --- a/src/julia_threads.h +++ b/src/julia_threads.h @@ -81,7 +81,7 @@ typedef struct { // This includes all the thread local states we care about for a thread. #define JL_MAX_BT_SIZE 80000 -typedef struct _jl_tls_states_t { +struct _jl_tls_states_t { struct _jl_gcframe_t *pgcstack; size_t world_age; struct _jl_value_t *exception_in_transit; @@ -130,7 +130,7 @@ typedef struct _jl_tls_states_t { int finalizers_inhibited; arraylist_t finalizers; jl_gc_mark_cache_t gc_cache; -} jl_tls_states_t; +}; // Update codegen version in `ccall.cpp` after changing either `pause` or `wake` #ifdef __MIC__ diff --git a/src/llvm-ptls.cpp b/src/llvm-ptls.cpp index df0f5304ee905..c060bf31e30e6 100644 --- a/src/llvm-ptls.cpp +++ b/src/llvm-ptls.cpp @@ -136,6 +136,7 @@ static Instruction *emit_ptls_tp(LLVMContext &ctx, Value *offset, Type *T_ppjlva #elif defined(_CPU_X86_) const char *asm_str = "movl %gs:0, $0"; #else + const char *asm_str = nullptr; assert(0 && "Cannot emit thread pointer for this architecture."); #endif if (!offset) { diff --git a/src/tls.h b/src/tls.h index 678867d4c7b35..55be0a78290fd 100644 --- a/src/tls.h +++ b/src/tls.h @@ -16,7 +16,9 @@ static inline unsigned long JL_CONST_FUNC jl_thread_self(void) #endif } -typedef struct _jl_tls_states_t *jl_ptls_t; +typedef struct _jl_tls_states_t jl_tls_states_t; + +typedef jl_tls_states_t *jl_ptls_t; #ifdef __cplusplus extern "C" {