public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug stdio/27087] New: PowerPC: Redefinition error with Clang from IEEE redirection headers
@ 2020-12-17  7:38 qiu.chaofan at outlook dot com
  2021-10-08 12:33 ` [Bug stdio/27087] " tuliom at ascii dot art.br
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: qiu.chaofan at outlook dot com @ 2020-12-17  7:38 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=27087

            Bug ID: 27087
           Summary: PowerPC: Redefinition error with Clang from IEEE
                    redirection headers
           Product: glibc
           Version: 2.32
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: stdio
          Assignee: unassigned at sourceware dot org
          Reporter: qiu.chaofan at outlook dot com
  Target Milestone: ---

Program to re-produce:

    #include <stdio.h>
    int main(void) { return 0; }

Use clang (I tried with latest build, but recent releases should be all fine)
to compile this program with IEEE and optimization options:

    clang test.c -O3 -mabi=ieeelongdouble -I<HEADER_PATH>

An error would happen:

    In file included from test.c:1:
    In file included from /opt/at14.0-1-rc1/include/stdio.h:871:
    /opt/at14.0-1-rc1/include/bits/stdio-ldbl.h:26:20: error: cannot apply asm
label to function after its first use
    __LDBL_REDIR_DECL (vfprintf)
    ~~~~~~~~~~~~~~~~~~~^~~~~~~~~
    /opt/at14.0-1-rc1/include/sys/cdefs.h:461:26: note: expanded from macro
'__LDBL_REDIR_DECL'
      extern __typeof (name) name __asm (__ASMNAME ("__" #name "ieee128"));
                             ^           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Because under -O, clang (and gcc) defines macro `__USE_EXTERN_INLINES`. The
part is located before #include <bits/stdio-ldbl.h> stuff, so compiler
complains about the re-declaration conflict. Not sure why GCC is silent about
this yet.

By exchanging their position, the error would disappear.

Discussion in clang community about changing this error to warning
(https://reviews.llvm.org/D16171) may be a good reference.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

* [Bug stdio/27087] PowerPC: Redefinition error with Clang from IEEE redirection headers
  2020-12-17  7:38 [Bug stdio/27087] New: PowerPC: Redefinition error with Clang from IEEE redirection headers qiu.chaofan at outlook dot com
@ 2021-10-08 12:33 ` tuliom at ascii dot art.br
  2021-10-08 13:00 ` tuliom at ascii dot art.br
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: tuliom at ascii dot art.br @ 2021-10-08 12:33 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=27087

Tulio Magno Quites Machado Filho <tuliom at ascii dot art.br> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tuliom at ascii dot art.br
             Target|                            |powerpc64le-gnu-linux

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

* [Bug stdio/27087] PowerPC: Redefinition error with Clang from IEEE redirection headers
  2020-12-17  7:38 [Bug stdio/27087] New: PowerPC: Redefinition error with Clang from IEEE redirection headers qiu.chaofan at outlook dot com
  2021-10-08 12:33 ` [Bug stdio/27087] " tuliom at ascii dot art.br
@ 2021-10-08 13:00 ` tuliom at ascii dot art.br
  2022-06-23 16:46 ` fweimer at redhat dot com
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: tuliom at ascii dot art.br @ 2021-10-08 13:00 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=27087

Tulio Magno Quites Machado Filho <tuliom at ascii dot art.br> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|unassigned at sourceware dot org   |tuliom at ascii dot art.br

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

* [Bug stdio/27087] PowerPC: Redefinition error with Clang from IEEE redirection headers
  2020-12-17  7:38 [Bug stdio/27087] New: PowerPC: Redefinition error with Clang from IEEE redirection headers qiu.chaofan at outlook dot com
  2021-10-08 12:33 ` [Bug stdio/27087] " tuliom at ascii dot art.br
  2021-10-08 13:00 ` tuliom at ascii dot art.br
@ 2022-06-23 16:46 ` fweimer at redhat dot com
  2022-06-23 16:48 ` fweimer at redhat dot com
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: fweimer at redhat dot com @ 2022-06-23 16:46 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=27087

Florian Weimer <fweimer at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |fweimer at redhat dot com
             Status|UNCONFIRMED                 |ASSIGNED
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2022-06-23

--- Comment #1 from Florian Weimer <fweimer at redhat dot com> ---
A patch has been posted:

