public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libgcc/111322] New: non-canonical reference to canonical protected function `__pthread_key_create'
@ 2023-09-07  8:27 judge.packham at gmail dot com
  2023-09-07  8:31 ` [Bug libgcc/111322] " pinskia at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: judge.packham at gmail dot com @ 2023-09-07  8:27 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111322

            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=55849&action=edit
Exclude UCLIBC from GLIBC thread check

With binutils-2.40, uClibc-ng-1.0.43 and gcc-13.2.0 the following link error 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_create()
to detect the use of pthreads with GNU libc but because uclibc-ng also defines
__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.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug libgcc/111322] non-canonical reference to canonical protected function `__pthread_key_create'
  2023-09-07  8:27 [Bug libgcc/111322] New: non-canonical reference to canonical protected function `__pthread_key_create' judge.packham at gmail dot com
@ 2023-09-07  8:31 ` pinskia at gcc dot gnu.org
  2023-09-07  8:44 ` judge.packham at gmail dot com
  2023-09-07  9:06 ` wbx at openadk dot org
  2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-09-07  8:31 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111322

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
uclibc should 100% not be defining __GLIBC__  at all ..

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug libgcc/111322] non-canonical reference to canonical protected function `__pthread_key_create'
  2023-09-07  8:27 [Bug libgcc/111322] New: non-canonical reference to canonical protected function `__pthread_key_create' judge.packham at gmail dot com
  2023-09-07  8:31 ` [Bug libgcc/111322] " pinskia at gcc dot gnu.org
@ 2023-09-07  8:44 ` judge.packham at gmail dot com
  2023-09-07  9:06 ` wbx at openadk dot org
  2 siblings, 0 replies; 4+ messages in thread
From: judge.packham at gmail dot com @ 2023-09-07  8:44 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111322

--- Comment #2 from Chris Packham <judge.packham at gmail dot com> ---
I don't disagree but it appears to have been that way for some time. There are
other instances of the __GLIBC__ && !__UCLIBC__ in other corners

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug libgcc/111322] non-canonical reference to canonical protected function `__pthread_key_create'
  2023-09-07  8:27 [Bug libgcc/111322] New: non-canonical reference to canonical protected function `__pthread_key_create' judge.packham at gmail dot com
  2023-09-07  8:31 ` [Bug libgcc/111322] " pinskia at gcc dot gnu.org
  2023-09-07  8:44 ` judge.packham at gmail dot com
@ 2023-09-07  9:06 ` wbx at openadk dot org
  2 siblings, 0 replies; 4+ messages in thread
From: wbx at openadk dot org @ 2023-09-07  9:06 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111322

Waldemar Brodkorb <wbx at openadk dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |wbx at openadk dot org

--- Comment #3 from Waldemar Brodkorb <wbx at openadk dot org> ---
uClibc is doing this nearly since the beginning (commit
f91e94f6c5a1f1d6dfd3e5a535df303b805bf321 in 2001). I think normally this is
okay, because uClibc tries to be compatible to glibc. There are cornercases
like this issue. I think the patch is useful and should be applied.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-09-07  9:06 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-07  8:27 [Bug libgcc/111322] New: non-canonical reference to canonical protected function `__pthread_key_create' judge.packham at gmail dot com
2023-09-07  8:31 ` [Bug libgcc/111322] " pinskia at gcc dot gnu.org
2023-09-07  8:44 ` judge.packham at gmail dot com
2023-09-07  9:06 ` wbx at openadk dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).