From 0046076950b029f5c07186fbf08c419ad39cdf72 Mon Sep 17 00:00:00 2001 From: sternenseemann <0rpkxez4ksa01gb3typccl0i@systemli.org> Date: Sat, 15 May 2021 14:26:54 +0200 Subject: llvmPackages_{7-12}.compiler-rt: install resource files to DATADIR This is in an effort to fix the following build failure shown by chromium: clang++: error: no such file or directory: '/nix/store/fhd89wrmkx6nflzjk0d6waz70bk3zc4i-clang-wrapper-12.0.0/resource-root/share/cfi_blacklist.txt' As it turns out a change introduced via the gnu-install-dirs.patch caused `add_compiler_rt_resource_file` to install resource files to $dev/include (FULL_INCLUDEDIR) instead of $out/share (FULL_DATADIR) which in turn meant that the clang wrappers we had didn't link those files to its resource root at all. Alternative fix to this would have been to link compiler-rt.dev/include/*.txt to the wrappers resource-root/share as well, but since this was handled inconsistently across the patch anyways (the dfsan list is installed correctly), opt to handle this consistently within the patch. llvmPackages_{5,6} install the resource files to a completely different location and need separate investigation. --- pkgs/development/compilers/llvm/10/compiler-rt/gnu-install-dirs.patch | 2 +- pkgs/development/compilers/llvm/11/compiler-rt/gnu-install-dirs.patch | 2 +- pkgs/development/compilers/llvm/12/compiler-rt/gnu-install-dirs.patch | 2 +- pkgs/development/compilers/llvm/7/compiler-rt/gnu-install-dirs.patch | 2 +- pkgs/development/compilers/llvm/8/compiler-rt/gnu-install-dirs.patch | 2 +- pkgs/development/compilers/llvm/9/compiler-rt/gnu-install-dirs.patch | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pkgs/development/compilers/llvm/10/compiler-rt/gnu-install-dirs.patch b/pkgs/development/compilers/llvm/10/compiler-rt/gnu-install-dirs.patch index 7bc835914a3..db0bd006eaf 100644 --- a/pkgs/development/compilers/llvm/10/compiler-rt/gnu-install-dirs.patch +++ b/pkgs/development/compilers/llvm/10/compiler-rt/gnu-install-dirs.patch @@ -19,7 +19,7 @@ index 35a48c6af29c..e4300f256091 100644 # Install in Clang resource directory. install(FILES ${file_name} - DESTINATION ${COMPILER_RT_INSTALL_PATH}/share -+ DESTINATION ${COMPILER_RT_INSTALL_PATH}/${CMAKE_INSTALL_FULL_INCLUDEDIR} ++ DESTINATION ${COMPILER_RT_INSTALL_PATH}/${CMAKE_INSTALL_FULL_DATADIR} COMPONENT ${component}) add_dependencies(${component} ${target_name}) diff --git a/pkgs/development/compilers/llvm/11/compiler-rt/gnu-install-dirs.patch b/pkgs/development/compilers/llvm/11/compiler-rt/gnu-install-dirs.patch index 1d1ebb570ce..91e20882929 100644 --- a/pkgs/development/compilers/llvm/11/compiler-rt/gnu-install-dirs.patch +++ b/pkgs/development/compilers/llvm/11/compiler-rt/gnu-install-dirs.patch @@ -19,7 +19,7 @@ index 7c127a93dfa7..6a95a65b70a7 100644 # Install in Clang resource directory. install(FILES ${file_name} - DESTINATION ${COMPILER_RT_INSTALL_PATH}/share -+ DESTINATION ${COMPILER_RT_INSTALL_PATH}/${CMAKE_INSTALL_FULL_INCLUDEDIR} ++ DESTINATION ${COMPILER_RT_INSTALL_PATH}/${CMAKE_INSTALL_FULL_DATADIR} COMPONENT ${component}) add_dependencies(${component} ${target_name}) diff --git a/pkgs/development/compilers/llvm/12/compiler-rt/gnu-install-dirs.patch b/pkgs/development/compilers/llvm/12/compiler-rt/gnu-install-dirs.patch index c18d7924890..5f025764de1 100644 --- a/pkgs/development/compilers/llvm/12/compiler-rt/gnu-install-dirs.patch +++ b/pkgs/development/compilers/llvm/12/compiler-rt/gnu-install-dirs.patch @@ -19,7 +19,7 @@ index 361538a58e47..f0d8d9ab80f1 100644 # Install in Clang resource directory. install(FILES ${file_name} - DESTINATION ${COMPILER_RT_INSTALL_PATH}/share -+ DESTINATION ${COMPILER_RT_INSTALL_PATH}/${CMAKE_INSTALL_FULL_INCLUDEDIR} ++ DESTINATION ${COMPILER_RT_INSTALL_PATH}/${CMAKE_INSTALL_FULL_DATADIR} COMPONENT ${component}) add_dependencies(${component} ${target_name}) diff --git a/pkgs/development/compilers/llvm/7/compiler-rt/gnu-install-dirs.patch b/pkgs/development/compilers/llvm/7/compiler-rt/gnu-install-dirs.patch index fd7c6a690fa..41b501ec649 100644 --- a/pkgs/development/compilers/llvm/7/compiler-rt/gnu-install-dirs.patch +++ b/pkgs/development/compilers/llvm/7/compiler-rt/gnu-install-dirs.patch @@ -19,7 +19,7 @@ index cd4c704fc824..5abcd1260381 100644 # Install in Clang resource directory. install(FILES ${file_name} - DESTINATION ${COMPILER_RT_INSTALL_PATH}/share -+ DESTINATION ${COMPILER_RT_INSTALL_PATH}/${CMAKE_INSTALL_FULL_INCLUDEDIR} ++ DESTINATION ${COMPILER_RT_INSTALL_PATH}/${CMAKE_INSTALL_FULL_DATADIR} COMPONENT ${component}) add_dependencies(${component} ${target_name}) diff --git a/pkgs/development/compilers/llvm/8/compiler-rt/gnu-install-dirs.patch b/pkgs/development/compilers/llvm/8/compiler-rt/gnu-install-dirs.patch index 1c2e7f0b311..a25fa90f980 100644 --- a/pkgs/development/compilers/llvm/8/compiler-rt/gnu-install-dirs.patch +++ b/pkgs/development/compilers/llvm/8/compiler-rt/gnu-install-dirs.patch @@ -19,7 +19,7 @@ index 81b110203c27..df7598a11caf 100644 # Install in Clang resource directory. install(FILES ${file_name} - DESTINATION ${COMPILER_RT_INSTALL_PATH}/share -+ DESTINATION ${COMPILER_RT_INSTALL_PATH}/${CMAKE_INSTALL_FULL_INCLUDEDIR} ++ DESTINATION ${COMPILER_RT_INSTALL_PATH}/${CMAKE_INSTALL_FULL_DATADIR} COMPONENT ${component}) add_dependencies(${component} ${target_name}) diff --git a/pkgs/development/compilers/llvm/9/compiler-rt/gnu-install-dirs.patch b/pkgs/development/compilers/llvm/9/compiler-rt/gnu-install-dirs.patch index 7967bbc4855..9f63bef2f86 100644 --- a/pkgs/development/compilers/llvm/9/compiler-rt/gnu-install-dirs.patch +++ b/pkgs/development/compilers/llvm/9/compiler-rt/gnu-install-dirs.patch @@ -19,7 +19,7 @@ index f7ee932f214f..ef94a97c4be9 100644 # Install in Clang resource directory. install(FILES ${file_name} - DESTINATION ${COMPILER_RT_INSTALL_PATH}/share -+ DESTINATION ${COMPILER_RT_INSTALL_PATH}/${CMAKE_INSTALL_FULL_INCLUDEDIR} ++ DESTINATION ${COMPILER_RT_INSTALL_PATH}/${CMAKE_INSTALL_FULL_DATADIR} COMPONENT ${component}) add_dependencies(${component} ${target_name}) -- cgit 1.4.1 From 74f709f62e717567ae066d8f97f51ef46ca3768d Mon Sep 17 00:00:00 2001 From: sternenseemann <0rpkxez4ksa01gb3typccl0i@systemli.org> Date: Sat, 15 May 2021 14:54:22 +0200 Subject: llvmPackages_{7,8,9}: link ${compiler-rt.out}/share to resource root This is done for 10-12, but not for the earlier llvm package sets. --- pkgs/development/compilers/llvm/7/default.nix | 1 + pkgs/development/compilers/llvm/8/default.nix | 1 + pkgs/development/compilers/llvm/9/default.nix | 1 + 3 files changed, 3 insertions(+) diff --git a/pkgs/development/compilers/llvm/7/default.nix b/pkgs/development/compilers/llvm/7/default.nix index 7aa3f9099cc..b46d3dbd68e 100644 --- a/pkgs/development/compilers/llvm/7/default.nix +++ b/pkgs/development/compilers/llvm/7/default.nix @@ -26,6 +26,7 @@ let ''; mkExtraBuildCommands = cc: mkExtraBuildCommands0 cc + '' ln -s "${targetLlvmLibraries.compiler-rt.out}/lib" "$rsrc/lib" + ln -s "${targetLlvmLibraries.compiler-rt.out}/share" "$rsrc/share" ''; in { diff --git a/pkgs/development/compilers/llvm/8/default.nix b/pkgs/development/compilers/llvm/8/default.nix index bcbbd155e36..322c6c795b3 100644 --- a/pkgs/development/compilers/llvm/8/default.nix +++ b/pkgs/development/compilers/llvm/8/default.nix @@ -26,6 +26,7 @@ let ''; mkExtraBuildCommands = cc: mkExtraBuildCommands0 cc + '' ln -s "${targetLlvmLibraries.compiler-rt.out}/lib" "$rsrc/lib" + ln -s "${targetLlvmLibraries.compiler-rt.out}/share" "$rsrc/share" ''; in { diff --git a/pkgs/development/compilers/llvm/9/default.nix b/pkgs/development/compilers/llvm/9/default.nix index 0660bac137f..f2b5b3cc5c4 100644 --- a/pkgs/development/compilers/llvm/9/default.nix +++ b/pkgs/development/compilers/llvm/9/default.nix @@ -26,6 +26,7 @@ let ''; mkExtraBuildCommands = cc: mkExtraBuildCommands0 cc + '' ln -s "${targetLlvmLibraries.compiler-rt.out}/lib" "$rsrc/lib" + ln -s "${targetLlvmLibraries.compiler-rt.out}/share" "$rsrc/share" ''; in { -- cgit 1.4.1