[llvm-dev] Options not found when compile OpenSSL with clang

Neil Zhao via llvm-dev llvm-dev at lists.llvm.org
Fri Oct 19 15:25:46 PDT 2018


Hi all,

I am developing an LLVM pass. To keep the project lightweight, I compiled
the pass to .so and add "-Xclang -load -Xclang /path/to/.so
-mllvm my-pass-options" to CFLAGS. I tested it on OpenSSL, it worked fine
with those .c files but failed on compiling an assembly file (.s). The
error messages showed that it could not find the options I defined in the
pass. I think that's because clang does not load an external pass for .s
files, so it won't find external pass options I put in
"-mllvm my-pass-options". However, in the OpenSSL's makefile, FLAGS for
compiling .c files and .s files are the same, which means I cannot use
different FLAGS for compiling .s files easily (or I need to change lots of
lines of OpenSSL's makefile which is not recommended). So here is my
question, is there any way to use my external pass with customed options in
OpenSSL without changing its makefile a lot? (i.e. FLAGS work fine with
both .c and .s files).

One solution I know is putting the pass in LLVM source code directory and
compile the whole project, then use the clang compiled from that directory.
However, I think it is not user-friendly to do that.

** My environment:
        LLVM-3.8
        clang version 3.8.1-24
        Debian GNU/Linux 9 (stretch)

Thanks for your attention!

Sincerely,
Neil

-- 
UIUC | Computer Science | Software Engineering
GitHub: https://github.com/zzrcxb
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20181019/66faf708/attachment.html>


More information about the llvm-dev mailing list