diff options
author | Jim Cromie <jim.cromie@gmail.com> | 2014-11-20 14:45:02 -0700 |
---|---|---|
committer | Tony Cook <tony@develop-help.com> | 2014-12-01 11:36:46 +1100 |
commit | bf3d06aaf43f2ffb6919a7c464f39a2d65c45b42 (patch) | |
tree | ddd271314d60e5d30c80356e5e881b7f7cbe4b9f /pp.c | |
parent | 083750a56b7927292a4bf7b1bf64aa26dd2a6858 (diff) | |
download | perl-bf3d06aaf43f2ffb6919a7c464f39a2d65c45b42.tar.gz |
pp.c: dont work around glibc 2.2.5 _moddi3 bugs past 2.7
Add glibc version checks to avoid runtime workarounds for an ancient bug.
p1- 224ec32361 in 2003 added a per-op one-time test to detect the bug,
and patch around it in op_ppaddr.
p2- befad5d118 in 2007 limited the workaround to GLIBC and IVSIZE == 8
p3- a5bd31f4dc in 2012 suppressed it for defined(PERL_DEBUG_READONLY_OPS)
https://bugzilla.redhat.com/show_bug.cgi?id=65612
describes the test implemented in [p1]
Per wikipedia:
v2.2.5 isnt dated, but 2.2.4 is 7/2001. redhat fixed theirs in 9/2002
v2.3 is 10/2002, and likely never had the bug released.
v2.3.2 in debian sarge, 2.3.4 in RHEL4
So picking v2.7 (10/2007) as last version pessimized is still quite
conservative, but also already 7 years old, 2x++ our perlpolicy support
window. Its unlikely that such a platform would be seeing an install
of v5.22 or later.
Diffstat (limited to 'pp.c')
-rw-r--r-- | pp.c | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -2453,7 +2453,8 @@ PP(pp_i_divide) } } -#if defined(__GLIBC__) && IVSIZE == 8 && !defined(PERL_DEBUG_READONLY_OPS) +#if defined(__GLIBC__) && IVSIZE == 8 && !defined(PERL_DEBUG_READONLY_OPS) \ + && ( __GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 8)) STATIC PP(pp_i_modulo_0) #else @@ -2476,7 +2477,8 @@ PP(pp_i_modulo) } } -#if defined(__GLIBC__) && IVSIZE == 8 && !defined(PERL_DEBUG_READONLY_OPS) +#if defined(__GLIBC__) && IVSIZE == 8 && !defined(PERL_DEBUG_READONLY_OPS) \ + && ( __GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 8)) STATIC PP(pp_i_modulo_1) @@ -2512,7 +2514,7 @@ PP(pp_i_modulo) PL_ppaddr[OP_I_MODULO] = Perl_pp_i_modulo_0; /* .. but if we have glibc, we might have a buggy _moddi3 - * (at least glicb 2.2.5 is known to have this bug), in other + * (at least glibc 2.2.5 is known to have this bug), in other * words our integer modulus with negative quad as the second * argument might be broken. Test for this and re-patch the * opcode dispatch table if that is the case, remembering to |