commit 681eba882a59c61c06604a291771511a190b3fb2 Author: CentOS Sources Date: Thu Aug 6 18:32:20 2020 +0000 import spirv-tools-2020.5-1.20200803.git92a7165.el8 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..02ee307 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +SOURCES/spirv-tools-92a71657fcbae77caf79181f655fabe8be7e0d84.tar.gz diff --git a/.spirv-tools.metadata b/.spirv-tools.metadata new file mode 100644 index 0000000..16e4f44 --- /dev/null +++ b/.spirv-tools.metadata @@ -0,0 +1 @@ +f730c19d9017363f8195c97b9c5f0fcbabfefd75 SOURCES/spirv-tools-92a71657fcbae77caf79181f655fabe8be7e0d84.tar.gz diff --git a/SOURCES/0001-Revert-CMake-Enable-building-with-BUILD_SHARED_LIBS-.patch b/SOURCES/0001-Revert-CMake-Enable-building-with-BUILD_SHARED_LIBS-.patch new file mode 100644 index 0000000..9972082 --- /dev/null +++ b/SOURCES/0001-Revert-CMake-Enable-building-with-BUILD_SHARED_LIBS-.patch @@ -0,0 +1,314 @@ +From 74a74884541475b5e1c2e34084d645c1e0d130b3 Mon Sep 17 00:00:00 2001 +From: Dave Airlie +Date: Wed, 5 Aug 2020 06:54:52 +1000 +Subject: [PATCH] Revert "CMake: Enable building with BUILD_SHARED_LIBS=1 + (#3490)" + +This reverts commit 6aed7ffbc7bd42d292db10a800ec05954a5b7147. +--- + external/CMakeLists.txt | 19 ------------------- + source/CMakeLists.txt | 29 +++++++++-------------------- + source/fuzz/CMakeLists.txt | 2 +- + source/link/CMakeLists.txt | 2 +- + source/opt/CMakeLists.txt | 4 ++-- + source/reduce/CMakeLists.txt | 4 ++-- + test/CMakeLists.txt | 6 +++--- + test/val/CMakeLists.txt | 10 +++++----- + tools/CMakeLists.txt | 16 ++++++++-------- + 9 files changed, 31 insertions(+), 61 deletions(-) + +diff --git a/external/CMakeLists.txt b/external/CMakeLists.txt +index f5009fde..5b341598 100644 +--- a/external/CMakeLists.txt ++++ b/external/CMakeLists.txt +@@ -13,19 +13,6 @@ + # See the License for the specific language governing permissions and + # limitations under the License. + +-# Utility functions for pushing & popping variables. +-function(push_variable var val) +- set("${var}_SAVE_STACK" "${${var}}" "${${var}_SAVE_STACK}" PARENT_SCOPE) +- set(${var} ${val} PARENT_SCOPE) +-endfunction() +-function(pop_variable var) +- set(save_stack "${${var}_SAVE_STACK}") +- list(GET save_stack 0 val) +- list(REMOVE_AT save_stack 0) +- set("${var}_SAVE_STACK" "${save_stack}" PARENT_SCOPE) +- set(${var} ${val} PARENT_SCOPE) +-endfunction() +- + if (DEFINED SPIRV-Headers_SOURCE_DIR) + # This allows flexible position of the SPIRV-Headers repo. + set(SPIRV_HEADER_DIR ${SPIRV-Headers_SOURCE_DIR}) +@@ -74,11 +61,7 @@ if (NOT ${SPIRV_SKIP_TESTS}) + "Use shared (DLL) run-time lib even when Google Test is built as static lib." + ON) + endif() +- # gtest requires special defines for building as a shared +- # library, simply always build as static. +- push_variable(BUILD_SHARED_LIBS 0) + add_subdirectory(${GMOCK_DIR} EXCLUDE_FROM_ALL) +- pop_variable(BUILD_SHARED_LIBS) + endif() + endif() + if (TARGET gmock) +@@ -125,9 +108,7 @@ if (NOT ${SPIRV_SKIP_TESTS}) + if (NOT TARGET effcee) + set(EFFCEE_BUILD_TESTING OFF CACHE BOOL "Do not build Effcee test suite") + endif() +- push_variable(BUILD_SHARED_LIBS 0) # effcee does not export any symbols for building as a DLL. Always build as static. + add_subdirectory(effcee EXCLUDE_FROM_ALL) +- pop_variable(BUILD_SHARED_LIBS) + set_property(TARGET effcee PROPERTY FOLDER Effcee) + # Turn off warnings for effcee and re2 + set_property(TARGET effcee APPEND PROPERTY COMPILE_OPTIONS -w) +diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt +index 79a81a1c..adc50c09 100644 +--- a/source/CMakeLists.txt ++++ b/source/CMakeLists.txt +@@ -346,21 +346,18 @@ set_source_files_properties( + + spvtools_pch(SPIRV_SOURCES pch_source) + +-add_library(${SPIRV_TOOLS}-static STATIC ${SPIRV_SOURCES}) +-spvtools_default_compile_options(${SPIRV_TOOLS}-static) +-target_include_directories(${SPIRV_TOOLS}-static ++add_library(${SPIRV_TOOLS} ${SPIRV_SOURCES}) ++spvtools_default_compile_options(${SPIRV_TOOLS}) ++target_include_directories(${SPIRV_TOOLS} + PUBLIC + $ + $ + PRIVATE ${spirv-tools_BINARY_DIR} + PRIVATE ${SPIRV_HEADER_INCLUDE_DIR} + ) +-set_property(TARGET ${SPIRV_TOOLS}-static PROPERTY FOLDER "SPIRV-Tools libraries") +-spvtools_check_symbol_exports(${SPIRV_TOOLS}-static) +-add_dependencies(${SPIRV_TOOLS}-static core_tables enum_string_mapping extinst_tables) +- +-# The static target does not have the '-static' suffix. +-set_target_properties(${SPIRV_TOOLS}-static PROPERTIES OUTPUT_NAME "${SPIRV_TOOLS}") ++set_property(TARGET ${SPIRV_TOOLS} PROPERTY FOLDER "SPIRV-Tools libraries") ++spvtools_check_symbol_exports(${SPIRV_TOOLS}) ++add_dependencies( ${SPIRV_TOOLS} core_tables enum_string_mapping extinst_tables ) + + add_library(${SPIRV_TOOLS}-shared SHARED ${SPIRV_SOURCES}) + spvtools_default_compile_options(${SPIRV_TOOLS}-shared) +@@ -378,26 +375,18 @@ target_compile_definitions(${SPIRV_TOOLS}-shared + PRIVATE SPIRV_TOOLS_IMPLEMENTATION + PUBLIC SPIRV_TOOLS_SHAREDLIB + ) +-add_dependencies(${SPIRV_TOOLS}-shared core_tables enum_string_mapping extinst_tables) +- +-# Create the "${SPIRV_TOOLS}" target as an alias to either "${SPIRV_TOOLS}-static" +-# or "${SPIRV_TOOLS}-shared" depending on the value of BUILD_SHARED_LIBS. +-if(BUILD_SHARED_LIBS) +- add_library(${SPIRV_TOOLS} ALIAS ${SPIRV_TOOLS}-shared) +-else() +- add_library(${SPIRV_TOOLS} ALIAS ${SPIRV_TOOLS}-static) +-endif() ++add_dependencies( ${SPIRV_TOOLS}-shared core_tables enum_string_mapping extinst_tables ) + + if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux") + find_library(LIBRT rt) + if(LIBRT) +- target_link_libraries(${SPIRV_TOOLS}-static ${LIBRT}) ++ target_link_libraries(${SPIRV_TOOLS} ${LIBRT}) + target_link_libraries(${SPIRV_TOOLS}-shared ${LIBRT}) + endif() + endif() + + if(ENABLE_SPIRV_TOOLS_INSTALL) +- install(TARGETS ${SPIRV_TOOLS}-static ${SPIRV_TOOLS}-shared EXPORT ${SPIRV_TOOLS}Targets ++ install(TARGETS ${SPIRV_TOOLS} ${SPIRV_TOOLS}-shared EXPORT ${SPIRV_TOOLS}Targets + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) +diff --git a/source/fuzz/CMakeLists.txt b/source/fuzz/CMakeLists.txt +index 630dee2c..3f960a22 100644 +--- a/source/fuzz/CMakeLists.txt ++++ b/source/fuzz/CMakeLists.txt +@@ -327,7 +327,7 @@ if(SPIRV_BUILD_FUZZER) + + # The fuzzer reuses a lot of functionality from the SPIRV-Tools library. + target_link_libraries(SPIRV-Tools-fuzz +- PUBLIC ${SPIRV_TOOLS}-static ++ PUBLIC ${SPIRV_TOOLS} + PUBLIC SPIRV-Tools-opt + PUBLIC protobuf::libprotobuf) + +diff --git a/source/link/CMakeLists.txt b/source/link/CMakeLists.txt +index bb058ea2..d3083192 100644 +--- a/source/link/CMakeLists.txt ++++ b/source/link/CMakeLists.txt +@@ -11,7 +11,7 @@ + # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + # See the License for the specific language governing permissions and + # limitations under the License. +-add_library(SPIRV-Tools-link STATIC ++add_library(SPIRV-Tools-link + linker.cpp + ) + +diff --git a/source/opt/CMakeLists.txt b/source/opt/CMakeLists.txt +index 090aeac5..0047c346 100644 +--- a/source/opt/CMakeLists.txt ++++ b/source/opt/CMakeLists.txt +@@ -233,7 +233,7 @@ endif() + + spvtools_pch(SPIRV_TOOLS_OPT_SOURCES pch_source_opt) + +-add_library(SPIRV-Tools-opt STATIC ${SPIRV_TOOLS_OPT_SOURCES}) ++add_library(SPIRV-Tools-opt ${SPIRV_TOOLS_OPT_SOURCES}) + + spvtools_default_compile_options(SPIRV-Tools-opt) + target_include_directories(SPIRV-Tools-opt +@@ -245,7 +245,7 @@ target_include_directories(SPIRV-Tools-opt + ) + # We need the assembling and disassembling functionalities in the main library. + target_link_libraries(SPIRV-Tools-opt +- PUBLIC ${SPIRV_TOOLS}-static) ++ PUBLIC ${SPIRV_TOOLS}) + + set_property(TARGET SPIRV-Tools-opt PROPERTY FOLDER "SPIRV-Tools libraries") + spvtools_check_symbol_exports(SPIRV-Tools-opt) +diff --git a/source/reduce/CMakeLists.txt b/source/reduce/CMakeLists.txt +index 865510bb..d945bd20 100644 +--- a/source/reduce/CMakeLists.txt ++++ b/source/reduce/CMakeLists.txt +@@ -77,7 +77,7 @@ endif() + + spvtools_pch(SPIRV_TOOLS_REDUCE_SOURCES pch_source_reduce) + +-add_library(SPIRV-Tools-reduce STATIC ${SPIRV_TOOLS_REDUCE_SOURCES}) ++add_library(SPIRV-Tools-reduce ${SPIRV_TOOLS_REDUCE_SOURCES}) + + spvtools_default_compile_options(SPIRV-Tools-reduce) + target_include_directories(SPIRV-Tools-reduce +@@ -89,7 +89,7 @@ target_include_directories(SPIRV-Tools-reduce + ) + # The reducer reuses a lot of functionality from the SPIRV-Tools library. + target_link_libraries(SPIRV-Tools-reduce +- PUBLIC ${SPIRV_TOOLS}-static ++ PUBLIC ${SPIRV_TOOLS} + PUBLIC SPIRV-Tools-opt) + + set_property(TARGET SPIRV-Tools-reduce PROPERTY FOLDER "SPIRV-Tools libraries") +diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt +index 5dd4036c..70999f99 100644 +--- a/test/CMakeLists.txt ++++ b/test/CMakeLists.txt +@@ -159,12 +159,12 @@ spvtools_pch(TEST_SOURCES pch_test) + add_spvtools_unittest( + TARGET spirv_unit_tests + SRCS ${TEST_SOURCES} +- LIBS ${SPIRV_TOOLS}-static) ++ LIBS ${SPIRV_TOOLS}) + + add_spvtools_unittest( + TARGET c_interface + SRCS c_interface_test.cpp +- LIBS ${SPIRV_TOOLS}-static) ++ LIBS ${SPIRV_TOOLS}) + + add_spvtools_unittest( + TARGET c_interface_shared +@@ -181,7 +181,7 @@ if (${SPIRV_TIMER_ENABLED}) + add_spvtools_unittest( + TARGET timer + SRCS timer_test.cpp +- LIBS ${SPIRV_TOOLS}-static) ++ LIBS ${SPIRV_TOOLS}) + endif() + + +diff --git a/test/val/CMakeLists.txt b/test/val/CMakeLists.txt +index c458a2f9..23d7a19e 100644 +--- a/test/val/CMakeLists.txt ++++ b/test/val/CMakeLists.txt +@@ -41,21 +41,21 @@ add_spvtools_unittest(TARGET val_abcde + val_extension_spv_khr_terminate_invocation.cpp + val_ext_inst_test.cpp + ${VAL_TEST_COMMON_SRCS} +- LIBS ${SPIRV_TOOLS}-static ++ LIBS ${SPIRV_TOOLS} + PCH_FILE pch_test_val + ) + + add_spvtools_unittest(TARGET val_capability + SRCS + val_capability_test.cpp +- LIBS ${SPIRV_TOOLS}-static ++ LIBS ${SPIRV_TOOLS} + PCH_FILE pch_test_val + ) + + add_spvtools_unittest(TARGET val_limits + SRCS val_limits_test.cpp + ${VAL_TEST_COMMON_SRCS} +- LIBS ${SPIRV_TOOLS}-static ++ LIBS ${SPIRV_TOOLS} + PCH_FILE pch_test_val + ) + +@@ -76,7 +76,7 @@ add_spvtools_unittest(TARGET val_fghijklmnop + val_opencl_test.cpp + val_primitives_test.cpp + ${VAL_TEST_COMMON_SRCS} +- LIBS ${SPIRV_TOOLS}-static ++ LIBS ${SPIRV_TOOLS} + PCH_FILE pch_test_val + ) + +@@ -91,6 +91,6 @@ add_spvtools_unittest(TARGET val_stuvw + val_version_test.cpp + val_webgpu_test.cpp + ${VAL_TEST_COMMON_SRCS} +- LIBS ${SPIRV_TOOLS}-static ++ LIBS ${SPIRV_TOOLS} + PCH_FILE pch_test_val + ) +diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt +index 67d606a8..b3a4cc1a 100644 +--- a/tools/CMakeLists.txt ++++ b/tools/CMakeLists.txt +@@ -40,19 +40,19 @@ function(add_spvtools_tool) + endfunction() + + if (NOT ${SPIRV_SKIP_EXECUTABLES}) +- add_spvtools_tool(TARGET spirv-as SRCS as/as.cpp LIBS ${SPIRV_TOOLS}-static) +- add_spvtools_tool(TARGET spirv-dis SRCS dis/dis.cpp LIBS ${SPIRV_TOOLS}-static) +- add_spvtools_tool(TARGET spirv-val SRCS val/val.cpp util/cli_consumer.cpp LIBS ${SPIRV_TOOLS}-static) +- add_spvtools_tool(TARGET spirv-opt SRCS opt/opt.cpp util/cli_consumer.cpp LIBS SPIRV-Tools-opt ${SPIRV_TOOLS}-static) ++ add_spvtools_tool(TARGET spirv-as SRCS as/as.cpp LIBS ${SPIRV_TOOLS}) ++ add_spvtools_tool(TARGET spirv-dis SRCS dis/dis.cpp LIBS ${SPIRV_TOOLS}) ++ add_spvtools_tool(TARGET spirv-val SRCS val/val.cpp util/cli_consumer.cpp LIBS ${SPIRV_TOOLS}) ++ add_spvtools_tool(TARGET spirv-opt SRCS opt/opt.cpp util/cli_consumer.cpp LIBS SPIRV-Tools-opt ${SPIRV_TOOLS}) + if (NOT DEFINED IOS_PLATFORM) # iOS does not allow std::system calls which spirv-reduce requires +- add_spvtools_tool(TARGET spirv-reduce SRCS reduce/reduce.cpp util/cli_consumer.cpp LIBS SPIRV-Tools-reduce ${SPIRV_TOOLS}-static) ++ add_spvtools_tool(TARGET spirv-reduce SRCS reduce/reduce.cpp util/cli_consumer.cpp LIBS SPIRV-Tools-reduce ${SPIRV_TOOLS}) + endif() +- add_spvtools_tool(TARGET spirv-link SRCS link/linker.cpp LIBS SPIRV-Tools-link ${SPIRV_TOOLS}-static) ++ add_spvtools_tool(TARGET spirv-link SRCS link/linker.cpp LIBS SPIRV-Tools-link ${SPIRV_TOOLS}) + add_spvtools_tool(TARGET spirv-cfg + SRCS cfg/cfg.cpp + cfg/bin_to_dot.h + cfg/bin_to_dot.cpp +- LIBS ${SPIRV_TOOLS}-static) ++ LIBS ${SPIRV_TOOLS}) + target_include_directories(spirv-cfg PRIVATE ${spirv-tools_SOURCE_DIR} + ${SPIRV_HEADER_INCLUDE_DIR}) + set(SPIRV_INSTALL_TARGETS spirv-as spirv-dis spirv-val spirv-opt +@@ -62,7 +62,7 @@ if (NOT ${SPIRV_SKIP_EXECUTABLES}) + endif() + + if(SPIRV_BUILD_FUZZER) +- add_spvtools_tool(TARGET spirv-fuzz SRCS fuzz/fuzz.cpp util/cli_consumer.cpp LIBS SPIRV-Tools-fuzz ${SPIRV_TOOLS}-static) ++ add_spvtools_tool(TARGET spirv-fuzz SRCS fuzz/fuzz.cpp util/cli_consumer.cpp LIBS SPIRV-Tools-fuzz ${SPIRV_TOOLS}) + set(SPIRV_INSTALL_TARGETS ${SPIRV_INSTALL_TARGETS} spirv-fuzz) + endif(SPIRV_BUILD_FUZZER) + +-- +2.26.2 + diff --git a/SPECS/spirv-tools.spec b/SPECS/spirv-tools.spec new file mode 100644 index 0000000..28b6905 --- /dev/null +++ b/SPECS/spirv-tools.spec @@ -0,0 +1,153 @@ +%global commit 92a71657fcbae77caf79181f655fabe8be7e0d84 +%global shortcommit %(c=%{commit}; echo ${c:0:7}) +%global commit_date 20200803 +%global gitrel .%{commit_date}.git%{shortcommit} + +Name: spirv-tools +Version: 2020.5 +Release: 1%{?gitrel}%{?dist} +Summary: API and commands for processing SPIR-V modules + +License: ASL 2.0 +URL: https://github.com/KhronosGroup/SPIRV-Tools +Source0: %url/archive/%{commit}.tar.gz#/%{name}-%{commit}.tar.gz + +Patch0: 0001-Revert-CMake-Enable-building-with-BUILD_SHARED_LIBS-.patch + +BuildRequires: cmake3 +BuildRequires: gcc-c++ +BuildRequires: ninja-build +%if 0%{?rhel} == 7 +BuildRequires: python36-devel +%else +BuildRequires: python3-devel +%endif +BuildRequires: python3-rpm-macros +BuildRequires: spirv-headers-devel +Requires: %{name}-libs%{?_isa} = %{version}-%{release} + +%description +The package includes an assembler, binary module parser, +disassembler, and validator for SPIR-V.. + +%package libs +Summary: Library files for %{name} +Provides: %{name}-libs%{?_isa} = %{version} + +%description libs +library files for %{name} + +%package devel +Summary: Development files for %{name} +Requires: %{name}-libs%{?_isa} = %{version}-%{release} + +%description devel +Development files for %{name} + +%prep +%autosetup -p1 -n SPIRV-Tools-%{commit} + +%build +%__mkdir_p %_target_platform +pushd %_target_platform +%cmake3 -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_LIBDIR=%{_lib} \ + -DSPIRV-Headers_SOURCE_DIR=%{_prefix} \ + -DPYTHON_EXECUTABLE=%{__python3} \ + -GNinja .. +%ninja_build +popd + +%install +%ninja_install -C %_target_platform + +%ldconfig_scriptlets libs + +%files +%license LICENSE +%doc README.md CHANGES +%{_bindir}/spirv-as +%{_bindir}/spirv-cfg +%{_bindir}/spirv-dis +%{_bindir}/spirv-lesspipe.sh +%{_bindir}/spirv-link +%{_bindir}/spirv-opt +%{_bindir}/spirv-reduce +%{_bindir}/spirv-val + +%files libs +%{_libdir}/libSPIRV-Tools-link.so +%{_libdir}/libSPIRV-Tools-opt.so +%{_libdir}/libSPIRV-Tools-shared.so +%{_libdir}/libSPIRV-Tools-reduce.so +%{_libdir}/libSPIRV-Tools.so + +%files devel +%{_includedir}/spirv-tools/ +%{_libdir}/cmake/* +%{_libdir}/pkgconfig/SPIRV-Tools-shared.pc +%{_libdir}/pkgconfig/SPIRV-Tools.pc + +%changelog +* Wed Aug 05 2020 Dave Airlie - 2020.5-1 +- update to latest upstream + +* Wed Jan 29 2020 Dave Airlie - 2019.5-1 +- update to latest upstream + +* Sat Dec 07 2019 Dave Airlie - 2019.4-2 +- rebuild for 8.2.0 + +* Tue Nov 12 2019 Dave Airlie - 2019.4-1 +- latest upstream snapshot + +* Sun Aug 04 2019 Dave Airlie - 2019.4-0.1 +- Update to latest upstream for glslang +- drop spirv-stats as per upstream. + +* Thu Mar 07 2019 Dave Airlie - 2019.1-1 +- Update to 2019.1 release + +* Mon Jul 23 2018 Leigh Scott - 2018.4-1 +- Update to 2018.4 release + +* Sat Jul 14 2018 Fedora Release Engineering - 2018.3.0-0.3.20180407.git26a698c +- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild + +* Mon Jun 25 2018 Dave Airlie - 2018.3.0-0.2.20180407.git26a698c +- Move to python3 and drop the simplejson buildreq. + +* Tue Apr 24 2018 Leigh Scott - 2018.3.0-0.1.20180407.git26a698c +- Bump version to 2018.3.0 to match .pc files + +* Tue Apr 24 2018 Leigh Scott - 2018.1-0.4.20180407.git26a698c +- Bump provides to 2018.3.0 + +* Tue Apr 24 2018 Leigh Scott - 2018.1-0.3.20180407.git26a698c +- Update for vulkan 1.1.73.0 + +* Wed Feb 14 2018 Leigh Scott - 2018.1-0.2.20180205.git9e19fc0 +- Add isa to the provides + +* Fri Feb 09 2018 Leigh Scott - 2018.1-0.1.20180205.git9e19fc0 +- Fix version +- Fix pkgconfig file +- Add version provides to -libs package + +* Fri Feb 09 2018 Leigh Scott - 2016.7-0.5.20180205.git9e19fc0 +- Update for vulkan 1.0.68.0 +- Try building as shared object +- Split libs into -libs subpackage + +* Fri Feb 09 2018 Leigh Scott - 2016.7-0.4.20171023.git5834719 +- Use ninja to build + +* Mon Jan 22 2018 Leigh Scott - 2016.7-0.3.20171023.git5834719 +- Add python prefix to fix the stupid Bodhi tests + +* Wed Jan 03 2018 Leigh Scott - 2016.7-0.2.20171023.git5834719 +- Split binaries into main package + +* Thu Jul 13 2017 Leigh Scott - 2016.7-0.1.20171023.git5834719 +- First build +