Update the search path for libclang.so

Prebuilt shared libraries (libclang.so, libLLVM.so and etc) have been
moved to prebuilts/sdk/tools/linux/lib64. Update the search path in
cpp.py to match the change.

Bug: 20485471
Change-Id: Ib7784db4d5529d16a1e2bfc07cb0237929bc5a64
diff --git a/libc/kernel/tools/cpp.py b/libc/kernel/tools/cpp.py
index ff5136e..10ce290 100644
--- a/libc/kernel/tools/cpp.py
+++ b/libc/kernel/tools/cpp.py
@@ -14,7 +14,6 @@
 
 # Set up the env vars for libclang.
 site.addsitedir(os.path.join(top, 'external/clang/bindings/python'))
-os.putenv('LD_LIBRARY_PATH', os.path.join(top, 'prebuilts/sdk/tools/linux'))
 
 import clang.cindex
 from clang.cindex import conf
@@ -26,6 +25,10 @@
 from clang.cindex import TokenKind
 from clang.cindex import TranslationUnit
 
+# Set up LD_LIBRARY_PATH to include libclang.so, libLLVM.so, and etc.
+# Note that setting LD_LIBRARY_PATH with os.putenv() sometimes doesn't help.
+clang.cindex.Config.set_library_path(os.path.join(top, 'prebuilts/sdk/tools/linux/lib64'))
+
 from defaults import kCppUndefinedMacro
 from defaults import kernel_remove_config_macros
 from defaults import kernel_token_replacements