[PATCH] D26579: [cmake] Allow CMAKE_BUILD_TYPE=Gentoo
Michał Górny via llvm-commits
llvm-commits at lists.llvm.org
Sun Nov 13 00:48:10 PST 2016
mgorny added a comment.
In https://reviews.llvm.org/D26579#593739, @mehdi_amini wrote:
> In https://reviews.llvm.org/D26579#593711, @mgorny wrote:
>
> > In https://reviews.llvm.org/D26579#593702, @mehdi_amini wrote:
> >
> > > There is a good reason Gento is doing it: to make sure they have full control over compiler flags in the Gentoo configuration. See here: https://github.com/coreos/portage-stable/blob/master/eclass/cmake-utils.eclass#L43
> > >
> > > However accepting the value "Gentoo" here won't address the problem, it'll just mask it. We are expecting values from this list in multiple place.
> >
> >
> > Yes. I can volunteer to make sure that Gentoo appears there whenever desired, if that's what you need.
>
>
> That's not what *I* need, that's what *you* need.
I need things to work somehow. Now I'm looking for a solution that would satisfy the other LLVM developers while making them work for us.
>>> For example in llvm/cmake/modules/HandleLLVMOptions.cmake:
>>>
>>> # On non-Debug builds cmake automatically defines NDEBUG, so we
>>> # explicitly undefine it:
>>> if( NOT uppercase_CMAKE_BUILD_TYPE STREQUAL "DEBUG" )
>>>
>>
>> Just to be clear, here 'Gentoo' is not expected since CMake doesn't control -DNDEBUG for this build type.
>
> But here we're gonna add "-UNDEBUG" when the build type is Gentoo, is it OK?
>
>>
>>
>>> if (NOT uppercase_CMAKE_BUILD_TYPE STREQUAL "DEBUG" AND
>>> NOT uppercase_CMAKE_BUILD_TYPE STREQUAL "RELWITHDEBINFO")
>>> add_flag_if_supported("-gline-tables-only" GLINE_TABLES_ONLY)
>>> endif()
>>>
>>
>> …and here it's not expected since appending -g flags implicitly is against a Gentoo policy.
>
> Right, and with BUILD_TYPE=Gentoo this will add "-gline-tables-only".
>
> I don't know what is the right thing for each of these cases, and this alone shows that you'll need to have a clear description and requirement for this "special" build type if you expect to have it supported upstream.
You are right, this is quite confusing.
https://reviews.llvm.org/D26579
More information about the llvm-commits
mailing list