1 |
commit: f73d21cbe6317ec0baa2858a4ce4ead72dc7b832 |
2 |
Author: James Le Cuirot <chewi <AT> gentoo <DOT> org> |
3 |
AuthorDate: Mon Mar 19 21:16:34 2018 +0000 |
4 |
Commit: Michael Palimaka <kensington <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat Mar 24 00:09:54 2018 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/kde.git/commit/?id=f73d21cb |
7 |
|
8 |
cmake-utils.eclass: Make the new ASM-ATT rules actually work |
9 |
|
10 |
The previous attempt actually broke ASM in media-libs/vulkan-loader |
11 |
entirely so that it fell back to C code. After much experimentation |
12 |
and combing through strace output, I found that -x assembler is needed |
13 |
to handle non-standard file extentions and linking is done as a |
14 |
separate step. CMAKE_ASM-ATT_LINK_FLAGS therefore needs to be defined |
15 |
with -nostdlib to avoid errors about undefined main symbols. |
16 |
|
17 |
Bug: https://bugs.gentoo.org/625844 |
18 |
|
19 |
eclass/cmake-utils.eclass | 3 ++- |
20 |
1 file changed, 2 insertions(+), 1 deletion(-) |
21 |
|
22 |
diff --git a/eclass/cmake-utils.eclass b/eclass/cmake-utils.eclass |
23 |
index f8853be502..f6952ec09e 100644 |
24 |
--- a/eclass/cmake-utils.eclass |
25 |
+++ b/eclass/cmake-utils.eclass |
26 |
@@ -520,7 +520,8 @@ cmake-utils_src_configure() { |
27 |
fi |
28 |
cat > "${build_rules}" <<- _EOF_ || die |
29 |
SET (CMAKE_ASM_COMPILE_OBJECT "<CMAKE_ASM_COMPILER> <DEFINES> ${includes} ${CPPFLAGS} <FLAGS> -o <OBJECT> -c <SOURCE>" CACHE STRING "ASM compile command" FORCE) |
30 |
- SET (CMAKE_ASM-ATT_COMPILE_OBJECT "<CMAKE_ASM_COMPILER> <DEFINES> ${includes} ${CPPFLAGS} <FLAGS> -o <OBJECT> -c <SOURCE>" CACHE STRING "ASM compile command" FORCE) |
31 |
+ SET (CMAKE_ASM-ATT_COMPILE_OBJECT "<CMAKE_ASM-ATT_COMPILER> <DEFINES> ${includes} ${CPPFLAGS} <FLAGS> -o <OBJECT> -c -x assembler <SOURCE>" CACHE STRING "ASM-ATT compile command" FORCE) |
32 |
+ SET (CMAKE_ASM-ATT_LINK_FLAGS "-nostdlib" CACHE STRING "ASM-ATT link flags" FORCE) |
33 |
SET (CMAKE_C_COMPILE_OBJECT "<CMAKE_C_COMPILER> <DEFINES> ${includes} ${CPPFLAGS} <FLAGS> -o <OBJECT> -c <SOURCE>" CACHE STRING "C compile command" FORCE) |
34 |
SET (CMAKE_CXX_COMPILE_OBJECT "<CMAKE_CXX_COMPILER> <DEFINES> ${includes} ${CPPFLAGS} <FLAGS> -o <OBJECT> -c <SOURCE>" CACHE STRING "C++ compile command" FORCE) |
35 |
SET (CMAKE_Fortran_COMPILE_OBJECT "<CMAKE_Fortran_COMPILER> <DEFINES> ${includes} ${FCFLAGS} <FLAGS> -o <OBJECT> -c <SOURCE>" CACHE STRING "Fortran compile command" FORCE) |