From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 194B73858D20; Thu, 7 Sep 2023 08:27:59 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 194B73858D20 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1694075279; bh=XroTLt5x5QOlUrcKzNsib/Q/wl0gjPJ65Sc1jANlyCU=; h=From:To:Subject:Date:From; b=G133F+LoFQPIcbJ7MNKocstE2Cwxcp/MGmZPYiqpdDQmsj0YFzhSUSXaIgzEoZ+PC KEOr4t7DUncAh9ShBcwAzNXJY6FjGTmLYbdEuYnTCBp+GLEFaZugIgWEXK6AsSRNF+ SoHchSCk5s+654g1G8czNWGdGRX34uURN+4wA4tI= From: "judge.packham at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug libgcc/111322] New: non-canonical reference to canonical protected function `__pthread_key_create' Date: Thu, 07 Sep 2023 08:27:57 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libgcc X-Bugzilla-Version: 13.2.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: judge.packham at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone attachments.created Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D111322 Bug ID: 111322 Summary: non-canonical reference to canonical protected function `__pthread_key_create' Product: gcc Version: 13.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: libgcc Assignee: unassigned at gcc dot gnu.org Reporter: judge.packham at gmail dot com Target Milestone: --- Created attachment 55849 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=3D55849&action=3Dedit Exclude UCLIBC from GLIBC thread check With binutils-2.40, uClibc-ng-1.0.43 and gcc-13.2.0 the following link erro= r is seen for some C++ code (ISL in this case). ld.bfd: isl_test_cpp17.o: non-canonical reference to canonical protected function `__pthread_key_create' in x86_64-multilib-linux-uclibc/sysroot/lib64/libc.so.1 ld.bfd: failed to set dynamic section sizes: bad value The problem appears to be that GCC uses the presence of __pthread_key_creat= e() to detect the use of pthreads with GNU libc but because uclibc-ng also defi= nes __GLIBC__ it ends up using the same symbol which for uclibc-ng is marked protected. It looks as though the intended symbol should be pthread_cancel(= ) as for other libcs. The attached patch is my attempt to resolve the issue.=