This is an archive of the discontinued LLVM Phabricator instance.

llvm-config: Add --has-rtti option
ClosedPublic

Authored by • tstellarAMD on Aug 7 2015, 2:33 PM.

Details

Summary

This prints NO if LLVM was built with -fno-rtti or an equivalent flag
and YES otherwise. The reasons to add -has-rtti rather than adding -fno-rtti
to --cxxflags are:

  1. Building LLVM with -fno-rtti does not always mean that client

applications need this flag.

  1. Some compilers have a different flag for disabling rtti, and the

compiler being used to build LLVM may not be the compiler being used to
build the application.

Diff Detail

Event Timeline

• tstellarAMD retitled this revision from to llvm-config: Add --has-rtti option.
• tstellarAMD updated this object.
• tstellarAMD added a subscriber: llvm-commits.
beanz edited edge metadata.Aug 13 2015, 4:53 PM

Tom,

What about -fno-exceptions? Does we need to handle that flag similarly? There is a thread on llvm-commits today that proposed an alternate solution that covers that case too.

I cc'd you on the thread on llvm-commits, can you please review and provide feedback.

Thanks,
-Chris

Tom,

What about -fno-exceptions? Does we need to handle that flag similarly? There is a thread on llvm-commits today that proposed an alternate solution that covers that case too.

I cc'd you on the thread on llvm-commits, can you please review and provide feedback.

Thanks,
-Chris

Tom,

What about -fno-exceptions? Does we need to handle that flag similarly? There is a thread on llvm-commits today that proposed an alternate solution that covers that case too.

I don't think that compiling LLVM with -fno-exceptions requires library users to use the same, which would mean we don't need a flag for it. However, we should find someone who knows C++ better than I to confirm or refute this.

Tom,

What about -fno-exceptions? Does we need to handle that flag similarly? There is a thread on llvm-commits today that proposed an alternate solution that covers that case too.

I don't think that compiling LLVM with -fno-exceptions requires library users to use the same, which would mean we don't need a flag for it. However, we should find someone who knows C++ better than I to confirm or refute this.

Correct. -fno-exceptions code can link against -fexceptions code. You'll only see issues if you attempt to throw across the boundary (for example in a callback).

jroelofs accepted this revision.Oct 27 2015, 1:33 PM
jroelofs added a reviewer: jroelofs.

LGTM

This revision is now accepted and ready to land.Oct 27 2015, 1:33 PM
This revision was automatically updated to reflect the committed changes.