[PATCH][CMake] Fix PR14200, llvm-config output misses -fno-rtti

Hans Wennborg via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 13 09:55:20 PDT 2015


On Sun, Aug 2, 2015 at 9:27 AM, David Wiberg <dwiberg at gmail.com> wrote:
> Hi,
>
> I took a stab at solving PR14200. My CMake knowledge is low but I think the
> solution is reasonable as it reuses the existing logic for setting flags.

Alexey: you're a cmake wizard. Can you take a look at this?

Chandler: you're the cmake owner. I'd like to merge this to 3.7 when
it lands if that's OK.

> Things worth noting during review:
> - The change means that both RTTI and exception handling flags will be
> reported by llvm-config.
> - I'm creating a variable with the same name as a target property. I don't
> know if this breaks any convention.

I tried this locally, and the output of llvm-config --cxxflags changed from:

  -I/work/llvm/include -I/work/llvm/build.release/include  -fPIC
-fvisibility-inlines-hidden -Wall -W -Wno-unused-parameter
-Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic
-Wno-long-long -Wno-maybe-uninitialized -Wno-comment -std=c++11
-ffunction-sections -fdata-sections -O3   -D_GNU_SOURCE
-D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS

to:

  -I/work/llvm/include -I/work/llvm/build.release/include  -fPIC
-fvisibility-inlines-hidden -Wall -W -Wno-unused-parameter
-Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic
-Wno-long-long -Wno-maybe-uninitialized -Wno-comment -std=c++11
-ffunction-sections -fdata-sections -O3  -fno-exceptions -fno-rtti
-D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS
-D__STDC_LIMIT_MACROS

which seems correct.

Thanks,
Hans


More information about the llvm-commits mailing list