This PR extends #484928 to every Xorg video driver module in Nixpkgs that exhibi…ts the same eager-binding loader failure.
Xorg loads driver DSOs with `RTLD_LAZY | RTLD_GLOBAL`, then the drivers load helper modules such as `vgahw`, `fbdevhw`, `exa`, `shadow`, `vbe`, and `int10` during probing or initialization. Nixpkgs currently links most of these drivers with `-z now`, which forces their helper symbols to be resolved before the helpers are available and makes `dlopen` fail.
An audit of all 37 `xf86-video-*` packages available on `x86_64-linux` found 34 affected driver modules. Every failure is an unresolved helper symbol from a module that would be loaded later, and every failure disappears when only `bindnow` is disabled.
| Deferred helper | Example unresolved symbols | Affected driver modules |
| --- | --- | --- |
| `vgahw` | `vgaHWFreeHWRec`, `vgaHWGetIndex` | `apm`, `ark`, `ast`, `chips`, `cirrus`, `i128`, `i740`, `neomagic`, `openchrome`, `qxl`, `s3virge`, `tdfx`, `trident`, `vboxvideo`, `vmware` |
| `fbdevhw` | `fbdevHWSave` | `fbdev`, `mga`, `nv`, `r128` |
| `exa` | `exaDriverAlloc`, `exaWaitSync` | `nouveau`, `omap`, `radeon`, `savage`, `siliconmotion` |
| `shadow` | `ShadowFBInit`, `shadowRemove`, `shadowUpdateRotate8_90` | `geode`, `nested`, `sisusb`, `voodoo` |
| `vbe` / `int10` | `vbeFree`, `VBESetModeParameters`, `xf86InitInt10` | `intel`, `sis`, `vesa` |
| SBus helpers | `xf86SbusHideOsHwCursor` | `suncg6`, `sunffb`, `sunleo` |
The package-level exception is intentionally not added to `xf86-video-dummy` or `xf86-video-v4l`, whose modules load successfully with `BIND_NOW`. `xf86-video-amdgpu` already has the exception from #484928. All other hardening flags remain enabled.
## Verification
Tested on NixOS 26.05, `x86_64-linux`. All 37 available `xf86-video-*` packages build successfully. For both comparisons, their `/lib/xorg/modules` outputs were combined into a `buildEnv` and loaded by the same Xorg 21.1.24 build. The baseline keeps the existing `xf86-video-amdgpu` exception but removes the exceptions introduced by this PR.
`Xorg -showopts` exercises module loading and driver registration without requiring root access, a VT, or graphics hardware.
Build Xorg and the combined baseline/fixed module trees with:
```console
$ nix-build -A xorg-server -o result-xorg
$ nix-build -E '
let
pkgs = import ./. { config.allowUnfree = true; };
names = builtins.filter (name: builtins.match "xf86-video-.*" name != null) (builtins.attrNames pkgs);
packages = map (name: pkgs.${name}) names;
available = builtins.filter (package: pkgs.lib.meta.availableOn pkgs.stdenv.hostPlatform package) packages;
mkModuleTree = name: paths: pkgs.buildEnv {
inherit name paths;
pathsToLink = [ "/lib/xorg/modules" ];
ignoreCollisions = true;
};
baseline = mkModuleTree "xorg-video-drivers-baseline" (map (package:
if package.pname == "xf86-video-amdgpu" then package
else package.overrideAttrs (_: { hardeningDisable = [ ]; })
) available);
fixed = mkModuleTree "xorg-video-drivers-fixed" available;
in
pkgs.linkFarm "xorg-video-driver-showopts-inputs" [
{ name = "baseline"; path = baseline; }
{ name = "fixed"; path = fixed; }
]
' -o result-xorg-video-drivers
```
Before this change:
```console
$ result-xorg/bin/Xorg :93 -showopts -modulepath "$PWD/result-xorg-video-drivers/baseline/lib/xorg/modules,$PWD/result-xorg/lib/xorg/modules" -logfile /tmp/xorg-showopts-baseline.log
$ grep -c 'Failed to load module .*loader failed' /tmp/xorg-showopts-baseline.log
34
$ grep -c 'Driver\[[0-9]\+\]:' /tmp/xorg-showopts-baseline.log
3
$ grep 'undefined symbol:' /tmp/xorg-showopts-baseline.log | sed -E 's/.*undefined symbol: ([^ ]+).*/\1/' | sort | uniq -c | sort -nr
12 vgaHWFreeHWRec
4 fbdevHWSave
3 xf86SbusHideOsHwCursor
3 vgaHWGetIndex
3 exaWaitSync
2 exaDriverAlloc
2 ShadowFBInit
1 xf86InitInt10
1 vbeFree
1 shadowUpdateRotate8_90
1 shadowRemove
1 VBESetModeParameters
```
After this change:
```console
$ result-xorg/bin/Xorg :94 -showopts -modulepath "$PWD/result-xorg-video-drivers/fixed/lib/xorg/modules,$PWD/result-xorg/lib/xorg/modules" -logfile /tmp/xorg-showopts-fixed.log
$ grep -c 'Failed to load module .*loader failed' /tmp/xorg-showopts-fixed.log
0
$ grep -c 'Driver\[[0-9]\+\]:' /tmp/xorg-showopts-fixed.log
37
$ grep -Ec 'undefined symbol|loader failed' /tmp/xorg-showopts-fixed.log
0
```
This verifies the loader and registration path for every affected module. It does not claim hardware probing or modesetting coverage for each legacy driver.
## Things done
- Built on platform:
- [x] x86_64-linux
- [ ] aarch64-linux
- [ ] x86_64-darwin
- [ ] aarch64-darwin
- Tested, as applicable:
- [ ] NixOS tests
- [ ] Package tests
- [x] All available `xf86-video-*` packages build
- [x] All affected modules load with `Xorg -showopts`
- [ ] Ran `nixpkgs-review`
- [x] Fits `CONTRIBUTING.md`, `pkgs/README.md`, `maintainers/README.md`, and other READMEs