Joshua Tuttle
2014-Jul-18 16:04 UTC
[LLVMdev] Running an LLVM pass during an android compile
We have developed and tested an optimization pass using LLVM, and have been able to build other software such as gzip while running our pass by passing "clang" and "-Xclang -load -Xclang <path to .so>" as configure options. Now we would like to try and build android while running our pass only on certain files. It seems that android has its own version of LLVM built into it, and we haven't been successful with the aforementioned parameters working in the android makefiles. Does anyone know what is necessary to get the android version of LLVM to run our pass? Thanks, Josh ________________________________ This message and all attachments are PRIVATE, and contain information that is PROPRIETARY to Intelligent Automation, Inc. You are not authorized to transmit or otherwise disclose this message or any attachments to any third party whatsoever without the express written consent of Intelligent Automation, Inc. If you received this message in error or you are not willing to view this message or any attachments on a confidential basis, please immediately delete this email and any attachments and notify Intelligent Automation, Inc. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140718/735503da/attachment.html>
In Android.mk, have you tried the following options? LOCAL_CLANG := true LOCAL_CFLAGS := <some flags here for clang, e.g., -flto> LOCAL_LDFLAGS := <some flags for clang at link time, e.g., -flto -Wl,--plugin-opt=-mattr=+aes> If these don't work, could you be more specific about the errors that you get? Thanks, Tom On Fri, Jul 18, 2014 at 9:04 AM, Joshua Tuttle <jtuttle at i-a-i.com> wrote:> We have developed and tested an optimization pass using LLVM, and have > been able to build other software such as gzip while running our pass by > passing "clang" and "-Xclang -load -Xclang <path to .so>" as configure > options. Now we would like to try and build android while running our pass > only on certain files. It seems that android has its own version of LLVM > built into it, and we haven't been successful with the aforementioned > parameters working in the android makefiles. Does anyone know what is > necessary to get the android version of LLVM to run our pass? > > > Thanks, > > Josh > > > > ------------------------------ > This message and all attachments are PRIVATE, and contain information that > is PROPRIETARY to Intelligent Automation, Inc. You are not authorized to > transmit or otherwise disclose this message or any attachments to any third > party whatsoever without the express written consent of Intelligent > Automation, Inc. If you received this message in error or you are not > willing to view this message or any attachments on a confidential basis, > please immediately delete this email and any attachments and notify > Intelligent Automation, Inc. > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140718/0da268ff/attachment.html>
Joshua Tuttle
2014-Jul-18 21:57 UTC
[LLVMdev] Running an LLVM pass during an android compile
Tom, Thanks for the reply. I have tried the following options in Android.mk LOCAL_CLANG := true LOCAL_CFLAGS := -Xclang -load -Xclang /home/josh/llvm.tan/lib/LLVMHello.so (I'm using this pass just to see if it will run through) The error I get when tying to compile is as follows: target thumb C++: keystore <= system/security/keystore/keystore.cpp target thumb C++: keystore <= system/security/keystore/keyblob_utils.cpp error: unable to load plugin '/home/josh/llvm.tan/lib/LLVMHello.so': '/home/josh/llvm.tan/lib/LLVMHello.so: undefined symbol: _ZNK4llvm4Pass11getPassNameEv' make: *** [out/target/product/nitrogen6x/obj/EXECUTABLES/keystore_intermediates/keystore.o] Error 1 make: *** Waiting for unfinished jobs.... error: unable to load plugin '/home/josh/llvm.tan/lib/LLVMHello.so': '/home/josh/llvm.tan/lib/LLVMHello.so: undefined symbol: _ZNK4llvm4Pass11getPassNameEv' make: *** [out/target/product/nitrogen6x/obj/EXECUTABLES/keystore_intermediates/keyblob_utils.o] Error 1 I'm assuming this error message is related to some kind of linker problem, but I am not sure why, considering this pass does nothing more than print out function names to the terminal. If I run the compile with out the CFLAGS, it works fine. ________________________________ From: Tom Roeder <tmroeder at google.com> Sent: Friday, July 18, 2014 5:45 PM To: Joshua Tuttle Cc: llvmdev at cs.uiuc.edu Subject: Re: [LLVMdev] Running an LLVM pass during an android compile In Android.mk, have you tried the following options? LOCAL_CLANG := true LOCAL_CFLAGS := <some flags here for clang, e.g., -flto> LOCAL_LDFLAGS := <some flags for clang at link time, e.g., -flto -Wl,--plugin-opt=-mattr=+aes> If these don't work, could you be more specific about the errors that you get? Thanks, Tom On Fri, Jul 18, 2014 at 9:04 AM, Joshua Tuttle <jtuttle at i-a-i.com<mailto:jtuttle at i-a-i.com>> wrote: We have developed and tested an optimization pass using LLVM, and have been able to build other software such as gzip while running our pass by passing "clang" and "-Xclang -load -Xclang <path to .so>" as configure options. Now we would like to try and build android while running our pass only on certain files. It seems that android has its own version of LLVM built into it, and we haven't been successful with the aforementioned parameters working in the android makefiles. Does anyone know what is necessary to get the android version of LLVM to run our pass? Thanks, Josh ________________________________ This message and all attachments are PRIVATE, and contain information that is PROPRIETARY to Intelligent Automation, Inc. You are not authorized to transmit or otherwise disclose this message or any attachments to any third party whatsoever without the express written consent of Intelligent Automation, Inc. If you received this message in error or you are not willing to view this message or any attachments on a confidential basis, please immediately delete this email and any attachments and notify Intelligent Automation, Inc. _______________________________________________ LLVM Developers mailing list LLVMdev at cs.uiuc.edu<mailto:LLVMdev at cs.uiuc.edu> http://llvm.cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev ________________________________ This message and all attachments are PRIVATE, and contain information that is PROPRIETARY to Intelligent Automation, Inc. You are not authorized to transmit or otherwise disclose this message or any attachments to any third party whatsoever without the express written consent of Intelligent Automation, Inc. If you received this message in error or you are not willing to view this message or any attachments on a confidential basis, please immediately delete this email and any attachments and notify Intelligent Automation, Inc. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140718/a9b33be3/attachment.html>