Gentoo Archives: gentoo-commits

From: "Michał Górny" <mgorny@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: eclass/
Date: Thu, 01 Dec 2016 22:39:44
Message-Id: 1480631973.cbf4efdad952074b3adc412c87ad766d40165293.mgorny@gentoo
1 commit: cbf4efdad952074b3adc412c87ad766d40165293
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Wed Nov 30 23:02:32 2016 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Thu Dec 1 22:39:33 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=cbf4efda
7
8 cmake-utils.eclass: Set assembler correctly, #601292
9
10 Use <CMAKE_ASM_COMPILER> in the assembly compile command in order to fix
11 building assembly files. It turns out that <CMAKE_C_COMPILER> is no
12 longer correctly evaluated in that command once it is no longer set
13 explicitly in the toolchain file and passed through the environment
14 instead.
15
16 Pass ASM and ASMFLAGS (equal to CC and CFLAGS) appropriately to enforce
17 using the correct compiler.
18
19 eclass/cmake-utils.eclass | 4 +++-
20 1 file changed, 3 insertions(+), 1 deletion(-)
21
22 diff --git a/eclass/cmake-utils.eclass b/eclass/cmake-utils.eclass
23 index b21435b..784ae44 100644
24 --- a/eclass/cmake-utils.eclass
25 +++ b/eclass/cmake-utils.eclass
26 @@ -517,7 +517,7 @@ enable_cmake-utils_src_configure() {
27 includes="<INCLUDES>"
28 fi
29 cat > "${build_rules}" <<- _EOF_ || die
30 - SET (CMAKE_ASM_COMPILE_OBJECT "<CMAKE_C_COMPILER> <DEFINES> ${includes} ${CFLAGS} <FLAGS> -o <OBJECT> -c <SOURCE>" CACHE STRING "ASM compile command" FORCE)
31 + SET (CMAKE_ASM_COMPILE_OBJECT "<CMAKE_ASM_COMPILER> <DEFINES> ${includes} ${CPPFLAGS} <FLAGS> -o <OBJECT> -c <SOURCE>" CACHE STRING "ASM compile command" FORCE)
32 SET (CMAKE_C_COMPILE_OBJECT "<CMAKE_C_COMPILER> <DEFINES> ${includes} ${CPPFLAGS} <FLAGS> -o <OBJECT> -c <SOURCE>" CACHE STRING "C compile command" FORCE)
33 SET (CMAKE_CXX_COMPILE_OBJECT "<CMAKE_CXX_COMPILER> <DEFINES> ${includes} ${CPPFLAGS} <FLAGS> -o <OBJECT> -c <SOURCE>" CACHE STRING "C++ compile command" FORCE)
34 SET (CMAKE_Fortran_COMPILE_OBJECT "<CMAKE_Fortran_COMPILER> <DEFINES> ${includes} ${FCFLAGS} <FLAGS> -o <OBJECT> -c <SOURCE>" CACHE STRING "Fortran compile command" FORCE)
35 @@ -532,6 +532,8 @@ enable_cmake-utils_src_configure() {
36 # Bug 542530, export those instead of setting paths in toolchain file
37 local -x CC=$(tc-getCC) CXX=$(tc-getCXX) FC=$(tc-getFC)
38 local -x PKG_CONFIG=$(tc-getPKG_CONFIG)
39 + # Bug 601292, set the compiler for assembly as well
40 + local -x ASM=$(tc-getCC) ASMFLAGS=${CFLAGS}
41
42 if tc-is-cross-compiler; then
43 local sysname