Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 932841 - dev-lang/ruby-3.2.5 fails to compile on 32-bit: time.c:2325:35: error: passing argument 3 of split_second from incompatible pointer type [-Wincompatible-pointer-types]
Summary: dev-lang/ruby-3.2.5 fails to compile on 32-bit: time.c:2325:35: error: passin...
Status: CONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo Ruby Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: c99-porting gcc-14-stable
  Show dependency tree
 
Reported: 2024-05-27 10:51 UTC by Agostino Sarubbo
Modified: 2024-10-24 20:22 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build.log (build.log,109.89 KB, text/plain)
2024-05-27 10:51 UTC, Agostino Sarubbo
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Agostino Sarubbo gentoo-dev 2024-05-27 10:51:11 UTC
https://blogs.gentoo.org/ago/2020/07/04/gentoo-tinderbox/

Issue: dev-lang/ruby-3.2.4 fails to compile.
Discovered on: x86 (internal ref: tinderbox_x86)
System: GCC-14-SYSTEM (https://wiki.gentoo.org/wiki/Project:Tinderbox/Common_Issues_Helper#GCC-14)

Info about the issue:
https://wiki.gentoo.org/wiki/Project:Tinderbox/Common_Issues_Helper#CF0003
Comment 1 Agostino Sarubbo gentoo-dev 2024-05-27 10:51:12 UTC
Created attachment 894509 [details]
build.log

build log and emerge --info
Comment 2 matoro archtester 2024-08-24 00:42:13 UTC
Still on ruby-3.2.5; affects all 32-bit
Comment 3 Hans de Graaff gentoo-dev Security 2024-08-24 08:52:01 UTC
This looks to be fixed in ruby 3.3 and 3.4, but there are significant code changes so there isn't an easy patch to backport.

It might be possible to simply define "s" as a "VALUE" instead of a "wideval_t". That would fix the warning but I don't know the ruby C stuff well enough to determine if there would be additional impact.
Comment 4 konsolebox 2024-08-24 13:48:12 UTC
Seems like the correct way is to use wdivmod instead of split_second as it is already called in many parts of time.c.

-    split_second(tobj->timew, &t, &s);
+    wdivmod(tobj->timew, WINT2FIXWV(TIME_SCALE), &t, &s);

A similar patch has already been made for 3.4 (preview) and already backported to 3.3 as part of a batch of patches:

https://github.com/ruby/ruby/commit/055613fd868a8c94e43893f8c58a00cdd2a81f6d
https://github.com/ruby/ruby/commit/b13cf49036f0a454063cde25807785adc00f8995
Comment 5 konsolebox 2024-08-24 13:50:28 UTC
split_second is just a wrapper.

static void
split_second(wideval_t timew, wideval_t *timew_p, VALUE *subsecx_p)
{
    wideval_t q, r;
    wdivmod(timew, WINT2FIXWV(TIME_SCALE), &q, &r);
    *timew_p = q;
    *subsecx_p = w2v(r);
}