974 Commits

Author SHA1 Message Date
John Ericson
4ac172be9a Format markdown in the commit log 2025-08-12 15:48:41 -04:00
Christian Göttsche
89d970597f Avoid implicit conversion
Use auto to avoid implicit type conversion, hiding possible value
truncation.

(cherry picked from commit 00d1e82f2b)
2025-08-12 15:23:59 -04:00
Christian Göttsche
90bad95364 Avoid implicit value truncations in wri()
Abort on truncation of values being written to the ELF data, to prevent
silent behavior mismatch.

(cherry picked from commit 28e95b30f3)
2025-08-12 15:23:58 -04:00
Christian Göttsche
daba6af292 Avoid dropping const qualifier
(cherry picked from commit b5b59ca4cb)
2025-08-12 15:23:45 -04:00
Christian Göttsche
86c3d0f441 Declare file local functions static
(cherry picked from commit 889350de50)
2025-08-12 15:23:45 -04:00
Christian Göttsche
a188583fb0 Drop superfluous semicolons
(cherry picked from commit 1c2d1fffaf)
2025-08-12 15:23:45 -04:00
Christian Göttsche
986a0aeeba Use C++11 [[noreturn]]
(cherry picked from commit b2897ab819)
2025-08-12 15:23:45 -04:00
Christian Göttsche
602405bb13 Avoid potential overflows in checkPointer()
Prevent overflows in the addtion of q and size, and avoid truncations in
callers by using size_t as type for size.

(cherry picked from commit e883229437)
2025-08-12 15:23:45 -04:00
Christian Göttsche
2b9700b643 Drop unnecessary casts in getElfType()
Also declare the function static and warn if return value not used.

(cherry picked from commit 98d1813f25)
2025-08-12 15:23:45 -04:00
Christian Göttsche
45a6dcee39 Close file before potentially throwing
(cherry picked from commit c00676a28a)
2025-08-12 15:23:45 -04:00
Christian Göttsche
de48fab274 Avoid unnecessary copies in splitColonDelimitedString()
Avoid creating a stringstream by using find().

(cherry picked from commit a393454963)
2025-08-12 15:23:45 -04:00
Christian Göttsche
d8de743799 Use C++ casts instead of raw C ones in hdr()
(cherry picked from commit 404761cf4d)
2025-08-12 15:23:45 -04:00
Christian Göttsche
547d8d7bd2 Drop unnecessary friend declarations
(cherry picked from commit 09673eb553)
2025-08-12 15:23:45 -04:00
Christian Göttsche
728797dbed Add misc functions annotations
Make the behavior of functions more explicit.

(cherry picked from commit fbb12a72ad)
2025-08-12 15:23:45 -04:00
Christian Göttsche
5baeaeecd5 Add required includes in header file
Enable to parse the header file on its own, e.g. for language servers
(clangd).

(cherry picked from commit ce5907fc40)
2025-08-12 15:23:42 -04:00
John Ericson
c0ee925daf Add 0.15 release info
Taken for retroactive documentation from GitHub.
2025-08-12 15:15:07 -04:00
Jörg Thalheim
344efe7cef README: move release history to ChangeLog.md
John thinks its better that we keep this information in-repo. It just
doesn't need to go in the read-em.

Co-Authored-By: John Ericson <John.Ericson@Obsidian.Systems>
2025-08-12 15:14:33 -04:00
Breno Rodrigues Guimaraes
a97bfdf479 Fix all shellcheck issues
(cherry picked from commit 8adc31ed7b)
2025-08-12 15:06:56 -04:00
Jörg Thalheim
61fdb6e999 tests: apply suggestions from shellcheck
(cherry picked from commit be4b84635f)
2025-08-12 15:04:30 -04:00
Jörg Thalheim
2d18660af7 fix checkPhase for cross builds
fixes https://github.com/NixOS/patchelf/issues/417