[PATCH] Apply asm redirections in stdio.h before first use [BZ #27087]
<https://sourceware.org/pipermail/libc-alpha/2021-December/134212.html>

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

* [Bug stdio/27087] PowerPC: Redefinition error with Clang from IEEE redirection headers
  2020-12-17  7:38 [Bug stdio/27087] New: PowerPC: Redefinition error with Clang from IEEE redirection headers qiu.chaofan at outlook dot com
                   ` (2 preceding siblings ...)
  2022-06-23 16:46 ` fweimer at redhat dot com
@ 2022-06-23 16:48 ` fweimer at redhat dot com
  2022-06-23 17:54 ` adhemerval.zanella at linaro dot org
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: fweimer at redhat dot com @ 2022-06-23 16:48 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=27087

Florian Weimer <fweimer at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           See Also|                            |https://bugzilla.redhat.com
                   |                            |/show_bug.cgi?id=2100546

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

* [Bug stdio/27087] PowerPC: Redefinition error with Clang from IEEE redirection headers
  2020-12-17  7:38 [Bug stdio/27087] New: PowerPC: Redefinition error with Clang from IEEE redirection headers qiu.chaofan at outlook dot com
                   ` (3 preceding siblings ...)
  2022-06-23 16:48 ` fweimer at redhat dot com
@ 2022-06-23 17:54 ` adhemerval.zanella at linaro dot org
  2022-06-23 18:27 ` fweimer at redhat dot com
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: adhemerval.zanella at linaro dot org @ 2022-06-23 17:54 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=27087

Adhemerval Zanella <adhemerval.zanella at linaro dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |adhemerval.zanella at linaro dot o
                   |                            |rg

--- Comment #2 from Adhemerval Zanella <adhemerval.zanella at linaro dot org> ---
I have some local patches that I need to polish to fix it for all definitions
(there are on my azanella/clang branch [1]). I think we will need to adjust
more function that Tulio's patch.

[1]
https://sourceware.org/git/?p=glibc.git;a=shortlog;h=refs/heads/azanella/clang

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

* [Bug stdio/27087] PowerPC: Redefinition error with Clang from IEEE redirection headers
  2020-12-17  7:38 [Bug stdio/27087] New: PowerPC: Redefinition error with Clang from IEEE redirection headers qiu.chaofan at outlook dot com
                   ` (4 preceding siblings ...)
  2022-06-23 17:54 ` adhemerval.zanella at linaro dot org
@ 2022-06-23 18:27 ` fweimer at redhat dot com
  2022-06-30 22:07 ` tuliom at ascii dot art.br
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: fweimer at redhat dot com @ 2022-06-23 18:27 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=27087

--- Comment #3 from Florian Weimer <fweimer at redhat dot com> ---
(In reply to Adhemerval Zanella from comment #2)
> I have some local patches that I need to polish to fix it for all
> definitions (there are on my azanella/clang branch [1]). I think we will
> need to adjust more function that Tulio's patch.
> 
> [1]
> https://sourceware.org/git/?p=glibc.git;a=shortlog;h=refs/heads/azanella/
> clang

My main concern is that this breaks the glibc headers on ppc64le, with clang
defaulting to float128 support. It's not just an issue for building glibc with
clang.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

* [Bug stdio/27087] PowerPC: Redefinition error with Clang from IEEE redirection headers
  2020-12-17  7:38 [Bug stdio/27087] New: PowerPC: Redefinition error with Clang from IEEE redirection headers qiu.chaofan at outlook dot com
                   ` (5 preceding siblings ...)
  2022-06-23 18:27 ` fweimer at redhat dot com
@ 2022-06-30 22:07 ` tuliom at ascii dot art.br
  2022-09-10  9:48 ` glaubitz at physik dot fu-berlin.de
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: tuliom at ascii dot art.br @ 2022-06-30 22:07 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=27087

--- Comment #4 from Tulio Magno Quites Machado Filho <tuliom at ascii dot art.br> ---
Version 2 of the patch sent to libc-alpha:
https://sourceware.org/pipermail/libc-alpha/2022-June/140313.html

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

* [Bug stdio/27087] PowerPC: Redefinition error with Clang from IEEE redirection headers
  2020-12-17  7:38 [Bug stdio/27087] New: PowerPC: Redefinition error with Clang from IEEE redirection headers qiu.chaofan at outlook dot com
                   ` (6 preceding siblings ...)
  2022-06-30 22:07 ` tuliom at ascii dot art.br
@ 2022-09-10  9:48 ` glaubitz at physik dot fu-berlin.de
  2022-11-17 14:37 ` tuliom at ascii dot art.br
  2022-11-29 22:36 ` tuliom at ascii dot art.br
  9 siblings, 0 replies; 11+ messages in thread
From: glaubitz at physik dot fu-berlin.de @ 2022-09-10  9:48 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=27087

John Paul Adrian Glaubitz <glaubitz at physik dot fu-berlin.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |glaubitz at physik dot fu-berlin.d
                   |                            |e

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

* [Bug stdio/27087] PowerPC: Redefinition error with Clang from IEEE redirection headers
  2020-12-17  7:38 [Bug stdio/27087] New: PowerPC: Redefinition error with Clang from IEEE redirection headers qiu.chaofan at outlook dot com
                   ` (7 preceding siblings ...)
  2022-09-10  9:48 ` glaubitz at physik dot fu-berlin.de
@ 2022-11-17 14:37 ` tuliom at ascii dot art.br
  2022-11-29 22:36 ` tuliom at ascii dot art.br
  9 siblings, 0 replies; 11+ messages in thread
From: tuliom at ascii dot art.br @ 2022-11-17 14:37 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=27087

Tulio Magno Quites Machado Filho <tuliom at ascii dot art.br> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           See Also|                            |https://bugzilla.redhat.com
                   |                            |/show_bug.cgi?id=2140618

--- Comment #6 from Tulio Magno Quites Machado Filho <tuliom at ascii dot art.br> ---
(In reply to Tulio Magno Quites Machado Filho from comment #5)
> While the initial issue has been fixed in glibc 2.36 and backported to 2.35,
> wchar.h is still affected by this.
> See the report in https://bugzilla.redhat.com/show_bug.cgi?id=2115752

The wchar.h issue has been fixed by c7509d49c4e8fa494120c5ead21338559dad16f5
for glibc 2.37.

A patch has been proposed for an error in syslog.h:
https://patchwork.sourceware.org/project/glibc/patch/20221116150803.1990947-1-tuliom@ascii.art.br/

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

* [Bug stdio/27087] PowerPC: Redefinition error with Clang from IEEE redirection headers
  2020-12-17  7:38 [Bug stdio/27087] New: PowerPC: Redefinition error with Clang from IEEE redirection headers qiu.chaofan at outlook dot com
                   ` (8 preceding siblings ...)
  2022-11-17 14:37 ` tuliom at ascii dot art.br
@ 2022-11-29 22:36 ` tuliom at ascii dot art.br
  9 siblings, 0 replies; 11+ messages in thread
From: tuliom at ascii dot art.br @ 2022-11-29 22:36 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=27087

Tulio Magno Quites Machado Filho <tuliom at ascii dot art.br> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|ASSIGNED                    |RESOLVED
   Target Milestone|---                         |2.37

--- Comment #7 from Tulio Magno Quites Machado Filho <tuliom at ascii dot art.br> ---
Fixed with the following commit for glibc 2.37:

commit 227df6243a2b5b4d70d11772d12c02eb9cb666ca
Author: Tulio Magno Quites Machado Filho <tuliom@redhat.com>
Date:   Fri Nov 11 17:00:15 2022 -0300

    Apply asm redirections in syslog.h before first use [BZ #27087]

    Similar to d0fa09a770, but for syslog.h when _FORTIFY_SOURCE > 0.
    Fixes [BZ #27087] by applying long double-related asm redirections
    before using functions in bits/syslog.h.

    Tested with build-many-glibcs.py.

    Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>

I plan to backport this fix to glibc 2.34, 2.35 and 2.36.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

end of thread, other threads:[~2022-11-29 22:36 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-17  7:38 [Bug stdio/27087] New: PowerPC: Redefinition error with Clang from IEEE redirection headers qiu.chaofan at outlook dot com
2021-10-08 12:33 ` [Bug stdio/27087] " tuliom at ascii dot art.br
2021-10-08 13:00 ` tuliom at ascii dot art.br
2022-06-23 16:46 ` fweimer at redhat dot com
2022-06-23 16:48 ` fweimer at redhat dot com
2022-06-23 17:54 ` adhemerval.zanella at linaro dot org
2022-06-23 18:27 ` fweimer at redhat dot com
2022-06-30 22:07 ` tuliom at ascii dot art.br
2022-09-10  9:48 ` glaubitz at physik dot fu-berlin.de
2022-11-17 14:37 ` tuliom at ascii dot art.br
2022-11-29 22:36 ` tuliom at ascii dot art.br

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).