summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2008-05-09 15:46:54 (GMT)
committerEelco Dolstra <e.dolstra@tudelft.nl>2008-05-09 15:46:54 (GMT)
commit26f47987c5546783859e65d4f3dbec2fc93c8b62 (patch)
treec4e65988f4c31994f8159ffebb4436a625fdcfec /tests
parentd5cc557d2d5a73788ec99004b1c061bf85c5fd91 (diff)
downloadpatchelf-26f47987c5546783859e65d4f3dbec2fc93c8b62.zip
patchelf-26f47987c5546783859e65d4f3dbec2fc93c8b62.tar.gz
patchelf-26f47987c5546783859e65d4f3dbec2fc93c8b62.tar.bz2
* Fix the tests on FreeBSD. On FreeBSD, the RPATH is scoped: adding a
directory to the RPATH of an executable doesn't cause it to be used for resolving dependencies of libraries, only the dependencies of the executable itself. So don't rely on that. A better fix would be to support --set-rpath on libraries, but that's a lot harder.
Diffstat (limited to 'tests')
-rwxr-xr-xtests/big-dynstr.sh4
-rw-r--r--tests/main.c3
-rwxr-xr-xtests/set-rpath.sh4
3 files changed, 10 insertions, 1 deletions
diff --git a/tests/big-dynstr.sh b/tests/big-dynstr.sh
index 2674e18..9f76600 100755
--- a/tests/big-dynstr.sh
+++ b/tests/big-dynstr.sh
@@ -13,6 +13,10 @@ oldRPath=$(../src/patchelf --print-rpath scratch/big-dynstr)
if test -z "$oldRPath"; then oldRPath="/oops"; fi
../src/patchelf --set-rpath $oldRPath:$(pwd)/scratch/libsA:$(pwd)/scratch/libsB scratch/big-dynstr
+if test "$(uname)" = FreeBSD; then
+ export LD_LIBRARY_PATH=$(pwd)/scratch/libsB
+fi
+
exitCode=0
cd scratch && ./big-dynstr || exitCode=$?
diff --git a/tests/main.c b/tests/main.c
index 8d71605..6252c34 100644
--- a/tests/main.c
+++ b/tests/main.c
@@ -6,8 +6,9 @@ int foo();
int main(int argc, char * * argv)
{
+ int x;
printf("Hello World\n");
- int x = foo();
+ x = foo();
printf("Result is %d\n", x);
return x;
}
diff --git a/tests/set-rpath.sh b/tests/set-rpath.sh
index cbe1006..b71e0f4 100755
--- a/tests/set-rpath.sh
+++ b/tests/set-rpath.sh
@@ -21,6 +21,10 @@ if test -z "$oldRPath"; then oldRPath="/oops"; fi
#if test -z "$oldRPath"; then oldRPath="/oops"; fi
#../src/patchelf --set-rpath $oldRPath:$(pwd)/scratch/libsC scratch/libsB/libbar.so
+if test "$(uname)" = FreeBSD; then
+ export LD_LIBRARY_PATH=$(pwd)/scratch/libsB
+fi
+
exitCode=0
cd scratch && ./main || exitCode=$?