From 675501d47b582807183c4bc28d848e76118d3aa9 Mon Sep 17 00:00:00 2001 From: Jeremy Newton Date: Fri, 19 Nov 2021 15:39:51 -0500 Subject: [PATCH 1/2] SWDEV-312927 - Fix package licensing The license file needs to be installed. RPM also requires the LICENSE field to be set. Signed-off-by: Jeremy Newton Change-Id: I925a9c742f8576c4da28e4c07ce18d408a4ddc67 --- lib/comgr/CMakeLists.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/comgr/CMakeLists.txt b/lib/comgr/CMakeLists.txt index 7611142..5362884 100644 --- a/lib/comgr/CMakeLists.txt +++ b/lib/comgr/CMakeLists.txt @@ -335,6 +335,12 @@ if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) set(CPACK_PACKAGE_CONTACT "ROCm Compiler Support ") set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE.txt") + # Install License file + install(FILES + "${CPACK_RESOURCE_FILE_LICENSE}" + COMPONENT amd-comgr + DESTINATION ${CMAKE_INSTALL_DOCDIR}/${CPACK_PACKAGE_NAME}) + # Make proper version for appending set(ROCM_VERSION_FOR_PACKAGE "") if(DEFINED ENV{ROCM_LIBPATCH_VERSION}) @@ -365,6 +371,7 @@ if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) else() set(CPACK_RPM_PACKAGE_RELEASE "local") endif() + set(CPACK_RPM_PACKAGE_LICENSE "BSD") # Get rpm distro if(CPACK_RPM_PACKAGE_RELEASE) From a75326c7204e9c91bfcfd0fb701b9f2ad1ec234d Mon Sep 17 00:00:00 2001 From: Konstantin Zhuravlyov Date: Wed, 22 Dec 2021 13:26:34 -0500 Subject: [PATCH 2/2] Changes required for https://reviews.llvm.org/D116011 Change-Id: I6cbec349cf1292a74a8a9f9668b96e90ffedbde7 --- lib/comgr/src/comgr-compiler.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/comgr/src/comgr-compiler.cpp b/lib/comgr/src/comgr-compiler.cpp index dc698fb..6c2cba2 100644 --- a/lib/comgr/src/comgr-compiler.cpp +++ b/lib/comgr/src/comgr-compiler.cpp @@ -680,6 +680,9 @@ AMDGPUCompiler::executeInProcessDriver(ArrayRef Args) { } std::unique_ptr Clang(new CompilerInstance()); Clang->setVerboseOutputStream(LogS); + if (!Argv.back()) { + Argv.pop_back(); + } if (!CompilerInvocation::CreateFromArgs(Clang->getInvocation(), Argv, Diags)) { return AMD_COMGR_STATUS_ERROR; @@ -699,6 +702,9 @@ AMDGPUCompiler::executeInProcessDriver(ArrayRef Args) { logArgv(LogS, "clang", Argv); } Argv.erase(Argv.begin() + 1); + if (!Argv.back()) { + Argv.pop_back(); + } AssemblerInvocation Asm; if (!AssemblerInvocation::createFromArgs(Asm, Argv, Diags)) { return AMD_COMGR_STATUS_ERROR;