Skip to content

Commit

Permalink
[GR-32923] Avoid referring to __strspn_c1 when compiling on older gli…
Browse files Browse the repository at this point in the history
…bc (21.2).

PullRequest: truffleruby/2837
  • Loading branch information
gilles-duboscq committed Jul 29, 2021
2 parents 3aeff4f + 68c983a commit 41c9843
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Bug fixes:
* Fix `rb_str_modify_expand` to preserve existing bytes (#2392).
* Fix `Marshal.load` of multiple `Symbols` with an explicit encoding (#1624).
* Fix `String#scrub` when replacement is frozen (#2398, @LillianZ).
* 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).

Compatibility:

Expand Down
5 changes: 5 additions & 0 deletions src/main/c/date/date_strftime.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@
#include <sys/time.h>
#endif

// TruffleRuby: strspn is a macro on old glibc, and was removed in https://sourceware.org/legacy-ml/libc-alpha/2016-03/msg00772.html
// undef the macro so the function is always used instead, and builds on older glibc work with newer glibc.
// See https://github.com/oracle/truffleruby/issues/2406
#undef strspn

#undef strchr /* avoid AIX weirdness */

#define range(low, item, hi) (item)
Expand Down

0 comments on commit 41c9843

Please sign in to comment.