Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions contrib/guix/libexec/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ mkdir -p "$DISTSRC"
case "$HOST" in
*linux*)
# Compress DWARF sections in debug files and set proper permissions
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\"" _ {}
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\"" _ {}

# Create .build-id tree for perf auto-discovery
mkdir -p "${DISTNAME}/usr/lib/debug/.build-id"
Expand All @@ -354,7 +354,7 @@ mkdir -p "$DISTSRC"
find "${DISTNAME}/lib" -type f -print0
} | while IFS= read -r -d '' elf; do
if file "$elf" | grep -q "ELF.*executable\|ELF.*shared object"; then
build_id=$(readelf -n "$elf" 2>/dev/null | awk '/Build ID/ {print $3; exit}')
build_id=$("${HOST}"-readelf -n "$elf" 2>/dev/null | awk '/Build ID/ {print $3; exit}')
if [ -n "$build_id" ] && [ -f "${elf}.dbg" ]; then
dir="${DISTNAME}/usr/lib/debug/.build-id/${build_id:0:2}"
mkdir -p "$dir"
Expand All @@ -374,13 +374,13 @@ mkdir -p "$DISTSRC"
while IFS= read -r -d '' elf; do
if file "$elf" | grep -q "ELF.*executable\|ELF.*shared object"; then
# Check for build-id
if ! readelf -n "$elf" 2>/dev/null | grep -q "Build ID"; then
if ! "${HOST}"-readelf -n "$elf" 2>/dev/null | grep -q "Build ID"; then
echo "ERROR: No build-id found in $elf" >&2
verification_failed=1
fi

# Check for .gnu_debuglink
if ! readelf --string-dump=.gnu_debuglink "$elf" >/dev/null 2>&1; then
if ! "${HOST}"-readelf --string-dump=.gnu_debuglink "$elf" >/dev/null 2>&1; then
echo "ERROR: No .gnu_debuglink found in $elf" >&2
verification_failed=1
fi
Expand Down
Loading