diff options
author | David Mitchell <davem@iabyn.com> | 2018-05-11 08:03:42 +0100 |
---|---|---|
committer | David Mitchell <davem@iabyn.com> | 2018-05-11 08:03:42 +0100 |
commit | e9c9cf57594854df9f5802f7f149be4738212e96 (patch) | |
tree | ce5068cb63e31fd69fae214f95d9c8f8c0b3ad1a /pp.c | |
parent | 77dddf94110be150e8cd1a4e9d469e418a788b8d (diff) | |
download | perl-e9c9cf57594854df9f5802f7f149be4738212e96.tar.gz |
fix build failure with recent glibc
RT #133184
pp_crypt() directly manipulates a field inside 'struct crypt_data' to work
around a bug in an ancient glibc version from circa 2002. New glibc
releases don't have this field so perl fails to compile. Make the hack
conditional on glibc version.
Stolen from a patch to the Fedora 28 distribution.
Diffstat (limited to 'pp.c')
-rw-r--r-- | pp.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -3653,8 +3653,12 @@ PP(pp_crypt) #if defined(__GLIBC__) || defined(__EMX__) if (PL_reentrant_buffer->_crypt_struct_buffer) { PL_reentrant_buffer->_crypt_struct_buffer->initialized = 0; - /* work around glibc-2.2.5 bug */ +#if (defined(__GLIBC__) && __GLIBC__ == 2) && \ + (defined(__GLIBC_MINOR__) && __GLIBC_MINOR__ >= 2 && __GLIBC_MINOR__ < 4) + /* work around glibc-2.2.5 bug, has been fixed at some + * time in glibc-2.3.X */ PL_reentrant_buffer->_crypt_struct_buffer->current_saltbits = 0; +#endif } #endif } |