Bug 2336261 - RdRand fails to build with GCC 15 / C23 ("conflicting types for 'keys_change'; have 'int(int)'")
Summary: RdRand fails to build with GCC 15 / C23 ("conflicting types for 'keys_change'...
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: RdRand
Version: rawhide
Hardware: Unspecified
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Jonathan Wright
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: gcc-15-mass-prebuild
TreeView+ depends on / blocked
 
Reported: 2025-01-07 22:32 UTC by Dave Malcolm
Modified: 2025-01-17 13:05 UTC (History)
4 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2025-01-17 13:05:47 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Dave Malcolm 2025-01-07 22:32:38 UTC
I'm experimentally rebuilding rawhide with the not-yet-released GCC 15 to see if anything breaks, and to help write the porting guide.  See https://fedoraproject.org/wiki/User:Dmalcolm/gcc-15

My test build with GCC 15 failed:
https://copr.fedorainfracloud.org/coprs/dmalcolm/gcc-15-smoketest-3.failed/build/8476050/

whereas my test build with GCC 14 succeeded:
https://copr.fedorainfracloud.org/coprs/dmalcolm/gcc-15-smoketest-3.failed.checker/build/8477597/


Looking at the failure logs
https://download.copr.fedorainfracloud.org/results/dmalcolm/gcc-15-smoketest-3.failed/fedora-rawhide-x86_64/08476050-RdRand/builder-live.log.gz

I see:

src/librdrand-aes.c:512:5: error: conflicting types for 'keys_change'; have 'int(int)'
  512 | int keys_change(int rotate) {
      |     ^~~~~~~~~~~
In file included from src/librdrand-aes.c:33:
src/./librdrand-aes.private.h:75:5: note: previous declaration of 'keys_change' with type 'int(void)'
   75 | int keys_change();
      |     ^~~~~~~~~~~

This is probably due to GCC 15 now defaulting to -std=gnu23, whereas GCC 14 defaulted to -std=gnu17, and C23 is stricter about function prototypes than C17.  It's probably fixable by fixing the function prototypes (or by manually adding -std=gnu17 to the C build flags)

Reproducible: Always

Comment 1 Jiri Hladky 2025-01-11 03:13:44 UTC
Thanks for the report, Dave! 

I have fixed the source code and released the 2.1.6 version with the fix.
https://github.com/jirka-h/RdRand/releases

I have pushed the changes to rawhide - check this build
https://koji.fedoraproject.org/koji/taskinfo?taskID=127753487

Could you please verify that RdRand-2.1.6-1 compiles with GCC v15?

Thank you
Jirka

Comment 2 Siddhesh Poyarekar 2025-01-17 13:05:47 UTC
Succeeded in the mass rebuild, thanks!

https://koji.fedoraproject.org/koji/buildinfo?buildID=2616827


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