The libgcc stubs aren't necessary if building this when using compiler-rt, after those stubs are available.
Just make the fake libgcc assembly file a no-op if targeting another architecture. Signed-off-by: Martin Storsjö <mar...@martin.st> --- mingw-w64-libraries/winpthreads/src/libgcc/dll_dependency.S | 2 ++ mingw-w64-libraries/winpthreads/src/spinlock.c | 6 ++++++ mingw-w64-libraries/winpthreads/src/thread.c | 6 +++++- 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/mingw-w64-libraries/winpthreads/src/libgcc/dll_dependency.S b/mingw-w64-libraries/winpthreads/src/libgcc/dll_dependency.S index 2262eb0..0496e94 100644 --- a/mingw-w64-libraries/winpthreads/src/libgcc/dll_dependency.S +++ b/mingw-w64-libraries/winpthreads/src/libgcc/dll_dependency.S @@ -1,4 +1,5 @@ /* Implementation for gcc's internal stack-allocation routines. */ +#if defined(__i386__) || defined(__x86_64__) .global ___chkstk .global __alloca @@ -86,3 +87,4 @@ chkstk_end: pushl 4(%eax) ret #endif +#endif diff --git a/mingw-w64-libraries/winpthreads/src/spinlock.c b/mingw-w64-libraries/winpthreads/src/spinlock.c index e55e929..2032d60 100644 --- a/mingw-w64-libraries/winpthreads/src/spinlock.c +++ b/mingw-w64-libraries/winpthreads/src/spinlock.c @@ -53,7 +53,13 @@ pthread_spin_lock (pthread_spinlock_t *lock) volatile spinlock_word_t *lk = (volatile spinlock_word_t *)lock; while (unlikely(__sync_lock_test_and_set(lk, 0) == 0)) do { +#if defined(__i386__) || defined(__x86_64__) asm("pause" ::: "memory"); +#elif defined(__arm__) || defined(__aarch64__) + asm("wfe" ::: "memory"); +#else +#error Unsupported architecture +#endif } while (*lk == 0); return 0; } diff --git a/mingw-w64-libraries/winpthreads/src/thread.c b/mingw-w64-libraries/winpthreads/src/thread.c index fafd915..2b7c7be 100644 --- a/mingw-w64-libraries/winpthreads/src/thread.c +++ b/mingw-w64-libraries/winpthreads/src/thread.c @@ -1237,8 +1237,12 @@ pthread_cancel (pthread_t t) GetThreadContext(tv->h, &ctxt); #ifdef _M_X64 ctxt.Rip = (uintptr_t) _pthread_invoke_cancel; -#else +#elif defined(_M_IX86) ctxt.Eip = (uintptr_t) _pthread_invoke_cancel; +#elif defined(_M_ARM) || defined(_M_ARM64) + ctxt.Pc = (uintptr_t) _pthread_invoke_cancel; +#else +#error Unsupported architecture #endif SetThreadContext (tv->h, &ctxt); -- 2.7.4 ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ Mingw-w64-public mailing list Mingw-w64-public@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mingw-w64-public