git » libfiu » commit fe37569

preload/posix: Make ldd invocation work in FreeBSD

author Alberto Bertogli
2010-10-13 15:36:39 UTC
committer Alberto Bertogli
2010-10-13 15:36:39 UTC
parent c18d9ff24a5236f8e3830e06a51e8cfbeab3580e

preload/posix: Make ldd invocation work in FreeBSD

Some ldd versions, specifically the one in FreeBSD 8.1, require that the
shared library given as an argument start with "./" if it's in the current
working directory, otherwise it won't find it.

Signed-off-by: Alberto Bertogli <albertito@blitiri.com.ar>

preload/posix/Makefile +4 -2

diff --git a/preload/posix/Makefile b/preload/posix/Makefile
index d554f3e..888e373 100644
--- a/preload/posix/Makefile
+++ b/preload/posix/Makefile
@@ -68,10 +68,12 @@ build-needlibdl:
 	@rm dlcheck.so
 
 # libc's soname depends on the platform (most use libc.so.6, but for example
-# ia64 and alpha use libc.so.6.1), so find which one to use at build-time
+# ia64 and alpha use libc.so.6.1), so find which one to use at build-time.
+# Please note that the argument to ldd *must* start with "./", otherwise some
+# "ldd"s won't work (for example, the one in FreeBSD 8.1).
 build-libcsoname:
 	@$(CC) -x c /dev/null -lc -shared -o build-libccheck.so
-	@ldd build-libccheck.so | grep libc.so | awk '{ print $$1 }' > $@
+	@ldd ./build-libccheck.so | grep libc.so | awk '{ print $$1 }' > $@
 	@rm build-libccheck.so
 	@test "`cat $@`" != "" || \
 		(echo "Error finding soname, please report"; rm $@; exit 1)