[LLVMdev] llvm-config --cxxflags is not consistent when building by cmake.

Luba Tang
Wed, 21 Nov 2012 13:09:54 -0000

Hi,

We found `llvm-config --cxxflags' does not have -fno-exceptions -fno-rtti
when using cmake to build LLVM.
Does anyone know how to fix it?

Best regards,
Luba

---------- Forwarded message ----------
From: Luba Tang <lubatang at gmail.com>
Date: 2012/11/21
Subject: Re: [MCLinker] Re: Major release - MCLinker 2.0.0 - RockBull
To: mclinker at googlegroups.com


Hi,

We make sure the fault source is from llvm-config.
When you build LLVM by cmake, cmake will add -fno-rtti to build LLVM for
you.
But there is something wrong on llvm-config.
cmake does not add correct options in llvm-config.

Best regards,
Luba


2012/11/21 Luba Tang <lubatang at gmail.com>

> Hi, Kito,
>
> Did you ever use --enable-expensive-checks when you configure LLVM?
>
> ${LLVM_BUILD}/configure --enable-expensive-checks
>
> or
>
> _GLIBCXX_DEBUG
>
> is in your environment?
>
> This will enable RTTI for LLVM
>
>
> 2012/11/21 Kito Cheng <kito at 0xlab.org>
>
>> > Hi, Kito,
>> >
>> > I check the trunk r168413, `llvm-config --cxxflags' shows
>> > -I/Users/lubatang/SysRoot/include  -D_DEBUG -D_GNU_SOURCE
>> > -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS
-D__STDC_LIMIT_MACROS -g
>> > -fvisibility-inlines-hidden -fno-exceptions -fno-rtti -fno-common
>> > -Woverloaded-virtual -Wcast-qual
>> >
>> > And -fno-rtti really in our compilation flags.
>> >
>> > The other possibility is llvm::MachineFunctionPass declares  a
virtual
>> > function but without implementation.
>> > I check the newest LLVM, and I'm sure all member functions are
>> implemented.
>>
>> Wow, it's not in my llvm-config --cxxflags...XD
>>
>> [kito at iCare ~]$ llvm-config --cxxflags
>> -I/home/kito/include  -fPIC -fvisibility-inlines-hidden -O3 -DNDEBUG
>> -D_GNU_SOURCE -Wall -W -Wno-unused-parameter -Wwrite-strings -pedantic
>> -Wno-long-long -Wcovered-switch-default -D__STDC_CONSTANT_MACROS
>> -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS
>>
>> fedora 16 x86_64 + clang/llvm trunk(r168418), and compile clang/llvm by
>> it self.
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://lists.llvm.org/pipermail/llvm-dev/attachments/20121121/71e7e109/attachment.html>