From e124d98be17384ab903f53778a329b3ce7269f26 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 6 May 2025 19:50:33 -0500 Subject: [PATCH] AutoBuild: crew_patchelf started at 2025-05-06-21UTC (#11878) * Cleanup crew output on package installs. Signed-off-by: Satadru Pramanik * Add patchelf, upx updates Signed-off-by: Satadru Pramanik * Use mold in patchelf build Signed-off-by: Satadru Pramanik * Add binaries. Signed-off-by: Satadru Pramanik * Adjust crew logic. Signed-off-by: Satadru Pramanik --------- Signed-off-by: Satadru Pramanik Co-authored-by: Satadru Pramanik --- bin/crew | 9 +++++---- lib/const.rb | 2 +- packages/patchelf.rb | 30 ++++++++---------------------- packages/upx.rb | 10 +++++----- 4 files changed, 19 insertions(+), 32 deletions(-) diff --git a/bin/crew b/bin/crew index fd90a01e9..4d422873e 100755 --- a/bin/crew +++ b/bin/crew @@ -889,21 +889,22 @@ end def fix_interpreter_path(dir) # Do not set interpreter for non-musl, as this can break apps if there # is an issue with the crew glibc. - return if @pkg.is_musl? + return if @pkg.is_musl? || %w[patchelf upx].include?(@pkg.name) Dir.chdir dir do - puts 'Running patchelf and upx'.lightblue - abort('No Patchelf found!').lightred unless File.file?("#{CREW_PREFIX}/bin/patchelf") && File.file?("#{CREW_PREFIX}/bin/upx") + puts 'Running upx to uncompress binaries and patchelf to patch binary interpreter paths.'.lightblue + abort('No Patchelf found!').lightred unless File.file?("#{CREW_PREFIX}/bin/patchelf") + abort('No Upx found!').lightred unless File.file?("#{CREW_PREFIX}/bin/upx") execfiles = `find . -executable -type f ! \\( -name '*.a' \\) | xargs -P#{CREW_NPROC} -n1 sh -c '[ "$(head -c4 ${1})" = "\x7FELF" ] && echo ${1}' --`.chomp return if execfiles.empty? - puts 'Running patchelf to patch binary interpreter paths'.lightblue execfiles.each_line(chomp: true) do |execfiletopatch| execfiletopatch = Dir.pwd + execfiletopatch.delete_prefix('.') neededlibs = `patchelf --print-needed #{execfiletopatch}` next if neededlibs.to_s.empty? system "upx -qq -d #{execfiletopatch} 2> /dev/null" + puts "Running patchelf on #{execfiletopatch}".orange system "patchelf --set-interpreter #{CREW_GLIBC_INTERPRETER} #{execfiletopatch} 2> /dev/null" system "patchelf --remove-rpath #{execfiletopatch} 2> /dev/null" end diff --git a/lib/const.rb b/lib/const.rb index 6e7d94366..a339235ed 100644 --- a/lib/const.rb +++ b/lib/const.rb @@ -3,7 +3,7 @@ require 'etc' OLD_CREW_VERSION ||= defined?(CREW_VERSION) ? CREW_VERSION : '1.0' -CREW_VERSION ||= '1.60.1' unless defined?(CREW_VERSION) && CREW_VERSION == OLD_CREW_VERSION +CREW_VERSION ||= '1.60.2' unless defined?(CREW_VERSION) && CREW_VERSION == OLD_CREW_VERSION # Kernel architecture. KERN_ARCH ||= Etc.uname[:machine] diff --git a/packages/patchelf.rb b/packages/patchelf.rb index 2c5356faf..3f9e5bdfb 100644 --- a/packages/patchelf.rb +++ b/packages/patchelf.rb @@ -3,39 +3,25 @@ require 'buildsystems/autotools' class Patchelf < Autotools description 'PatchELF is a small utility to modify the dynamic linker and RPATH of ELF executables.' homepage 'https://github.com/NixOS/patchelf' - version '0.18.0-a0f5433' + version '0.18.0-523f401' license 'GPL-3' compatibility 'all' source_url 'https://github.com/NixOS/patchelf.git' - git_hashtag 'a0f54334df36770b335c051e540ba40afcbf8378' + git_hashtag '523f401584d9584e76c9c77004e7abeb9e6c4551' binary_compression 'tar.zst' binary_sha256({ - aarch64: '4f03e9e000bb49583d7127d54caef6ee29758693061d68d446487b6b45dba169', - armv7l: '4f03e9e000bb49583d7127d54caef6ee29758693061d68d446487b6b45dba169', - i686: '85047aedda730e0e8e4f4b3cee0b69837e9319f49ae62fdaa79ef7accc5d23b5', - x86_64: '8f88e3483f8ce03b708e992dc2c0dacef893b6824f057606d996761aca603c9d' + aarch64: '6013578363f4949ba003a9baf6cdf4494ffdab85dfa141d231c7111be4841c19', + armv7l: '6013578363f4949ba003a9baf6cdf4494ffdab85dfa141d231c7111be4841c19', + i686: '35c23d10350f3a29111831776d639f8b53cd987c262868188987e27fef8b8cae', + x86_64: '36b45b4f59b426a875e8db833595d7377c960a701f4153e1b2dcc786389458fd' }) no_env_options - pre_configure_options "LDFLAGS='-flto=auto -static' " - - def self.patch - # Allocate PHT & SHT at the end of the *.elf file - downloader 'https://github.com/NixOS/patchelf/pull/544.diff', 'fc65c0e6bfc751a1ab91f5f87c86202834eb3b3c208c6bb1eef077e4572e4b9c' - system 'patch -Np1 -i 544.diff' - # Fix rename-dynamic-symbols.sh test - downloader 'https://github.com/NixOS/patchelf/pull/547.diff', '478669b8749b38defe2b835c2ece1d1ff495da6f0a899c7ac8c00f92c5ec9b2d' - system 'patch -Np1 -i 547.diff' - end + pre_configure_options "LDFLAGS='#{CREW_LINKER_FLAGS} -static'" def self.check - system "sed -i 's/-flto=auto -static//g' Makefile" - system "sed -i 's/-flto=auto -static//g' tests/Makefile" - Dir.chdir('tests') do - system 'make clean' - end - system 'make', 'check' + system "#{CREW_DEST_PREFIX}/bin/patchelf --version" end end diff --git a/packages/upx.rb b/packages/upx.rb index 872b52d7c..786531b27 100644 --- a/packages/upx.rb +++ b/packages/upx.rb @@ -6,7 +6,7 @@ require 'buildsystems/cmake' class Upx < CMake description 'Extendable, high-performance executable packer for several executable formats' homepage 'https://github.com/upx/upx' - version '5.0.0' + version '5.0.1' license 'custom GPL2' compatibility 'all' source_url 'https://github.com/upx/upx.git' @@ -14,10 +14,10 @@ class Upx < CMake binary_compression 'tar.zst' binary_sha256({ - aarch64: '5bdebb37916fc9b21ea0d075d8467d9b9e415ed84ef5e52214f1da93d407c459', - armv7l: '5bdebb37916fc9b21ea0d075d8467d9b9e415ed84ef5e52214f1da93d407c459', - i686: 'b2be0ce308cd928c01afc387384f151ecc9835e7cbd8e513baa73b0d0cad0758', - x86_64: '015f51b52d826208baaa029f58a0c98de722311989df83a7f322f8e4da3242cf' + aarch64: '5f50e1e632152b514b6a0cb392a5de09999a0e48ca5e0992eae2a1d166f7d441', + armv7l: '5f50e1e632152b514b6a0cb392a5de09999a0e48ca5e0992eae2a1d166f7d441', + i686: 'c22892b839bd81e66a186b7842c6467fdc8e19652807b21229c9be53bf924584', + x86_64: 'b03c020457e1472ecf7aae12a8392de414aa01dd210178757cfc908013ff8184' }) depends_on 'gcc_lib' # R