]> granicus.if.org Git - clang/commitdiff
Preserve LD_LIBRARY_PATH when using the 'env' command
authorHal Finkel <hfinkel@anl.gov>
Wed, 3 Dec 2014 08:19:17 +0000 (08:19 +0000)
committerHal Finkel <hfinkel@anl.gov>
Wed, 3 Dec 2014 08:19:17 +0000 (08:19 +0000)
In many Linux environments (and similar), just-built applications won't run
correctly without making use of the current LD_LIBRARY_PATH environmental
variable in order to find dynamic libraries. Propagate it through the 'env'
command (hopefully this works on all platforms).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@223219 91177308-0d34-0410-b5e6-96231b3b80d8

test/Driver/env.c

index 5ce5831ccd248a3f5617fa597d039fcf8490380c..a47ebf10caa93ac9c583dbc21dba9e79de5e692e 100644 (file)
@@ -5,12 +5,14 @@
 // REQUIRES: shell
 //
 // The PATH variable is heavily used when trying to find a linker.
-// RUN: env -i LC_ALL=C %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: env -i LC_ALL=C LD_LIBRARY_PATH="$LD_LIBRARY_PATH" \
+// RUN:   %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
 // RUN:     --target=i386-unknown-linux \
 // RUN:     --sysroot=%S/Inputs/basic_linux_tree \
 // RUN:   | FileCheck --check-prefix=CHECK-LD-32 %s
 //
-// RUN: env -i LC_ALL=C PATH="" %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN: env -i LC_ALL=C PATH="" LD_LIBRARY_PATH="$LD_LIBRARY_PATH" \
+// RUN:   %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
 // RUN:     --target=i386-unknown-linux \
 // RUN:     --sysroot=%S/Inputs/basic_linux_tree \
 // RUN:   | FileCheck --check-prefix=CHECK-LD-32 %s