From 7592008030a67ebe0dbda20aa041d5c347170611 Mon Sep 17 00:00:00 2001 From: Tao Bao Date: Wed, 22 Apr 2015 10:37:38 -0700 Subject: [PATCH] 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 --- libc/kernel/tools/cpp.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libc/kernel/tools/cpp.py b/libc/kernel/tools/cpp.py index ff5136e65..10ce29022 100644 --- a/libc/kernel/tools/cpp.py +++ b/libc/kernel/tools/cpp.py @@ -14,7 +14,6 @@ if top is None: # 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 TokenGroup 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