Bug 2414774

Summary: gretl fails to build on s390x
Product: [Fedora] Fedora Reporter: hannes <johannes.lips>
Component: gretlAssignee: hannes <johannes.lips>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: rawhideCC: dmalcolm, fweimer, jakub, jlaw, johannes.lips, josmyers, jwakely, mcermak, mpolacek, msebor, nickc, nixuser, sipoyare
Target Milestone: ---   
Target Release: ---   
Hardware: s390x   
OS: Linux   
Whiteboard:
Fixed In Version: gretl-2025c-1.fc42 gretl-2025c-1.fc43 Doc Type: ---
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2025-11-22 01:17:13 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
build.log
none
root.log
none
dnf5.log none

Description hannes 2025-11-13 06:09:41 UTC
Trying to update gretl, it fails in rawhide to build from source on the s390x hardware.
https://koji.fedoraproject.org/koji/taskinfo?taskID=138870883

Reproducible: Always

Comment 1 hannes 2025-11-13 06:10:25 UTC
Created attachment 2114229 [details]
build.log

Comment 2 hannes 2025-11-13 06:10:47 UTC
Created attachment 2114230 [details]
root.log

Comment 3 hannes 2025-11-13 06:11:13 UTC
Created attachment 2114231 [details]
dnf5.log

Comment 4 Jakub Jelinek 2025-11-13 06:24:38 UTC
That looks like a package bug to me.
lib/src/foreign_db.c has
#if G_BYTE_ORDER == G_BIG_ENDIAN
            reverse_double(x);
#endif
in it (so on big endian it tries to use reverse_double, on other arches it doesn't, that is why it compiles fine on all other arches (those are little endian).
reverse_double is a macro defined in lib/src/swap_bytes.h:
#define reverse_double(x) swap_bytes_double(x, x)
In the same directory both gretl_xml.c and matrix_extra.c use reverse_double too, but both include the correct header for it:
#include "swap_bytes.h"
while foreign_db.c does not.
Just add that include there and it should build.

Comment 5 hannes 2025-11-13 06:56:58 UTC
Thanks a lot Jakub, I was expecting a s390x build issue, so sorry for the noise.

Comment 6 Fedora Update System 2025-11-13 22:34:04 UTC
FEDORA-2025-46d98c922f (gretl-2025c-1.fc42) has been submitted as an update to Fedora 42.
https://bodhi.fedoraproject.org/updates/FEDORA-2025-46d98c922f

Comment 7 Fedora Update System 2025-11-13 22:34:05 UTC
FEDORA-2025-ec856d3700 (gretl-2025c-1.fc43) has been submitted as an update to Fedora 43.
https://bodhi.fedoraproject.org/updates/FEDORA-2025-ec856d3700

Comment 8 Fedora Update System 2025-11-14 02:02:42 UTC
FEDORA-2025-ec856d3700 has been pushed to the Fedora 43 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2025-ec856d3700`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2025-ec856d3700

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

Comment 9 Fedora Update System 2025-11-14 02:42:54 UTC
FEDORA-2025-46d98c922f has been pushed to the Fedora 42 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2025-46d98c922f`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2025-46d98c922f

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

Comment 10 Fedora Update System 2025-11-22 01:17:13 UTC
FEDORA-2025-46d98c922f (gretl-2025c-1.fc42) has been pushed to the Fedora 42 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 11 Fedora Update System 2025-11-22 01:35:36 UTC
FEDORA-2025-ec856d3700 (gretl-2025c-1.fc43) has been pushed to the Fedora 43 stable repository.
If problem still persists, please make note of it in this bug report.