Bug 2143992 - gdb: C99 porting help
Summary: gdb: C99 porting help
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: gdb
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Keith Seitz
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: PortingToModernCHelpNeeded
TreeView+ depends on / blocked
 
Reported: 2022-11-18 16:16 UTC by Florian Weimer
Modified: 2022-11-30 18:21 UTC (History)
11 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2022-11-30 18:21:20 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
libiberty config.log (232.54 KB, text/plain)
2022-11-18 16:16 UTC, Florian Weimer
no flags Details
gdb config.log (41.62 KB, text/plain)
2022-11-18 16:16 UTC, Florian Weimer
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 2144041 0 unspecified CLOSED binutils: Port to modern C 2022-11-24 12:35:23 UTC

Internal Links: 2144041

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.


Note You need to log in before you can comment on or make changes to this bug.