[cfe-dev] Choosing the unwinder / C++ low-level libraries in Clang

Renato Golin renato.golin at linaro.org
Thu Jul 23 02:40:31 PDT 2015


Folks,

We have an option to choose the compiler library called --rtlib which
chooses between libgcc and compiler-rt.

The problem with that is which unwinder / C++ library goes along
compiler library? The main options today are libgcc_s, libgcc_eh,
libunwind (2 versions) and libc++abi. There are probably more.

One could want to test any variation, and for that, (s)he should
manually include them using the -l option, but there could be a
simpler way to add the basic combos. The main ones:

GCC: gcc_s and gcc_eh
LLVM: libunwind and libc++abi
Windows: ??
Savannah: libunwind(2) and ??

There may be more, but for now, let's start with these two.

I will de-couple compiler-rt with any of those combos by removing the
automatic include of ligcc_* with compiler-rt (a poor choice of mine),
but I'm now stuck on two things:

1. Name. I want it to be short and to look like --rtlib. So I'm
looking for a short name matching --rt[a-z]{1,4}. "rtunw" or "rtcpp"
would mislead users in thinking it's either one of the other.
"rtextra" means very little and is too long. "rtbase", "rtlow",
"llrt"?

2. Defaults. I think it makes sense to have gcc_* as default when
--rtlib=libgcc, but I'm not convinced that the LLVM counterparts
should be default for compiler-rt, especially on GNU systems. Maybe
the sanest options would be to set the default for GCC and not for
LLVM or Windows.

Opinions?

cheers,
--renato



More information about the cfe-dev mailing list