Bug 2143992

Summary: gdb: C99 porting help
Product: [Fedora] Fedora Reporter: Florian Weimer <fweimer>
Component: gdbAssignee: Keith Seitz <keiths>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: ahajkova, fweimer, guinevere, jan, keiths, kevinb, mcermak, nickc, pmuldoon, sam, sergiodj
Target Milestone: ---Keywords: FutureFeature
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-11-30 18:21:20 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: 2137512    
Attachments:
Description Flags
libiberty config.log
none
gdb config.log none

Description Florian Weimer 2022-11-18 16:16:10 UTC
Created attachment 1925370 [details]
libiberty config.log

The configure script uses implicit function declarations and implicit int.

The libiberty parts can probably be fixed by syncing from GCC (because I fixed it there).

The other issues appear to be in the downstream-only gdb-6.6-buildid-locate-rpm.patch patch.

It would be nice if this could be fixed in rawhide, so that it does not get flagged by my tester.

Comment 1 Florian Weimer 2022-11-18 16:16:39 UTC
Created attachment 1925383 [details]
gdb config.log

Comment 2 Florian Weimer 2022-11-18 16:18:43 UTC
In total, the tester currently flags:

conftest.c:107: defaulting to int
conftest.c:119: defaulting to int
conftest.c:121: implicit function declaration: exit
conftest.c:208: implicit function declaration: strncmp
conftest.c:206: implicit function declaration: strcpy
conftest.c:203: implicit function declaration: strlen
conftest.c:191: implicit function declaration: exit
conftest.c:183: defaulting to int
conftest.c:52: implicit function declaration: strerror
conftest.c:73: implicit function declaration: strcmp
conftest.c:107: defaulting to int
conftest.c:119: defaulting to int
conftest.c:121: implicit function declaration: exit
conftest.c:208: implicit function declaration: strncmp
conftest.c:206: implicit function declaration: strcpy
conftest.c:203: implicit function declaration: strlen
conftest.c:191: implicit function declaration: exit
conftest.c:183: defaulting to int
conftest.c:52: implicit function declaration: strerror
conftest.c:73: implicit function declaration: strcmp

Comment 3 Sam James 2022-11-18 18:48:21 UTC
The sims contain a bunch of issues as well, unfortunately: https://sourceware.org/bugzilla/show_bug.cgi?id=29752. But the configure stuff is obviously worse as it's not obvious.

Comment 4 Keith Seitz 2022-11-18 20:13:56 UTC
I've managed to reproduce this by following the below procedure.

Copy mock configuration from:
https://fedoraproject.org/wiki/Toolchain/PortingToModernC#Special_COPR_repository_with_instrumented_GCC

into rawhide directory as "fedora-rawhide-modernc.cfg". Then use mock to build:

$ fedpkg mockbuild --root fedora-rawhide-modernc.cfg --no-clean

After a while, you'll see:

*** GCC errors begin ***
conftest.c:119: defaulting to int
conftest.c:121: implicit function declaration: exit
conftest.c:107: defaulting to int
conftest.c:206: implicit function declaration: strcpy
conftest.c:191: implicit function declaration: exit
conftest.c:208: implicit function declaration: strncmp
conftest.c:183: defaulting to int
conftest.c:203: implicit function declaration: strlen
conftest.c:52: implicit function declaration: strerror
conftest.c:73: implicit function declaration: strcmp
conftest.c:121: implicit function declaration: exit
conftest.c:119: defaulting to int
conftest.c:107: defaulting to int
conftest.c:208: implicit function declaration: strncmp
conftest.c:191: implicit function declaration: exit
conftest.c:206: implicit function declaration: strcpy
conftest.c:203: implicit function declaration: strlen
conftest.c:183: defaulting to int
conftest.c:52: implicit function declaration: strerror
conftest.c:73: implicit function declaration: strcmp
*** GCC errors end ***

Comment 5 Nick Clifton 2022-11-23 16:31:57 UTC
(In reply to Keith Seitz from comment #4)
> I've managed to reproduce this by following the below procedure.

Thanks - that worked for me too, and helped me fix the equivalent
BZ for the binutils.  (2144041).

Comment 6 Nick Clifton 2022-11-24 12:28:48 UTC
(In reply to Florian Weimer from comment #0)
 
> The libiberty parts can probably be fixed by syncing from GCC (because I
> fixed it there).

In case it helps, Florian's patch is: 0001-libiberty-Fix-C89-isms-in-configure-tests.patch
commit: 885b6660c17f

Comment 7 Keith Seitz 2022-11-30 17:27:18 UTC
I have submitted a rawhide PR to address the discovered issues. The procedure in c#4 now no longer fails or outputs any "GCC errors".

https://src.fedoraproject.org/rpms/gdb/pull-request/52

Comment 8 Keith Seitz 2022-11-30 18:21:20 UTC
Merged into rawhide.