Skip to content

Comments

glibc: Don't inject CoreFoundation RUNPATH on Darwin#196564

Merged
happysalada merged 1 commit intoNixOS:masterfrom
zhaofengli:darwin-glibc-cf-rpath
Oct 18, 2022
Merged

glibc: Don't inject CoreFoundation RUNPATH on Darwin#196564
happysalada merged 1 commit intoNixOS:masterfrom
zhaofengli:darwin-glibc-cf-rpath

Conversation

@zhaofengli
Copy link
Member

Description of changes

ld-wrapper will otherwise attempt to inject CoreFoundation into ld-linux's RUNPATH:

[macos:nixpkgs]$ nix-build -E 'with import ./. {}; pkgsCross.aarch64-multiplatform.stdenv.cc.libc.overrideAttrs (_: { dontPatchELF = 1; })'
/nix/store/rk7m7bhka5lsn9snp2zqnmpsc1bs00sy-glibc-aarch64-unknown-linux-gnu-2.35-163
[macos:nixpkgs]$ readelf -a result/lib/ld-linux-aarch64.so.1 | grep RUNPATH
 0x000000000000001d (RUNPATH)            Library runpath: [/nix/store/9rb5qaba71mkgfgd8wfqg03cmi46xarg-apple-framework-CoreFoundation-11.0.0/Library/Frameworks]
[linux:nixpkgs]$ /nix/store/rk7m7bhka5lsn9snp2zqnmpsc1bs00sy-glibc-aarch64-unknown-linux-gnu-2.35-163/lib/
ld-linux-aarch64.so.1 
Inconsistency detected by ld.so: ./get-dynamic-info.h: 118: elf_get_dynamic_info: Assertion `info[DT_RUNPATH] == NULL' failed!

Without dontPatchELF = 1 the RUNPATH will become empty but still breaks rtld.

Ref: #137877

Things done
  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin (for aarch64-linux)
  • For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 22.11 Release Notes (or backporting 22.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
    • (Release notes changes) Ran nixos/doc/manual/md-to-db.sh to update generated release notes
  • Fits CONTRIBUTING.md.

@ofborg ofborg bot added the 6.topic: darwin Running or building packages on Darwin label Oct 18, 2022
@ofborg ofborg bot added 10.rebuild-darwin: 11-100 This PR causes between 11 and 100 packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux. labels Oct 18, 2022
@happysalada happysalada merged commit 22b6046 into NixOS:master Oct 18, 2022
@zhaofengli zhaofengli deleted the darwin-glibc-cf-rpath branch October 19, 2022 03:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: darwin Running or building packages on Darwin 10.rebuild-darwin: 11-100 This PR causes between 11 and 100 packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants