coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] tests: avoid LD_PRELOAD lookup error for dlsym


From: Jim Meyering
Subject: [PATCH] tests: avoid LD_PRELOAD lookup error for dlsym
Date: Mon, 07 May 2012 22:03:30 +0200

Thanks to the nixos/hydra autobuilder, I noticed that the new
LD_PRELOAD-based test was failing in one of their build environments:

  http://hydra.nixos.org/build/2531974

    + echo xyz
    + LD_PRELOAD=./k.so
    + cp src d
    cp: symbol lookup error: ./k.so: undefined symbol: dlsym

Here's the probable fix:

>From fedebc59a040a7e34dce5c987b7f6fcf2cefa904 Mon Sep 17 00:00:00 2001
From: Jim Meyering <address@hidden>
Date: Mon, 7 May 2012 22:01:20 +0200
Subject: [PATCH] tests: avoid LD_PRELOAD lookup error for dlsym

* tests/cp/nfs-removal-race: Link with -ldl.
---
 tests/cp/nfs-removal-race | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/cp/nfs-removal-race b/tests/cp/nfs-removal-race
index 6a435b0..cb8aba3 100755
--- a/tests/cp/nfs-removal-race
+++ b/tests/cp/nfs-removal-race
@@ -57,7 +57,7 @@ __xstat (int ver, const char *path, struct stat *st)
 EOF

 # Then compile/link it:
-$CC -shared -fPIC -O2 k.c -o k.so \
+$CC -shared -fPIC -O2 k.c -o k.so -ldl \
   || framework_failure_ 'failed to compile with -shared -fPIC'

 touch d2 || framework_failure_
--
1.7.10.1.457.g8275905



reply via email to

[Prev in Thread] Current Thread [Next in Thread]