[PATCH] D26579: [cmake] Allow CMAKE_BUILD_TYPE=Gentoo
Michał Górny via llvm-commits
llvm-commits at lists.llvm.org
Sat Nov 12 14:12:59 PST 2016
mgorny added a comment.
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.
> 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.
> 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.
I was also wondering about disabling the -Wl,-O3 and friends but not sure about that yet.
https://reviews.llvm.org/D26579
More information about the llvm-commits
mailing list