[clang] Multilib support for libraries with exceptions (PR #75031)

Dominik Wójt via cfe-commits cfe-commits at lists.llvm.org
Thu Feb 1 02:18:26 PST 2024


================
@@ -264,6 +273,14 @@ ToolChain::getMultilibFlags(const llvm::opt::ArgList &Args) const {
     break;
   }
 
+  // Include fno-exceptions and fno-rtti
+  // to improve multilib selection
+  if (getRTTIMode() == ToolChain::RTTIMode::RM_Disabled)
+    Result.push_back("-fno-rtti");
----------------
domin144 wrote:

Could we have a positive flag, too?
I know it is not useful for now, as we are not able to say, that some feature of a standard library is available - only that it is allowed. However, if in the future such mechanism was added, than I think it would be more natural to say:
"If user specifies '-frtti', then the library candidate also needs '-frtti'"
than to say:
"If user specifies '-fno-rtti', than the library is allowed to have '-fno-rtti'".

https://github.com/llvm/llvm-project/pull/75031


More information about the cfe-commits mailing list