(cherry picked from commit f7b184c004)
2025-08-12 15:04:13 -04:00
Bo Anderson
33e3e8b617 tests/contiguous-note-sections.sh: use scratch directory
(cherry picked from commit a93de9d4ce)
2025-08-12 15:03:34 -04:00
Jörg Thalheim
06b8a41214 make objdump/objcopy/readelf configurable and respect cross-compiling related prefixes
(cherry picked from commit b0599fe776)
2025-08-12 14:59:49 -04:00
John Ericson
03746bff2c Backport infra improvements from master to 0.15
This is the version currently used in Nixpkgs as the stable version, so
I am interested in seeing it be developable, even as the hope is to move
to a newer version.
2025-08-12 14:54:44 -04:00
John Ericson
8b026d53c2 Merge pull request #611 from NixOS/misc-cleanups
Misc cleanups
2025-08-12 17:37:53 +00:00
John Ericson
aed52ef51b Add Meson build instructions
Also fix CMake instructions indent level
2025-08-12 13:31:35 -04:00
John Ericson
ae17b2736d Merge pull request #591 from NixOS/dependabot/github_actions/cachix/install-nix-action-31
Bump cachix/install-nix-action from 30 to 31
2025-08-12 17:29:56 +00:00
dependabot[bot]
5193989af3 Bump cachix/install-nix-action from 30 to 31
Bumps [cachix/install-nix-action](https://github.com/cachix/install-nix-action) from 30 to 31.
- [Release notes](https://github.com/cachix/install-nix-action/releases)
- [Commits](https://github.com/cachix/install-nix-action/compare/v30...v31)

---
updated-dependencies:
- dependency-name: cachix/install-nix-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-08-12 13:25:13 -04:00
John Ericson
c1beef4539 Add an .editorconfig file
Taken from Nix's.
2025-08-12 13:24:30 -04:00
John Ericson
1319796c91 Structure CMake build like the others
Do this by separating out a `src/CMakeLists.txt`.
2025-08-12 13:24:30 -04:00
John Ericson
a252740ccf Merge pull request #604 from obsidiansystems/meson
Add Meson build
2025-08-12 17:18:46 +00:00
John Ericson
a7c595db2c Add Meson build
Progress on #599. Tests still need to be done, though.
2025-08-12 13:12:15 -04:00
John Ericson
2156b8e6ce Merge pull request #610 from NixOS/cmake
Add CMake build
2025-08-12 16:47:49 +00:00
david feurle
51cf74ce10 Add CMake build
Co-Authored-by: John Ericson <John.Ericson@Obsidian.Systems>
2025-08-12 12:42:49 -04:00
John Ericson
f8621b633a Merge pull request #609 from NixOS/windows-lighter-override
Make fewer assumptions in the windows override
2025-08-12 15:50:22 +00:00
John Ericson
1160a46b8b Make fewer assumptions in the windows override 2025-08-12 11:44:52 -04:00
John Ericson
c0c9f3a431 Merge pull request #603 from obsidiansystems/package.nix
Refactor nix code a bit to have regular `package.nix`
2025-08-12 15:41:15 +00:00
John Ericson
baf35300a0 Move Windows static logic out of patchelf.nix
This is too opinionated for the package itself, which is supposed to be
very open-ended about how something it is built. It should instead go
with the `NIX_CFLAGS_COMPILE = "-static"` that it is supposed to enable.
2025-08-12 11:36:28 -04:00
John Ericson
bba0d5bef3 Rename patchelf.nix to package.nix
Let's just call it by its conventional name, now.
2025-08-12 11:25:10 -04:00
Jörg Thalheim
63791a1532 Merge pull request #607 from NixOS/dev-tooling
Add developer tools
2025-08-12 07:08:27 +00:00
Jörg Thalheim
4671a3f234 ci: enable merge queue 2025-08-12 09:03:23 +02:00
Jörg Thalheim
7f42e30354 ci: enable merge queue 2025-08-11 19:45:02 +02:00
John Ericson
247faf774f Merge pull request #608 from NixOS/use-fileset
Use fileset to avoid rebuilds
2025-08-11 13:39:24 -04:00
John Ericson
18a5953fc5 Add developer tools
Code is taken from Nix.
2025-08-11 13:32:15 -04:00
John Ericson
cc8baeab6a Use fileset to avoid rebuilds 2025-08-11 13:32:06 -04:00
John Ericson
fe5819ed6c Merge pull request #602 from obsidiansystems/nixfmt
Format Nix code
2025-08-11 12:31:27 -04:00
dependabot[bot]
a4b21a9235 Bump actions/download-artifact from 4 to 5
Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 4 to 5.
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](https://github.com/actions/download-artifact/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/download-artifact
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-08-11 08:49:31 +02:00
John Ericson
6c7c02dabf readme: Add title and link chatroom 2025-08-11 08:49:22 +02:00
John Ericson
06beb68dfa Create .git-blame-ignore-revs with previous commit 2025-08-10 16:02:42 -04:00
John Ericson
706478750f Format Nix code 2025-08-10 15:59:56 -04:00
murkvin
523f401584 fix: specify zsh completions in patchelf.spec.in
Problem: When building the patchelf RPM, zsh completions are installed (but not packaged). This causes an RPM build failure.

Solution: We need to identify the zsh completions in the generated RPM spec file.

Testing: I updated the RPM spec file and successfully built the RPM.
2025-02-15 08:40:35 +07:00