Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

autoPatchelfHook adds incorrect rpath dependency on packaged libc outputs #333710

Closed
squalus opened this issue Aug 10, 2024 · 1 comment
Closed

Comments

@squalus
Copy link
Member

squalus commented Aug 10, 2024

Describe the bug

The osquery.toolchain package contains compiler toolchain binaries (like clang) and libc libraries to be used by the compiler outputs. When autoPatchelfHook is run on the package, it incorrectly adds the internal libc directory to the rpath of the compiler binaries. This causes the compiler binaries to break with an error message like this:

Inconsistency detected by ld.so: dl-call-libc-early-init.c: 37: _dl_call_libc_early_init: Assertion `sym != NULL' failed!

This problem was introduced in #307068 / 80be926.

This was done because the systemd package wanted to use autoPatchelfHook to add .note.dlopen dependencies to its rpath. But using autoPatchelfHook to do this had an undesired side effect of removing glibc from the rpath (for a reason I don't yet understand). So autoPatchelfHooks previous behavior to ignore libc dependencies was changed.

Potential solutions

  1. Add a flag to autoPatchelfHook telling it to leave libc in the rpath if it's found. Enable this only on systemd.
  2. Revert the libc change to autoPatchelfHook altogether, and instead modify findLibs and make-initrd-ng to automatically check libc.

Either solution would restore the old libc behavior of autoPatchelfHook for everyone else. The former would then add different code for systemd, and the latter would change a couple other programs to account for lacking this new behavior

@ElvishJerricco @flokli

squalus added a commit to squalus/nixpkgs that referenced this issue Aug 10, 2024
Patch toolchain rpath manually instead of using autoPatchelfHook

Workaround for NixOS#333710

Fixes NixOS#332533
@ElvishJerricco
Copy link
Contributor

Fixed by #332617

squalus added a commit to squalus/nixpkgs that referenced this issue Sep 19, 2024
squalus added a commit to squalus/nixpkgs that referenced this issue Oct 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants