Bug 1668822

Summary: glibc: FTBFS due to GCC 9 warnings in nonshared libraries related to source fortification
Product: [Fedora] Fedora Reporter: Florian Weimer <fweimer>
Component: glibcAssignee: Florian Weimer <fweimer>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: high    
Version: rawhideCC: aoliva, arjun.is, codonell, dj, fweimer, law, mfabian, pfrankli, rth, siddhesh
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: glibc-headers-2.28.9000-34 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-01-25 13:38:59 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: 1576372    

Description Florian Weimer 2019-01-23 16:21:00 UTC
Attributes are inconsistent for the printf redirects in libnldbl_nonshared.a, and GCC 9 warns about that.

I will try to build the nonshared bits with annobin disabled and an assembler override present.

Comment 1 Florian Weimer 2019-01-25 13:38:59 UTC
cat > t.c <<EOF
#include <sys/stat.h>
#include <stdio.h>
	
int
main (void)
{
	printf ("%p\n", stat);
	printf ("%p\n", stat64);
}
EOF
gcc -D_GNU_SOURCE `rpm --eval "%{build_cflags} %{build_ldflags}"` t.c
annocheck -v a.out

Result:

$ annocheck -v a.out
annocheck: Version 8.69.
Hardened: a.out: PASS: No gaps found.
Hardened: a.out: PASS: Linked with -Wl,-z,now.
Hardened: a.out: PASS: Compiled with -fcf-protection.
Hardened: a.out: PASS: One dynamic section/segment found.
Hardened: a.out: PASS: Entry point instruction is ENDBR.
Hardened: a.out: PASS: Compiled with -D_FORTIFY_SOURCE=2.
Hardened: a.out: PASS: Compiled with -D_GLIBCXX_ASSERTIONS.
Hardened: a.out: PASS: Linked with -Wl,-z,relro.
Hardened: a.out: PASS: Stack not executable.
Hardened: a.out: PASS: Compiled with sufficient optimization.
Hardened: a.out: PASS: Compiled with PIC/PIE.
Hardened: a.out: PASS: Compiled as a position independent binary.
Hardened: a.out: PASS: Good GNU Property note.
Hardened: a.out: PASS: DT_RPATH/DT_RUNPATH absent or rooted at /usr.
Hardened: a.out: PASS: No RWX segments found.
Hardened: a.out: PASS: Consistent use of the -fshort-enum option.
Hardened: a.out: PASS: Compiled with -fstack-clash-protection.
Hardened: a.out: PASS: Compiled with sufficient stack protection.
Hardened: a.out: skip: Test for stack realignment support.  (Only needed on i686 binaries).
Hardened: a.out: PASS: No text relocations found.
Hardened: a.out: PASS: No thread cancellation problems.
Hardened: a.out: PASS: GOT/PLT relocations are read only.
Hardened: a.out: PASS.

So this is fixed: glibc builds again, and the nonshared bits are still annocheck-exempted.

Comment 2 Florian Weimer 2019-10-15 13:27:23 UTC
*** Bug 1576363 has been marked as a duplicate of this bug. ***