Bug 2140618

Summary: ldbl redirects for syslog.h are incompatible with clang
Product: [Fedora] Fedora Reporter: Nikita Popov <npopov>
Component: glibcAssignee: Carlos O'Donell <codonell>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: aoliva, arjun.is, codonell, dan, dj, fweimer, law, mcermak, mcoufal, mfabian, omajid, pfrankli, rth, sipoyare, skolosov, tuliom
Target Milestone: ---Keywords: Bugfix
Target Release: ---   
Hardware: ppc64le   
OS: Unspecified   
Whiteboard:
Fixed In Version: glibc-2.36.9000-16.fc38, glibc-2.35-22.fc36, glibc-2.36-9.fc37 glibc-2.35-22.fc36 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-01-27 08:48:37 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1071880    

Description Nikita Popov 2022-11-07 11:05:13 UTC
This is a continuation of #2100546 and #2115752, but for the syslog.h header. To reproduce, run the following on ppc64le:

dnf install clang
echo "#include <syslog.h>" > test.c
clang -mabi=ieeelongdouble -O2 -D_FORTIFY_SOURCE=1 test.c

This results in:

/usr/include/bits/syslog-ldbl.h:33:1: error: cannot apply asm label to function after its first use
__LDBL_REDIR2_DECL (vsyslog_chk)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/sys/cdefs.h:573:30: note: expanded from macro '__LDBL_REDIR2_DECL'
  extern __typeof (__##name) __##name \
                             ^
<scratch space>:30:1: note: expanded from here
__vsyslog_chk

The sys/syslog.h header includes bits/syslog.h, which uses __vsyslog_chk, and then includes bits/syslog-ldbl.h afterwards, which adds an asm label to __vsyslog_chk, which is not supported by clang.

I expect this will need a similar fix as previously applied to stdio.h and wchar.h.

I also ran

for f in /usr/include/*.h; do echo $f; printf "#include <$f>\nint main() { return 0; }" > test.c; clang -mabi=ieeelongdouble -O2 -D_FORTIFY_SOURCE=1 test.c; done

to check if there are any more headers exhibiting this issue, but syslog.h appears to be the last one.

Comment 2 Tulio Magno Quites Machado Filho 2022-11-16 15:10:53 UTC
I posted a patch on libc-alpha fixing this issue: https://patchwork.sourceware.org/project/glibc/patch/20221116150803.1990947-1-tuliom@ascii.art.br/

Comment 3 Florian Weimer 2022-11-22 14:01:55 UTC
*** Bug 2144638 has been marked as a duplicate of this bug. ***

Comment 6 Carlos O'Donell 2022-12-06 14:07:57 UTC
Fixed in Fedora 38. Keeping this open to fix this in F37, F36, and F35 (though it EOLs 2022-12-13).

Comment 7 Nikita Popov 2022-12-12 17:08:44 UTC
Looks like the relevant update is https://bodhi.fedoraproject.org/updates/FEDORA-2022-344825e8ec. Unfortunately it got stuck due to a spurious looking gating failure (just says "error").

Comment 8 Florian Weimer 2022-12-12 17:16:45 UTC
(In reply to Nikita Popov from comment #7)
> Looks like the relevant update is
> https://bodhi.fedoraproject.org/updates/FEDORA-2022-344825e8ec.
> Unfortunately it got stuck due to a spurious looking gating failure (just
> says "error").

Hmm. I've requested a fresh test run.

Comment 9 Nikita Popov 2022-12-15 15:42:10 UTC
The next build went in, and I can confirm that compiler-rt now builds successfully on ppc64le. Thanks everyone!

Comment 11 Fedora Update System 2023-01-11 12:19:16 UTC
FEDORA-2023-981efe22aa has been submitted as an update to Fedora 36. https://bodhi.fedoraproject.org/updates/FEDORA-2023-981efe22aa

Comment 12 Fedora Update System 2023-01-12 02:41:46 UTC
FEDORA-2023-981efe22aa has been pushed to the Fedora 36 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2023-981efe22aa`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2023-981efe22aa

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 14 Fedora Update System 2023-01-27 08:48:37 UTC
FEDORA-2023-981efe22aa has been pushed to the Fedora 36 stable repository.
If problem still persists, please make note of it in this bug report.