1 |
The previous attempt actually broke ASM in media-libs/vulkan-loader |
2 |
entirely so that it fell back to C code. After much experimentation |
3 |
and combing through strace output, I found that -x assembler is needed |
4 |
to handle non-standard file extentions and linking is done as a |
5 |
separate step. CMAKE_ASM-ATT_LINK_FLAGS therefore needs to be defined |
6 |
with -nostdlib to avoid errors about undefined main symbols. |
7 |
|
8 |
Closes: https://bugs.gentoo.org/625844 |
9 |
--- |
10 |
One user has confirmed that this patch works for vulkan-loader and I'd |
11 |
like a dev or two to also confirm this before I merge. |
12 |
|
13 |
eclass/cmake-utils.eclass | 3 ++- |
14 |
1 file changed, 2 insertions(+), 1 deletion(-) |
15 |
|
16 |
diff --git a/eclass/cmake-utils.eclass b/eclass/cmake-utils.eclass |
17 |
index f8853be502a1..f6952ec09efd 100644 |
18 |
--- a/eclass/cmake-utils.eclass |
19 |
+++ b/eclass/cmake-utils.eclass |
20 |
@@ -520,7 +520,8 @@ cmake-utils_src_configure() { |
21 |
fi |
22 |
cat > "${build_rules}" <<- _EOF_ || die |
23 |
SET (CMAKE_ASM_COMPILE_OBJECT "<CMAKE_ASM_COMPILER> <DEFINES> ${includes} ${CPPFLAGS} <FLAGS> -o <OBJECT> -c <SOURCE>" CACHE STRING "ASM compile command" FORCE) |
24 |
- SET (CMAKE_ASM-ATT_COMPILE_OBJECT "<CMAKE_ASM_COMPILER> <DEFINES> ${includes} ${CPPFLAGS} <FLAGS> -o <OBJECT> -c <SOURCE>" CACHE STRING "ASM compile command" FORCE) |
25 |
+ 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) |
26 |
+ SET (CMAKE_ASM-ATT_LINK_FLAGS "-nostdlib" CACHE STRING "ASM-ATT link flags" FORCE) |
27 |
SET (CMAKE_C_COMPILE_OBJECT "<CMAKE_C_COMPILER> <DEFINES> ${includes} ${CPPFLAGS} <FLAGS> -o <OBJECT> -c <SOURCE>" CACHE STRING "C compile command" FORCE) |
28 |
SET (CMAKE_CXX_COMPILE_OBJECT "<CMAKE_CXX_COMPILER> <DEFINES> ${includes} ${CPPFLAGS} <FLAGS> -o <OBJECT> -c <SOURCE>" CACHE STRING "C++ compile command" FORCE) |
29 |
SET (CMAKE_Fortran_COMPILE_OBJECT "<CMAKE_Fortran_COMPILER> <DEFINES> ${includes} ${FCFLAGS} <FLAGS> -o <OBJECT> -c <SOURCE>" CACHE STRING "Fortran compile command" FORCE) |
30 |
-- |
31 |
2.16.1 |