From 1559cbe1ebcea1dac3f5c3a40a51efedd7766ffc Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Sat, 7 Sep 2024 14:55:46 +0000 Subject: Initial commit Signed-off-by: Laurent Bercot --- ...ix-detection-of-atomic-builtins-in-libato.patch | 57 ++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 musl/patches-in-mcm/gcc-13.2.0/0028-configure-fix-detection-of-atomic-builtins-in-libato.patch (limited to 'musl/patches-in-mcm/gcc-13.2.0/0028-configure-fix-detection-of-atomic-builtins-in-libato.patch') diff --git a/musl/patches-in-mcm/gcc-13.2.0/0028-configure-fix-detection-of-atomic-builtins-in-libato.patch b/musl/patches-in-mcm/gcc-13.2.0/0028-configure-fix-detection-of-atomic-builtins-in-libato.patch new file mode 100644 index 0000000..f92fc7b --- /dev/null +++ b/musl/patches-in-mcm/gcc-13.2.0/0028-configure-fix-detection-of-atomic-builtins-in-libato.patch @@ -0,0 +1,57 @@ +From 5bbbd320e54ab5341cfba83e8af98685131caba1 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?S=C3=B6ren=20Tempel?= +Date: Sun, 29 Aug 2021 12:23:34 +0200 +Subject: [PATCH 28/35] configure: fix detection of atomic builtins in + libatomic configure script + +Alpine's --enable-autolink-libatomic (which is enabled for riscv64 by +default) causes the libatomic configure script to incorrectly detect +which builtins are available on riscv64. This then causes incorrect code +generation for libatomic since it assumes compiler builtins to be +available which are not actually available on riscv64. + +This commit fixes this issue by disabling linking of libatomic configure +test code entirely, thereby preventing linking against libatomic. + +See: + +* https://gitlab.alpinelinux.org/alpine/aports/-/issues/12948 +* https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101996#c6 +--- + libatomic/configure.tgt | 20 ++++++++++++++++++++ + 1 file changed, 20 insertions(+) + +diff --git a/libatomic/configure.tgt b/libatomic/configure.tgt +index a92ae9e8309..90b579ca4d8 100644 +--- a/libatomic/configure.tgt ++++ b/libatomic/configure.tgt +@@ -30,6 +30,26 @@ + # on ${target_cpu}. For example to allow proper use of multilibs. + configure_tgt_pre_target_cpu_XCFLAGS="${XCFLAGS}" + ++# The libatomic configure script performs several checks to determine ++# whether builtins for atomic operations are available. When compiling ++# with --enable-autolink-libatomic the test code compiled by the ++# configure script is also linked against libatomic. This causes it ++# to think that builtins are available, even if there are not, since ++# the tested symbols are provided by libatomic. ++# ++# This is a hack to ensure that we don't link against libatomic by not ++# linking any configure test code at all when --enable-autolink-libatomic ++# is given. ++# ++# See: ++# ++# * https://gitlab.alpinelinux.org/alpine/aports/-/issues/12817 ++# * https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101996#c4 ++# ++if test x$enable_autolink_libatomic = xyes; then ++ gcc_no_link=yes ++fi ++ + case "${target_cpu}" in + alpha*) + # fenv.c needs this option to generate inexact exceptions. +-- +2.41.0 + -- cgit v1.3.1