Skip to content

Commit 199b134

Browse files
authored
Merge branch 'master' into ci
2 parents 2b42ac3 + d6ee352 commit 199b134

7 files changed

+13
-6
lines changed

flake.nix

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,10 @@
114114
patchelf = patchelfFor nixpkgs.legacyPackages.${system};
115115
default = self.packages.${system}.patchelf;
116116

117+
# This is a good test to see if packages can be cross-compiled. It also
118+
# tests if our testsuite uses target-prefixed executable names.
119+
patchelf-musl-cross = patchelfFor nixpkgs.legacyPackages.${system}.pkgsCross.musl64;
120+
117121
patchelf-win32 = (patchelfFor (pkgsCrossForMingw system).mingw32).overrideAttrs (old: {
118122
NIX_CFLAGS_COMPILE = "-static";
119123
});

tests/Makefile.am

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ TESTS = $(src_TESTS) $(build_TESTS)
5252

5353
EXTRA_DIST = no-rpath-prebuild $(src_TESTS) no-rpath-prebuild.sh invalid-elf endianness empty-note
5454

55-
TESTS_ENVIRONMENT = PATCHELF_DEBUG=1 OBJDUMP=$(OBJDUMP) READELF=$(READELF)
55+
TESTS_ENVIRONMENT = PATCHELF_DEBUG=1 OBJDUMP=$(OBJDUMP) READELF=$(READELF) OBJCOPY=$(OBJCOPY)
5656

5757
$(no_rpath_arch_TESTS): no-rpath-prebuild.sh
5858
@ln -s $< $@

tests/build-id.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ long_rpath="AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
1313
--set-rpath "$long_rpath" "${SCRATCH}/libbuildid.so"
1414

1515
# older readelf versions do not recognize build id, but we can grep by constant
16-
readelf -n "${SCRATCH}/libbuildid.so" | grep -q -F -e 'Build ID' -e 'Unknown note type: (0x00000003)'
16+
${READELF} -n "${SCRATCH}/libbuildid.so" | grep -q -F -e 'Build ID' -e 'Unknown note type: (0x00000003)'

tests/force-rpath.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#! /bin/sh -e
22
SCRATCH=scratch/$(basename $0 .sh)
3-
OBJDUMP=${OBJDDUMP:-objdump}
3+
OBJDUMP=${OBJDUMP:-objdump}
44

55
rm -rf ${SCRATCH}
66
mkdir -p ${SCRATCH}

tests/no-gnu-hash.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
#! /bin/sh -e
22
SCRATCH=scratch/$(basename $0 .sh)
3+
STRIP=${STRIP:-strip}
34

45
rm -rf ${SCRATCH}
56
mkdir -p ${SCRATCH}
67

78
cp simple ${SCRATCH}/
89

9-
strip --remove-section=.gnu.hash ${SCRATCH}/simple
10+
${STRIP} --remove-section=.gnu.hash ${SCRATCH}/simple
1011

1112
# Check if patchelf handles binaries with GNU_HASH in dynamic section but
1213
# without .gnu.hash section

tests/no-rpath-pie-powerpc.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#! /bin/sh -e
22
set -x
33
SCRATCH=scratch/no-rpath-pie-powerpc
4+
READELF=${READELF:-readelf}
45

56
no_rpath_bin="${srcdir}/no-rpath-prebuild/no-rpath-pie-powerpc"
67

@@ -27,7 +28,7 @@ if ! echo "$newRPath" | grep -q '/foo:/bar'; then
2728
fi
2829

2930
# Tests for powerpc PIE endianness regressions
30-
readelfData=$(readelf -l ${SCRATCH}/no-rpath 2>&1)
31+
readelfData=$(${READELF} -l ${SCRATCH}/no-rpath 2>&1)
3132

3233
if [ $(echo "$readelfData" | grep --count "PHDR") != 1 ]; then
3334
# Triggered if PHDR errors appear on stderr

tests/phdr-corruption.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ PATCHELF="../src/patchelf"
44
SONAME="phdr-corruption.so"
55
SCRATCH="scratch/$(basename $0 .sh)"
66
SCRATCH_SO="${SCRATCH}/${SONAME}"
7+
READELF=${READELF:-readelf}
78

89
rm -rf "${SCRATCH}"
910
mkdir -p "${SCRATCH}"
@@ -12,7 +13,7 @@ cp "${SONAME}" "${SCRATCH}"
1213
"${PATCHELF}" --set-rpath "$(pwd)" "${SCRATCH_SO}"
1314

1415
# Check for PT_PHDR entry VirtAddr corruption
15-
readelfData=$(readelf -l "${SCRATCH_SO}" 2>&1)
16+
readelfData=$(${READELF} -l "${SCRATCH_SO}" 2>&1)
1617

1718
if [ $(echo "$readelfData" | grep --count "PHDR") != 1 ]; then
1819
# Triggered if PHDR errors appear on stderr

0 commit comments

Comments
 (0)