diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog index 16e56967ce8..f7fc8214ffd 100644 --- a/libgcc/ChangeLog +++ b/libgcc/ChangeLog @@ -1,3 +1,8 @@ +2019-11-18 Szabolcs Nagy + + * config.host: Add t-gthr-noweak on *-*-musl*. + * config/t-gthr-noweak: New file. + 2019-11-17 John David Anglin * config/pa/linux-atomic.c (__kernel_cmpxchg): Change argument 1 to diff --git a/libgcc/config.host b/libgcc/config.host index 303516879cd..bc3e497739f 100644 --- a/libgcc/config.host +++ b/libgcc/config.host @@ -1531,3 +1531,10 @@ vxworks) ;; esac esac + +case ${host} in +*-*-musl*) + # The gthr weak references are unsafe with static linking + tmake_file="$tmake_file t-gthr-noweak" + ;; +esac diff --git a/libgcc/config/t-gthr-noweak b/libgcc/config/t-gthr-noweak new file mode 100644 index 00000000000..45a21e9361d --- /dev/null +++ b/libgcc/config/t-gthr-noweak @@ -0,0 +1,2 @@ +# Don't use weak references for single-thread detection +HOST_LIBGCC2_CFLAGS += -DGTHREAD_USE_WEAK=0