Adding an LLVM Optimization Pass while Building openSSL Using Clang

Ange-Thierry Ishimwe Ange-Thierry.Ishimwe at colorado.edu
Wed Apr 3 06:14:57 UTC 2024


Thanks Matt! That worked for me, I ended up using a Python script instead
though.

Ange

On Tue, Apr 2, 2024 at 1:57 AM Matt Caswell <matt at openssl.org> wrote:

> [External Email - Use caution]
>
>
> On 02/04/2024 03:11, Ange-Thierry Ishimwe wrote:
> > Hi all,
> >
> > I am currently working on building OpenSSL for RISC-V architecture using
> > clang/llvm. While I've successfully compiled OpenSSL and generated a
> > binary using the linux64-riscv64 configuration, I would like to
> > integrate an LLVM optimization pass into the compilation process before
> > the object files are created.
> >
> > *_Traditionally, the OpenSSL process follows the pattern:_*
> > clang [source file] -o [obj file]
> >
> > *_However, my objective is to introduce an additional step in the
> > process, as follows:
> > _clang *[source file] -o [LLVM IR File]
> > *opt *[LLVM IR File] -o [OPTIMIZED LLVM IR File]
> > *clang *[OPTIMIZED LLVM IR File] -o [obj file]
> >
> > Basically, I want to create intermediate representations (IR), apply a
> > custom optimization pass on them, and subsequently produce an object
> > file on all the source files.
> >
> > Could I please get some guidance or point me in the right direction on
> > how to achieve this within the OpenSSL build process?
> >
> > Your assistance would be greatly appreciated.
>
> I've not tried this, but my immediate thought would be to wrap the 3
> step process up in a shell script and then use your shell script as the
> "compiler", e.g.
>
>
> CC=myscript.sh ./config ...
>
>
> Matt
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mta.openssl.org/pipermail/openssl-users/attachments/20240403/54b4137b/attachment.htm>


More information about the openssl-users mailing list