Skip to content

pkgsGlibc227#1

Closed
PhilipTaronQ wants to merge 5 commits intoqumulo-masterfrom
pkgsGlibc227
Closed

pkgsGlibc227#1
PhilipTaronQ wants to merge 5 commits intoqumulo-masterfrom
pkgsGlibc227

Conversation

@PhilipTaronQ
Copy link
Member

I don't know whether this works in the Qumulo appliance.

These are the Qumulo vim plugins as of March 23, 2025.
Comment on lines +178 to +180
ready =
cc != null
&& !(lib.hasPrefix "bootstrap" (super'.stdenv.name or "bootstrap"));

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if you want this to apply only to the final stdenv, you might try:

ready = super'.__raw or false

or some variant of that like super'.targetPackages.stdenv.__raw.

pkgsGlibc227 = super';
}
// lib.optionalAttrs ready {
stdenv = super'.stdenv.override {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you might consider overrideCC for this

Comment on lines +52 to +54
# Backport of upstream 2d7ed98a (Trofi, BZ#29564): GNU Make 4.4+
# exposes long options in MAKEFLAGS which breaks glibc's Makerules.
./fix-makeflags-for-make-4.4.patch

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there's no need for both this make 4.4 patch and the gnumake_4_3 package definition. one or the other will do.

PhilipTaronQ and others added 3 commits March 17, 2026 10:10
Add a new package-set variant that builds all packages against glibc 2.27,
providing binary compatibility with Ubuntu 18.04 (Bionic), RHEL 7+, and
manylinux2014-era systems.

Architecture:
- glibc 2.27 is built from the outer (non-variant) package set to avoid
  circular dependencies through the stdenv fixpoint.
- The variant overlay rewires stdenv's cc-wrapper and bintools-wrapper to
  link against glibc 2.27; the compiler itself (GCC 15) remains unchanged.
- Early bootstrap stages (where stdenv.cc is null) are detected and skipped.

Build compatibility fixes for GCC 15 + binutils 2.44 + GNU Make 4.4:
- Backport of upstream glibc commit 2d7ed98a (Sergei Trofimovich, BZ#29564)
  to fix MAKEFLAGS handling with GNU Make 4.4's long options.
- Pin GNU Make 4.3 for the glibc build, as Make 4.4+ has additional
  pattern-rule evaluation changes that cause infinite loops.
- --disable-werror: glibc 2.27 predates many GCC 15 warnings.
- libc_extra_cflags=-fcommon: GCC 10+ defaults to -fno-common.
- LDFLAGS=-no-pie via makeFlags: GCC 15 defaults to PIE but glibc 2.27's
  CRT objects are not PIE-compatible.
- fgrep/egrep wrapper scripts for environments lacking these deprecated
  commands.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Three issues fixed since the initial commit:

1. GNU Make 4.4+ infinite loop: glibc 2.27's Makefiles are incompatible
   with Make 4.4 (BZ#29564 + pattern rule changes).  Pin Make 4.3 for
   the glibc build, and backport Trofi's MAKEFLAGS fix as a patch.

2. GCC 15 C23 symbols: GCC 15 emits __isoc23_* calls (e.g.
   __isoc23_strtoul) and glibc 2.42 headers redirect standard functions
   to those symbols.  Fix with -std=gnu17 in cc-cflags and -isystem
   override to ensure glibc 2.27 headers take priority over GCC 15's
   hardcoded glibc 2.42 include paths.

3. Missing glibc 2.32+ symbols: Packages like gettext reference
   __libc_single_threaded (glibc 2.32+).  Add a forward-compat shim
   in libc_nonshared.a so these packages link against glibc 2.27.

4. Bootstrap stage guard: Only apply the variant's stdenv override at
   the final stage (not bootstrap stages) by checking for the
   "bootstrap" prefix in the stdenv name.

Tested: pkgsGlibc227.{hello,libtar,wolfssl} all build and link against
glibc 2.27.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Remove fgrep/egrep wrappers (outer gnugrep provides them)
- Simplify ready check to just !hasPrefix "bootstrap" (other
  conditions are implied by being at the final stage)
- Move compat shim insertion to after .a relocation dance so
  it operates on the final libc_nonshared.a
- Upgrade Make 4.3 pin comment to note belt-and-suspenders
- Drop -std=gnu17 from cc-cflags: it breaks C++ -Werror builds,
  and the -isystem override for glibc 2.27 headers is sufficient
  to prevent __isoc23_* redirects

Known limitation: C++ packages that transitively link libstdc++
fail because GCC 15's libstdc++ was built against glibc 2.42 and
references GLIBC_2.33/2.34 versioned symbols.  This requires
splicing (using host libstdc++ instead of rebuilding it) and will
be addressed separately.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
GCC 15's libgcc_s.so references pthread_*@GLIBC_2.34 and
_dl_find_object@GLIBC_2.35 — versioned symbols that don't exist in
glibc 2.27.  This broke ALL linking (not just C++), since libgcc_s
is linked into every program.

Add libglibc_compat.so.0: a small shared library that provides these
versioned symbols, forwarding pthread calls to glibc 2.27's
libpthread via dlsym(RTLD_NEXT) and stubbing _dl_find_object to
return "not found" (triggering libgcc's dl_iterate_phdr fallback).

The compat library:
- Uses its own version script to DEFINE GLIBC_2.34/2.35 versions
  (not require them from libc.so)
- Avoids including glibc headers to prevent conflicts between the
  build-time glibc 2.42 and the target glibc 2.27
- Is linked via -lglibc_compat in the cc-wrapper's cc-ldflags

Tested: pkgsGlibc227.{hello,libtar,wolfssl} all build successfully.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@PhilipTaronQ PhilipTaronQ force-pushed the qumulo-master branch 2 times, most recently from c0d0ed3 to 9781e1a Compare March 19, 2026 13:28
@PhilipTaronQ
Copy link
Member Author

This ended up being a dead end. Going with #2 instead.

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.

3 participants