Skip to content

Fix build failures with modern glibc (2.28+) and kernel headers#51

Open
noafroboy wants to merge 1 commit intoopen64-compiler:developfrom
noafroboy:fix/modern-glibc-compat
Open

Fix build failures with modern glibc (2.28+) and kernel headers#51
noafroboy wants to merge 1 commit intoopen64-compiler:developfrom
noafroboy:fix/modern-glibc-compat

Conversation

@noafroboy
Copy link

Summary

  • Replace removed _IO_NO_WRITES glibc internal macro in osprey/libf/fio/flush.c with an unconditional fflush() call (safe per POSIX — returns 0 on read-only streams)
  • Replace deprecated struct siginfo and struct ucontext types in osprey-gcc-4.2.0/gcc/config/i386/linux-unwind.h with the POSIX-standard typedefs siginfo_t and ucontext_t

Motivation

These two issues prevent building on any Linux distribution shipping glibc >= 2.28 (Ubuntu 18.10+, Debian 10+, Fedora 29+, etc.):

  1. _IO_NO_WRITES was a glibc-internal macro exposed through <stdio.h> internals, removed in glibc 2.28 (2018). The code used it to check stream writability before calling fflush(), but fflush() on a read-only stream is a no-op per POSIX, making the check unnecessary.

  2. struct siginfo and struct ucontext were deprecated in favor of siginfo_t and ucontext_t (the POSIX typedefs) and removed from kernel UAPI headers. GCC upstream fixed this in 2018 but Open64's bundled GCC 4.2.0 still uses the old types.

Test plan

  • Build on Ubuntu 20.04 (glibc 2.31) — both files compile without errors
  • Build on Ubuntu 22.04 (glibc 2.35) — both files compile without errors

🤖 Generated with Claude Code

Two compatibility issues prevent building on modern Linux distributions:

1. osprey/libf/fio/flush.c: Used _IO_NO_WRITES, a glibc-internal macro
   removed in glibc 2.28 (2018). Replace the writability check with an
   unconditional fflush(), which is safe per POSIX (returns 0 on a
   read-only stream).

2. osprey-gcc-4.2.0/gcc/config/i386/linux-unwind.h: Used deprecated
   'struct siginfo' and 'struct ucontext' types removed in glibc 2.26+
   and recent kernel headers. Replace with the POSIX-standard typedefs
   'siginfo_t' and 'ucontext_t'.

These fixes are needed on Ubuntu 20.04+ and other distributions shipping
glibc >= 2.28.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant