Skip to content

Commit 68c983a

Browse files
eregongilles-duboscq
authored andcommitted
Avoid referring to __strspn_c1 when compiling on older glibc
* See #2406
1 parent 3aeff4f commit 68c983a

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ Bug fixes:
1515
* Fix `rb_str_modify_expand` to preserve existing bytes (#2392).
1616
* Fix `Marshal.load` of multiple `Symbols` with an explicit encoding (#1624).
1717
* Fix `String#scrub` when replacement is frozen (#2398, @LillianZ).
18+
* Fix issue with `strspn` used in the `date` C extension compiled as a macro on older glibc and then missing the `__strspn_c1` symbol on newer glibc (#2406).
1819

1920
Compatibility:
2021

src/main/c/date/date_strftime.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@
1616
#include <sys/time.h>
1717
#endif
1818

19+
// TruffleRuby: strspn is a macro on old glibc, and was removed in https://sourceware.org/legacy-ml/libc-alpha/2016-03/msg00772.html
20+
// undef the macro so the function is always used instead, and builds on older glibc work with newer glibc.
21+
// See https://github.com/oracle/truffleruby/issues/2406
22+
#undef strspn
23+
1924
#undef strchr /* avoid AIX weirdness */
2025

2126
#define range(low, item, hi) (item)

0 commit comments

Comments
 (0)