[llvm-commits] Configure patch. CXXFLAGS and CFLAGS option doesn't works. Also we need BUILD_CXXFLAGS and BUILD_CFLAGS

Stepan Dyatkovskiy stpworld at narod.ru
Mon Nov 19 00:09:46 PST 2012


Hi all.
Sorry for latency. Not all good with CFLAGS passing to the Makefile.config.
Configure script generates its own additions ("-g -O2") for CFLAGS, and 
these additions are not controlled by our configure.ac. So even if you 
set up "--enable-optmized", it still does in its: it will build with 
debug symbols.
Here as bug report that describes this issue:
http://comments.gmane.org/gmane.comp.sysutils.autoconf.bugs/6227

To fix that issue, we need avoid playing with some system variables like 
a CFLAGS. If we want to setup flags independent from auto-tools logic, 
we need make their names unknown for tools like autoconf. I propose to 
use the next set of names:

Customize flags for target compiler:
CUSTOM_CFLAGS
CUSTOM_CXXFLAGS
CUSTOM_LDFLAGS

Customize flags for build-platform compiler:
CUSTOM_BUILD_CFLAGS
CUSTOM_BUILD_CXXFLAGS
CUSTOM_BUILD_LDFLAGS

In Makefile.config.in these flags will added to the original ones, that 
are set up by environment (not configure script).

The patch in the attachment contains appropriate changes.

-Stepan.

Stepan Dyatkovskiy wrote:
> So... was that LGTM? Can I commit this patch?
>
> Andrew Trick wrote:
>>
>> On Nov 13, 2012, at 2:19 PM, Eric Christopher <echristo at gmail.com
>> <mailto:echristo at gmail.com>> wrote:
>>
>>> FWIW c++11 can be done via configure flag, same with libc++ :)
>>
>> Now you tell me...
>>
>> Anyway, our Makefile docs state that CXXFLAGS is a configure override,
>> so this patch looks like a good fix to me.
>>
>> -Andy
>>
>>> On Tue, Nov 13, 2012 at 1:31 PM, Andrew Trick <atrick at apple.com
>>> <mailto:atrick at apple.com>> wrote:
>>>
>>>     On Nov 7, 2012, at 8:16 PM, Stepan Dyatkovskiy <STPWORLD at narod.ru
>>>     <mailto:STPWORLD at narod.ru>> wrote:
>>>
>>>     > Hi!
>>>     > CFLAGS and CXXFLAGS are not substituted in Makefile.config.in
>>>     <http://makefile.config.in/>.
>>>     > Also it would be good to customize CFLAGS, CXXFLAGS and LDFLAGS
>>>     for build platform while doing cross-compilation.
>>>     > Please review the patch in attachment.
>>>     > -Stepan.
>>>
>>>     Thanks! This kept me from moving to c++11, which I have to do very
>>>     selectively.
>>>
>>>     I didn't try your cross-compiler options, but it seems simple
>>> enough.
>>>
>>>     -Andy
>>>
>>>     _______________________________________________
>>>     llvm-commits mailing list
>>>     llvm-commits at cs.uiuc.edu <mailto:llvm-commits at cs.uiuc.edu>
>>>     http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>>>
>>>
>>
>

-------------- next part --------------
A non-text attachment was scrubbed...
Name: configure-flags.patch
Type: text/x-diff
Size: 6224 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20121119/c3a3b3fb/attachment.patch>


More information about the llvm-commits mailing list