Open svenstaro opened 2 years ago
i have this patch on my local package
diff --git a/External/CMakeLists.txt b/External/CMakeLists.txt
index cbabd2e3..05ae305e 100644
--- a/External/CMakeLists.txt
+++ b/External/CMakeLists.txt
@@ -71,7 +70,8 @@ endif()
if(ENABLE_OPT AND NOT TARGET SPIRV-Tools-opt)
if(IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/spirv-tools)
set(SPIRV_SKIP_TESTS ON CACHE BOOL "Skip building SPIRV-Tools tests")
- add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/spirv-tools spirv-tools)
+ set(BUILD_SHARED_LIBS OFF CACHE BOOL "Disable build shared libs" FORCE)
+ add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/spirv-tools EXCLUDE_FROM_ALL)
endif()
endif()
diff --git a/SPIRV/CMakeLists.txt b/SPIRV/CMakeLists.txt
index 22f767d7..8fe24363 100644
--- a/SPIRV/CMakeLists.txt
+++ b/SPIRV/CMakeLists.txt
@@ -98,7 +100,7 @@ if(ENABLE_OPT)
target_link_libraries(SPIRV PRIVATE MachineIndependent SPIRV-Tools-opt)
target_include_directories(SPIRV PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../External>
- $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/External>)
+ $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)
else()
target_link_libraries(SPIRV PRIVATE MachineIndependent)
endif()
diff --git a/StandAlone/CMakeLists.txt b/StandAlone/CMakeLists.txt
index 2b163e7f..6247a42e 100644
--- a/StandAlone/CMakeLists.txt
+++ b/StandAlone/CMakeLists.txt
@@ -83,7 +84,7 @@ endif()
target_link_libraries(glslangValidator ${LIBRARIES})
target_include_directories(glslangValidator PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../External>
- $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/External>)
+ $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)
if(ENABLE_OPT)
target_include_directories(glslangValidator
maybe help
or add spirv-tools package as dependency, or mix of both
greetings
@jeremy-lunarg can you please take a look and maybe help @svenstaro to figure out how to properly fix it while not disabling the shared libs etc?
Will do. I think we need to export it from the newer cmake implementation that was added a month ago. My naive attempt at doing that failed and I haven't been able to spend cycles on it the last few days.
@sl1pkn07 I have tried your patch. It does make the cmake error go away, but unfortunately also makes the resulting libglslang.a
missing at least all the glslang::TShader
symbols as well.
Update: I need to investigate more, sorry.
my tried to goal is use spirv-tools(from the commit in know-good file) as static into glslang. at the moment. none of the projects i buid wich required gslang has failed (the only i get failed is the unittest with double-free error in here https://github.com/KhronosGroup/glslang/issues/2128)
can you share a piece of code were i can test if i have missing symbols in my build? i can share my pkgbuild with all my patches. but is a splitted pkgbuild with all vulkan related projects in one, and not follow the archlinux standars of quality
greetings
I have figured it out that missing -ffat-lto-objects
in CXXFLAGS is responsible for the glslang::TShader
symbol missing issues.
I have took the last two parts of your patch (removing the /External include path) and only one problem remains now:
undefined reference to `spvtools::CreateEliminateDeadInputComponentsPass()'
This symbol is present in libSPIRV.{a,so}
shipped by glslang but not by our packaged spirv-tools
which provides libSPIRV-Tools-opt.so
. I am assuming this to be a version mismatch as the commit adding this function isn't available in any spirv-tools release yet: https://github.com/KhronosGroup/SPIRV-Tools/commit/c8e1588cfa3ff9e3b5d600ef04f4261c4e68af90
Probably the cmake files of glslang shouldn't instruct to link to SPIRV-Tools-opt
when the latter isn't provided by the glslang package itself.
@sl1pkn07 My failing example is the ncnn
package. An old version (20220729) triggered the error in OP, and the updated version (20221128) triggers the next issue, which is then fixed by your patch:
CMake Error in src/CMakeLists.txt:
Imported target "glslang::SPIRV" includes non-existent path
"/usr/include/External"
in its INTERFACE_INCLUDE_DIRECTORIES. Possible reasons include:
* The path was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and references files it does not
provide.
ncnn (asp export ncnn) works for me
here is my pkgbuild for all khronos vulkan projects and patches (build GIT packages,and maybe have missing dependencies) sl1-vulkan-git-1.3.236.r3940.82d4232f0-1.src.tar.gz (meybe need tweak because the last version i builded is 1.3.235.r3927.6c7b2db41-1. maybe need tweak again for new changes)
greetings
Hello, I'm the maintainer of the official glslang package in Arch Linux. We're currently trying to migrate to glslang 11.12.0. However, whenever I use the compatibility shims I get:
When using the recommended way with
find_package(glslang)
I get:I can produce this using a bare
CMakeLists.txt
with onlyfind_package(glslang)
in it.Now granted, this might be a packaging issue but we've been packaging glslang with few package changes for a long time and it would be odd to hit this now. This particular problem hasn't happened before.
Frankly, I have no idea what's wrong that it's not finding SPIRV-Tools-opt and what could be wrong in the system.
We're building glslang using this script: https://github.com/archlinux/svntogit-packages/blob/packages/glslang/trunk/PKGBUILD
Full build log of glslang attached. build.txt
We're hoping you can help us figure out whether this is a bug in glslang or in our packaging.