{"id":13374252,"url":"https://github.com/NixOS/patchelf","last_synced_at":"2025-03-13T01:31:44.945Z","repository":{"id":1995252,"uuid":"2928164","full_name":"NixOS/patchelf","owner":"NixOS","description":"A small utility to modify the dynamic linker and RPATH of ELF executables","archived":false,"fork":false,"pushed_at":"2024-08-03T07:32:34.000Z","size":1174,"stargazers_count":3558,"open_issues_count":137,"forks_count":486,"subscribers_count":78,"default_branch":"master","last_synced_at":"2024-10-29T14:37:37.447Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/NixOS.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"open_collective":"nixos"}},"created_at":"2011-12-06T21:27:51.000Z","updated_at":"2024-10-28T01:11:54.000Z","dependencies_parsed_at":"2023-09-27T13:30:25.131Z","dependency_job_id":"f514b2dc-7c91-47f5-bfe4-d6638afcdfb7","html_url":"https://github.com/NixOS/patchelf","commit_stats":{"total_commits":638,"total_committers":93,"mean_commits":6.860215053763441,"dds":0.7742946708463949,"last_synced_commit":"a0f54334df36770b335c051e540ba40afcbf8378"},"previous_names":[],"tags_count":27,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NixOS%2Fpatchelf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NixOS%2Fpatchelf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NixOS%2Fpatchelf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NixOS%2Fpatchelf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NixOS","download_url":"https://codeload.github.com/NixOS/patchelf/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242758677,"owners_count":20180557,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-30T05:00:44.477Z","updated_at":"2025-03-13T01:31:44.908Z","avatar_url":"https://github.com/NixOS.png","language":"C","funding_links":["https://opencollective.com/nixos"],"categories":["HarmonyOS","C","Awesome Repositories","C (286)","Command-Line Tools"],"sub_categories":["Windows Manager","ELF binary format"],"readme":"PatchELF is a simple utility for modifying existing ELF executables and\nlibraries.  In particular, it can do the following:\n\n* Change the dynamic loader (\"ELF interpreter\") of executables:\n\n  ```console\n  $ patchelf --set-interpreter /lib/my-ld-linux.so.2 my-program\n  ```\n\n* Change the `RPATH` of executables and libraries:\n\n  ```console\n  $ patchelf --set-rpath /opt/my-libs/lib:/other-libs my-program\n  ```\n\n* Shrink the `RPATH` of executables and libraries:\n\n  ```console\n  $ patchelf --shrink-rpath my-program\n  ```\n\n  This removes from the `RPATH` all directories that do not contain a\n  library referenced by `DT_NEEDED` fields of the executable or library.\n  For instance, if an executable references one library `libfoo.so`, has\n  an RPATH `/lib:/usr/lib:/foo/lib`, and `libfoo.so` can only be found\n  in `/foo/lib`, then the new `RPATH` will be `/foo/lib`.\n\n  In addition, the `--allowed-rpath-prefixes` option can be used for\n  further rpath tuning. For instance, if an executable has an `RPATH`\n  `/tmp/build-foo/.libs:/foo/lib`, it is probably desirable to keep\n  the `/foo/lib` reference instead of the `/tmp` entry. To accomplish\n  that, use:\n\n  ```console\n  $ patchelf --shrink-rpath --allowed-rpath-prefixes /usr/lib:/foo/lib my-program\n  ```\n\n* Remove declared dependencies on dynamic libraries (`DT_NEEDED`\n  entries):\n\n  ```console\n  $ patchelf --remove-needed libfoo.so.1 my-program\n  ```\n\n  This option can be given multiple times.\n\n* Add a declared dependency on a dynamic library (`DT_NEEDED`):\n\n  ```console\n  $ patchelf --add-needed libfoo.so.1 my-program\n  ```\n\n  This option can be give multiple times.\n\n* Replace a declared dependency on a dynamic library with another one\n  (`DT_NEEDED`):\n\n  ```console\n  $ patchelf --replace-needed liboriginal.so.1 libreplacement.so.1 my-program\n  ```\n\n  This option can be give multiple times.\n\n* Change `SONAME` of a dynamic library:\n\n  ```console\n  $ patchelf --set-soname libnewname.so.3.4.5 path/to/libmylibrary.so.1.2.3\n  ```\n\n\n## Compiling and Testing\n\n### Via Autotools\n```console\n./bootstrap.sh\n./configure\nmake\nmake check\nsudo make install\n```\n### Via Nix\n\nYou can build with Nix in several ways.\n\n1. Building via `nix build` will produce the result in `./result/bin/patchelf`. If you would like to build _patchelf_ with _musl_ try `nix build .#patchelf-musl`\n\n2. You can launch a development environment with `nix develop` and follow the autotools steps above. If you would like to develop with _musl_ try `nix develop .#musl`\n\n## Author\n\nCopyright 2004-2019 Eelco Dolstra \u003cedolstra@gmail.com\u003e.\n\n## License\n\nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or (at\nyour option) any later version.\n\nThis program is distributed in the hope that it will be useful, but\nWITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\nGeneral Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with this program.  If not, see \u003chttp://www.gnu.org/licenses/\u003e.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FNixOS%2Fpatchelf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FNixOS%2Fpatchelf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FNixOS%2Fpatchelf/lists"}