[PATCH] Expose LLVM build flags in LLVMConfig.cmake

Dan Liew dan at su-root.co.uk
Fri Jul 18 11:13:56 PDT 2014


On 18 Jul 2014 17:41, "Brad King" <brad.king at kitware.com> wrote:
>
> On 07/18/2014 12:15 PM, Dan Liew wrote:
> > The most important differences seem to be the use of the following flags
> > -ffunction-sections
> > -fno-exceptions
> > -fno-rtti
> > -pedantic
>
> IMO we also do not need to tell applications about incidental flags
> like "-W...".  Currently you read CMAKE_<LANG>_FLAGS:
>
> > +set(LLVM_CFLAGS "${CMAKE_C_FLAGS}")
> > +set(LLVM_CXXFLAGS "${CMAKE_CXX_FLAGS}")
>
> but there are other places that flags can appear.  Instead we should
> construct an explicit list of flags that applications need to use to
> achieve ABI compatibility and export only those.

Would you suggest reading the compile flags from a target (e.g. llvm-dis )
and filtering out unneeded ones (e.g. warning flags and optimisation
level)? Or are you suggesting a hard coded list that we put into
LLVMConfig.cmake? If the latter we would need to maintain a list for
different compilers.

I also don't know what flags are "really" needed. In my experience
-fno-rtti and -DNDEBUG ( if LLVM was built with assertions) was sufficient
for my use but this really isn't my area of expertise.

Does anyone know? Should I ask on LLVMdev?

Dan.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140718/a3929abd/attachment.html>


More information about the llvm-commits mailing list