-
Notifications
You must be signed in to change notification settings - Fork 560
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Don't assume NV_INF / NV_NAN #22882
Comments
Two things would be helpful in correcting this problem:
@leonerd, can you take a look? |
I can try to work on a patch (and also test patches), but I really don't know anything about the Perl language itself. For example, it looks like the So working on this isn't probably really about making it compile in some way, but also to clearify the fp interface an application / script can expect. |
OTOH VAX systems are quite outdated by today's standards. Making it build again without breaking when not using |
John Klos added a patch to That seems to work for us VAX people. Would be nice to get that upstreamed. (While it would probably be more correct to explicitely test for specific fp features, VAX systems are the last survivors here that don't offer IEEE math.) |
The easiest accessible emulator for vax would be https://github.com/open-simh/simh - I suppose what would be needed was a version of https://github.com/marketplace/actions/netbsd-vm which uses simh internally to a NetBSD/VAX VM. I... may ask on the port-vax NetBSD list |
Perl code can check whether double supports floating point with:
The C code can check with:
(though some code assumes As to behaviour, I think allowing inf/nan to be imported and throwing an error when called would be best. I'll look at producing a patch, though I'm not sure how I'll be able to test it. |
Forgetting integration of VAX on simh to github for the moment, I can test any patches on a VAX system. |
On some machines (VAX), the double type doesn't support Infinity/NaN values. Handle this case by making builtin::inf/builtin::nan throw a runtime error. Fixes Perl#22882.
On some machines (VAX), the double type doesn't support Infinity/NaN values. Handle this case by making builtin::inf/builtin::nan throw a runtime error. Fixes Perl#22882.
Could you please test mauke's patch above? The patch is at https://patch-diff.githubusercontent.com/raw/Perl/perl5/pull/22889.patch though this probably won't apply cleanly to 5.40. If you have git available you can clone the repository and checkout the PR locally:
|
Testing now. Will report back tomorrow. Thanks! |
Compilation succeeded, and perl tests are running now. So far, no problems at all. |
The
pkgsrc
repository (a large tree of build instructions for lots of software, used as a package source for NetBSD and many other unix-like distributions) recently updated Perl5 from 5.38 to 5.40, which now no longer builts for VAX targets:This was introduced with 5fdf6e9, where INF and NAN support was expected to always exist. However, this is an IEEE fp feature and the VAX CPU predates that spec. Perl used to reasonable support VAX systems (cf.
d_double_style_vax
,d_double_has_inf
andd_double_has_nan
.) So I guess that INF/NAN support wasn't tested on a non-IEEE fp system. Reverting this patch makes it build again. Simply guarding that functionality with any of the above config options should just do the trick.Thanks a lot!
The text was updated successfully, but these errors were encountered: