Skip to content

Commit b37e09e

Browse files
committed
Avoid referring to __strspn_c1 when compiling on older glibc
* See #2406
1 parent a53236e commit b37e09e

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
@@ -11,6 +11,7 @@ Bug fixes:
1111
* Fix `String#scrub` when replacement is frozen (#2398, @LillianZ).
1212
* Fix `Dir.mkdir` error handling for `Pathname` paths (#2397).
1313
* `BasicSocket#*_nonblock(exception: false)` now only return `:wait_readable/:wait_writable` for `EAGAIN`/`EWOULDBLOCK` like MRI (#2400).
14+
* 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).
1415

1516
Compatibility:
1617

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)