[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#1003219: vulkan-loader: FTBFS on i386: numbered symbols disappeared



Control: forwarded -1 https://github.com/KhronosGroup/Vulkan-Loader/issues/783
Control: tags -1 + patch

On Thu, 06 Jan 2022 at 14:07:40 +0000, Simon McVittie wrote:
> I think this is because changes to the build system resulted in some
> x86-specific code no longer being built on x86. Patches on the way when
> I have tested them.

Please see attached.

You might also want to make debian/libvulkan1.symbols.aarch64 a symlink to
libvulkan1.symbols.amd64, now that aarch64 is treated similarly to x86.

    smcv
From: Simon McVittie <smcv@collabora.com>
Date: Thu, 6 Jan 2022 14:00:45 +0000
Subject: loader: Check for processor of compiler,
 not processor of build system

If we are cross-compiling, for example for aarch64 on x86, then the
compiler we care about here is the machine we are compiling *for*,
e.g. aarch64 (the "target" in CMake terminology, the "host system" in
Autotools/Meson) rather than the machine we are compiling *on*, e.g. x86
(the "host" in CMake terminology, the "build system" in Autotools/Meson).

Signed-off-by: Simon McVittie <smcv@collabora.com>
Bug: https://github.com/KhronosGroup/Vulkan-Loader/issues/783
Bug-Debian: https://bugs.debian.org/1003219
Forwarded: https://github.com/KhronosGroup/Vulkan-Loader/pull/784
---
 loader/CMakeLists.txt | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/loader/CMakeLists.txt b/loader/CMakeLists.txt
index c33858d..e85fef6 100644
--- a/loader/CMakeLists.txt
+++ b/loader/CMakeLists.txt
@@ -224,12 +224,12 @@ else(UNIX AND NOT APPLE) # i.e.: Linux
         set(CMAKE_ASM_FLAGS "${CMAKE_C_FLAGS}")
         set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY)
 
-        if (${CMAKE_HOST_SYSTEM_PROCESSOR} STREQUAL "aarch64")
+        if (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "aarch64")
             try_compile(ASSEMBLER_WORKS ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/asm_test_aarch64.S)
             if(ASSEMBLER_WORKS)
                 set(OPT_LOADER_SRCS ${OPT_LOADER_SRCS} unknown_ext_chain_gas_aarch64.S)
             endif()
-        elseif(${CMAKE_HOST_SYSTEM_PROCESSOR} STREQUAL "x86_64" OR ${CMAKE_HOST_SYSTEM_PROCESSOR} STREQUAL "x86")
+        elseif(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "x86_64" OR ${CMAKE_SYSTEM_PROCESSOR} STREQUAL "x86")
             check_include_file("cet.h" HAVE_CET_H)
             if(HAVE_CET_H)
                 set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS HAVE_CET_H)
@@ -249,7 +249,7 @@ else(UNIX AND NOT APPLE) # i.e.: Linux
         add_custom_target(loader_asm_gen_files DEPENDS gen_defines.asm)
     else()
         if(USE_GAS)
-            message(WARNING "Could not find working ${CMAKE_HOST_SYSTEM_PROCESSOR} GAS assembler\n${ASM_FAILURE_MSG}")
+            message(WARNING "Could not find working ${CMAKE_SYSTEM_PROCESSOR} GAS assembler\n${ASM_FAILURE_MSG}")
         else()
             message(WARNING "Assembly sources have been disabled\n${ASM_FAILURE_MSG}")
         endif()
From: Simon McVittie <smcv@collabora.com>
Date: Thu, 6 Jan 2022 14:03:40 +0000
Subject: loader: Compile x86-specific code on x86 Linux

Unfortunately, the taxonomy used for CMAKE_SYSTEM_PROCESSOR is
OS-specific: on Windows, IA32 is identified as x86, but on Linux,
it can be identified as i386, i486, i586 or i686.

Signed-off-by: Simon McVittie <smcv@collabora.com>
Bug: https://github.com/KhronosGroup/Vulkan-Loader/issues/783
Bug-Debian: https://bugs.debian.org/1003219
Forwarded: https://github.com/KhronosGroup/Vulkan-Loader/pull/784
---
 loader/CMakeLists.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/loader/CMakeLists.txt b/loader/CMakeLists.txt
index e85fef6..d7a876e 100644
--- a/loader/CMakeLists.txt
+++ b/loader/CMakeLists.txt
@@ -229,7 +229,7 @@ else(UNIX AND NOT APPLE) # i.e.: Linux
             if(ASSEMBLER_WORKS)
                 set(OPT_LOADER_SRCS ${OPT_LOADER_SRCS} unknown_ext_chain_gas_aarch64.S)
             endif()
-        elseif(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "x86_64" OR ${CMAKE_SYSTEM_PROCESSOR} STREQUAL "x86")
+        elseif(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "x86_64" OR ${CMAKE_SYSTEM_PROCESSOR} STREQUAL "x86" OR ${CMAKE_SYSTEM_PROCESSOR} MATCHES "^i.86$")
             check_include_file("cet.h" HAVE_CET_H)
             if(HAVE_CET_H)
                 set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS HAVE_CET_H)

Reply to: