From 7c0d61eaaf0bcf5a97beda4283a44448e8d609fe Mon Sep 17 00:00:00 2001 From: Hal Finkel Date: Wed, 3 Dec 2014 08:19:17 +0000 Subject: [PATCH] Preserve LD_LIBRARY_PATH when using the 'env' command 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). llvm-svn: 223219 --- clang/test/Driver/env.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/clang/test/Driver/env.c b/clang/test/Driver/env.c index 5ce5831..a47ebf1 100644 --- a/clang/test/Driver/env.c +++ b/clang/test/Driver/env.c @@ -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 -- 2.7.4