Skip to content

Commit 303480f

Browse files
Merge #6997: fix: use proper host objcopy/readelf
4d278c6 fix: shellcheck (pasta) 6700ca9 fix: use proper host objcopy/readelf (pasta) Pull request description: ## Issue being fixed or feature implemented Our script didn't use host specific objcopy, so it would crash with not being able to interpret them depending on what we were building on and for. ## What was done? Use proper objcopy ## How Has This Been Tested? CI after: https://github.com/PastaPastaPasta/dash/actions/runs/19547578950 CI before: https://github.com/PastaPastaPasta/dash/actions/runs/19544501408 ## Breaking Changes ## Checklist: _Go over all the following points, and put an `x` in all the boxes that apply._ - [ ] I have performed a self-review of my own code - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] I have added or updated relevant unit/integration/functional/e2e tests - [ ] I have made corresponding changes to the documentation - [x] I have assigned this pull request to a milestone _(for repository code-owners and collaborators only)_ ACKs for top commit: UdjinM6: utACK 4d278c6 kwvg: ACK 4d278c6 Tree-SHA512: 6e5a8095deb344187c73579105e30c03db8a834015d335b1c6df69c8d5da0de5157e1771486a123cfdf37b36970e89aabb56d95d5334d428181e84a1bbc1b9a8
2 parents 5dca160 + 4d278c6 commit 303480f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

contrib/guix/libexec/build.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ mkdir -p "$DISTSRC"
345345
case "$HOST" in
346346
*linux*)
347347
# Compress DWARF sections in debug files and set proper permissions
348-
find "${DISTNAME}" -name "*.dbg" -type f -print0 | xargs -0 -P"$JOBS" -I{} sh -c "objcopy --compress-debug-sections=zlib \"\$1\" \"\$1.tmp\" && mv \"\$1.tmp\" \"\$1\" && chmod 644 \"\$1\"" _ {}
348+
find "${DISTNAME}" -name "*.dbg" -type f -print0 | xargs -0 -P"$JOBS" -I{} sh -c "${HOST}-objcopy --compress-debug-sections=zlib \"\$1\" \"\$1.tmp\" && mv \"\$1.tmp\" \"\$1\" && chmod 644 \"\$1\"" _ {}
349349

350350
# Create .build-id tree for perf auto-discovery
351351
mkdir -p "${DISTNAME}/usr/lib/debug/.build-id"
@@ -354,7 +354,7 @@ mkdir -p "$DISTSRC"
354354
find "${DISTNAME}/lib" -type f -print0
355355
} | while IFS= read -r -d '' elf; do
356356
if file "$elf" | grep -q "ELF.*executable\|ELF.*shared object"; then
357-
build_id=$(readelf -n "$elf" 2>/dev/null | awk '/Build ID/ {print $3; exit}')
357+
build_id=$("${HOST}"-readelf -n "$elf" 2>/dev/null | awk '/Build ID/ {print $3; exit}')
358358
if [ -n "$build_id" ] && [ -f "${elf}.dbg" ]; then
359359
dir="${DISTNAME}/usr/lib/debug/.build-id/${build_id:0:2}"
360360
mkdir -p "$dir"
@@ -374,13 +374,13 @@ mkdir -p "$DISTSRC"
374374
while IFS= read -r -d '' elf; do
375375
if file "$elf" | grep -q "ELF.*executable\|ELF.*shared object"; then
376376
# Check for build-id
377-
if ! readelf -n "$elf" 2>/dev/null | grep -q "Build ID"; then
377+
if ! "${HOST}"-readelf -n "$elf" 2>/dev/null | grep -q "Build ID"; then
378378
echo "ERROR: No build-id found in $elf" >&2
379379
verification_failed=1
380380
fi
381381
382382
# Check for .gnu_debuglink
383-
if ! readelf --string-dump=.gnu_debuglink "$elf" >/dev/null 2>&1; then
383+
if ! "${HOST}"-readelf --string-dump=.gnu_debuglink "$elf" >/dev/null 2>&1; then
384384
echo "ERROR: No .gnu_debuglink found in $elf" >&2
385385
verification_failed=1
386386
fi

0 commit comments

Comments
 (0)