!rGlCMuXgAhgEpdvJUz:nixos.org

NixOS KDE

202 Members
56 Servers

Load older messages


SenderMessageTime
13 Aug 2025
@elvishjerricco:matrix.orgElvishJerriccoyea you need to build the toplevel attribute and work against that, not the iso derivation17:46:41
@grimmauld:grapevine.grimmauld.deGrimmauld (any/all)oh, gvfs pulls samba17:47:20
@elvishjerricco:matrix.orgElvishJerriccoyea that makes sense17:47:48
@grimmauld:grapevine.grimmauld.deGrimmauld (any/all) because gnome-shell -> evolution-data-server -> gnome-online-accounts -> gvfs 17:48:49
@grimmauld:grapevine.grimmauld.deGrimmauld (any/all)i suppose samba pulls the python only for its tools, so we might be fine if we split the libs into a lib output?17:49:27
@elvishjerricco:matrix.orgElvishJerriccothere's no way that's the only reason we depend on python, right?17:50:20
@grimmauld:grapevine.grimmauld.deGrimmauld (any/all) no, but samba builds its own weird python 17:50:32
@elvishjerricco:matrix.orgElvishJerricco oh 17:50:38
@grimmauld:grapevine.grimmauld.deGrimmauld (any/all) https://github.com/NixOS/nixpkgs/blob/005433b926e16227259a1843015b5b2b7f7d1fc3/pkgs/servers/samba/4.x.nix#L70-L76
this is why we have two pythons
17:50:50
@grimmauld:grapevine.grimmauld.deGrimmauld (any/all)we could try to update samba and hope the tool updated...17:51:19
@elvishjerricco:matrix.orgElvishJerriccoyea I was going to say, ideally we would just not need that override17:51:51
@grimmauld:grapevine.grimmauld.deGrimmauld (any/all)Actually: samba-tool only exists in samba4Full, we could certainly do the hacky thing and make the overlay conditional on -full17:52:41
@elvishjerricco:matrix.orgElvishJerriccoI mean all these things sounds like plusses to me; split libs, get rid of override if it's not needed, make it conditional on -full otherwise17:53:53
@grimmauld:grapevine.grimmauld.deGrimmauld (any/all)pain is, the nixos test doesn't actually test samba-tool17:54:25
@emilazy:matrix.orgemily probably just only use the override for samba-tool specifically 17:54:16
@emilazy:matrix.orgemilyif it really needs that crap17:54:19
@emilazy:matrix.orgemilyideally someone would check though17:54:23
@grimmauld:grapevine.grimmauld.deGrimmauld (any/all) not sure how to check 17:56:07
@grimmauld:grapevine.grimmauld.deGrimmauld (any/all)i suppose i could report a nixpkgs issue and wait...17:56:58
@emilazy:matrix.orgemilylook at the source?17:57:09
@grimmauld:grapevine.grimmauld.deGrimmauld (any/all)sure, i just don't feel super competent with samba. Not my area of domain knowledge17:58:05
@grimmauld:grapevine.grimmauld.deGrimmauld (any/all)i mean i can try17:58:09
@emilazy:matrix.orgemilyall you need to do is search for its use of the crypt library17:58:18
@emilazy:matrix.orgemily

K900: this gets past configure, the rest is your exciting journey to go on

diff --git a/pkgs/development/compilers/llvm/18/llvm/gnu-install-dirs.patch b/pkgs/development/compilers/llvm/18/llvm/gnu-install-dirs.patch
index 8b89839490..70d30edcdc 100644
--- a/pkgs/development/compilers/llvm/18/llvm/gnu-install-dirs.patch
+++ b/pkgs/development/compilers/llvm/18/llvm/gnu-install-dirs.patch
@@ -1,8 +1,19 @@
 diff --git a/CMakeLists.txt b/CMakeLists.txt
-index 471817d68286..c51463304159 100644
+index 12618966c4..7b4a28832e 100644
 --- a/CMakeLists.txt
 +++ b/CMakeLists.txt
-@@ -1010,7 +1010,7 @@ if (NOT TENSORFLOW_AOT_PATH STREQUAL "")
+@@ -431,6 +431,10 @@
+ set(LLVM_INSTALL_PACKAGE_DIR "${CMAKE_INSTALL_PACKAGEDIR}/llvm" CACHE STRING
+   "Path for CMake subdirectory for LLVM (defaults to '${CMAKE_INSTALL_PACKAGEDIR}/llvm')")
+ 
++set(LLVM_INSTALL_STATICLIBDIR "${CMAKE_INSTALL_LIBDIR}" CACHE STRING
++    "Path for LLVM static libraries (defaults to '${CMAKE_INSTALL_LIBDIR}')")
++mark_as_advanced(LLVM_INSTALL_STATICLIBDIR)
++
+ set(LLVM_TOOLS_INSTALL_DIR "${CMAKE_INSTALL_BINDIR}" CACHE STRING
+     "Path for binary subdirectory (defaults to '${CMAKE_INSTALL_BINDIR}')")
+ mark_as_advanced(LLVM_TOOLS_INSTALL_DIR)
+@@ -1102,7 +1106,7 @@
    add_subdirectory(${TENSORFLOW_AOT_PATH}/xla_aot_runtime_src
      ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}/tf_runtime)
    install(TARGETS tf_xla_runtime EXPORT LLVMExports
@@ -12,10 +23,10 @@
    # Once we add more modules, we should handle this more automatically.
    if (DEFINED LLVM_OVERRIDE_MODEL_HEADER_INLINERSIZEMODEL)
 diff --git a/cmake/modules/AddLLVM.cmake b/cmake/modules/AddLLVM.cmake
-index 230620c37027..dd16cab1835e 100644
+index 03f4e1f190..241321891c 100644
 --- a/cmake/modules/AddLLVM.cmake
 +++ b/cmake/modules/AddLLVM.cmake
-@@ -876,8 +876,8 @@ macro(add_llvm_library name)
+@@ -935,8 +935,8 @@
        get_target_export_arg(${name} LLVM export_to_llvmexports ${umbrella})
        install(TARGETS ${name}
                ${export_to_llvmexports}
@@ -26,7 +37,7 @@
                RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" COMPONENT ${name})
  
        if (NOT LLVM_ENABLE_IDE)
-@@ -2069,7 +2069,7 @@ function(llvm_install_library_symlink name dest type)
+@@ -2180,7 +2180,7 @@
      set(LLVM_LINK_OR_COPY copy)
    endif()
  
@@ -35,7 +46,7 @@
    if(WIN32 AND "${type}" STREQUAL "SHARED")
      set(output_dir "${CMAKE_INSTALL_BINDIR}")
    endif()
-@@ -2344,16 +2344,37 @@ function(llvm_setup_rpath name)
+@@ -2456,16 +2456,37 @@
  
    if (APPLE)
      set(_install_name_dir INSTALL_NAME_DIR "@rpath")
@@ -49,8 +60,6 @@
 -    set(_install_rpath "${LLVM_LIBRARY_OUTPUT_INTDIR}" "${CMAKE_INSTALL_PREFIX}/lib${LLVM_LIBDIR_SUFFIX}" ${extra_libdir})
 +    set(_install_rpath "${LLVM_LIBRARY_OUTPUT_INTDIR}" "${CMAKE_INSTALL_FULL_LIBDIR}${LLVM_LIBDIR_SUFFIX}" ${extra_libdir})
    elseif(UNIX)
--    set(_build_rpath "\$ORIGIN/../lib${LLVM_LIBDIR_SUFFIX}" ${extra_libdir})
--    set(_install_rpath "\$ORIGIN/../lib${LLVM_LIBDIR_SUFFIX}")
 +    # Note that we add `extra_libdir` (aka `LLVM_LIBRARY_DIR` in our case) back
 +    # to `_install_rpath` here.
 +    #
@@ -72,16 +81,17 @@
 +    # As noted in the differential above, an alternative solution is to have
 +    # all rdeps of nixpkgs' LLVM (that use the AddLLVM.cmake machinery) set
 +    # `CMAKE_INSTALL_RPATH`.
-+    set(_build_rpath "\$ORIGIN/../lib${LLVM_LIBDIR_SUFFIX}" ${extra_libdir})
+     set(_build_rpath "\$ORIGIN/../lib${LLVM_LIBDIR_SUFFIX}" ${extra_libdir})
+-    set(_install_rpath "\$ORIGIN/../lib${LLVM_LIBDIR_SUFFIX}")
 +    set(_install_rpath ${extra_libdir})
      if(${CMAKE_SYSTEM_NAME} MATCHES "(FreeBSD|DragonFly)")
        set_property(TARGET ${name} APPEND_STRING PROPERTY
                     LINK_FLAGS " -Wl,-z,origin ")
 diff --git a/cmake/modules/AddOCaml.cmake b/cmake/modules/AddOCaml.cmake
-index 891c9e6d618c..8d963f3b0069 100644
+index 2d9116b08a..2dd7cad4ec 100644
 --- a/cmake/modules/AddOCaml.cmake
 +++ b/cmake/modules/AddOCaml.cmake
-@@ -147,9 +147,9 @@ function(add_ocaml_library name)
+@@ -147,9 +147,9 @@
    endforeach()
  
    if( APPLE )
@@ -94,10 +104,10 @@
    list(APPEND ocaml_flags "-ldopt" "-Wl,-rpath,${ocaml_rpath}")
  
 diff --git a/cmake/modules/CMakeLists.txt b/cmake/modules/CMakeLists.txt
-index d99af79aa38e..21e794224b99 100644
+index d99af79aa3..21e794224b 100644
 --- a/cmake/modules/CMakeLists.txt
 +++ b/cmake/modules/CMakeLists.txt
-@@ -127,7 +127,7 @@ set(LLVM_CONFIG_INCLUDE_DIRS
+@@ -127,7 +127,7 @@
    )
  list(REMOVE_DUPLICATES LLVM_CONFIG_INCLUDE_DIRS)
  
@@ -107,31 +117,154 @@
    "${LLVM_CONFIG_LIBRARY_DIR}"
    # FIXME: Should there be other entries here?
 diff --git a/tools/llvm-config/BuildVariables.inc.in b/tools/llvm-config/BuildVariables.inc.in
-index 370005cd8d7d..7e790bc52111 100644
+index 370005cd8d..059edeb016 100644
 --- a/tools/llvm-config/BuildVariables.inc.in
 +++ b/tools/llvm-config/BuildVariables.inc.in
-@@ -23,6 +23,7 @@
+@@ -23,6 +23,9 @@
  #define LLVM_CXXFLAGS "@LLVM_CXXFLAGS@"
  #define LLVM_BUILDMODE "@LLVM_BUILDMODE@"
  #define LLVM_LIBDIR_SUFFIX "@LLVM_LIBDIR_SUFFIX@"
 +#define LLVM_INSTALL_LIBDIR "@CMAKE_INSTALL_LIBDIR@"
++#define LLVM_INSTALL_STATICLIBDIR "@LLVM_INSTALL_STATICLIBDIR@"
++#define LLVM_TOOLS_INSTALL_DIR "@LLVM_TOOLS_INSTALL_DIR@"
  #define LLVM_INSTALL_INCLUDEDIR "@CMAKE_INSTALL_INCLUDEDIR@"
  #define LLVM_INSTALL_PACKAGE_DIR "@LLVM_INSTALL_PACKAGE_DIR@"
  #define LLVM_TARGETS_BUILT "@LLVM_TARGETS_BUILT@"
 diff --git a/tools/llvm-config/llvm-config.cpp b/tools/llvm-config/llvm-config.cpp
-index e86eb2b44b10..f63e207e792e 100644
+index d5b76b1bb6..afc7ae2519 100644
 --- a/tools/llvm-config/llvm-config.cpp
 +++ b/tools/llvm-config/llvm-config.cpp
-@@ -366,7 +366,11 @@ int main(int argc, char **argv) {
+@@ -225,7 +225,7 @@
+   --ignore-libllvm  Ignore libLLVM and link component libraries instead.\n\
+   --includedir      Directory containing LLVM headers.\n\
+   --ldflags         Print Linker flags.\n\
+-  --libdir          Directory containing LLVM libraries.\n\
++  --libdir          Directory containing shared LLVM libraries.\n\
+   --libfiles        Fully qualified library filenames for makefile depends.\n\
+   --libnames        Bare library names for in-tree builds.\n\
+   --libs            Libraries needed to link against LLVM components.\n\
+@@ -279,6 +279,7 @@
+ 
+ int main(int argc, char **argv) {
+   std::vector<StringRef> Components;
++  bool PrintLdFlags = false;
+   bool PrintLibs = false, PrintLibNames = false, PrintLibFiles = false;
+   bool PrintSystemLibs = false, PrintSharedMode = false;
+   bool HasAnyOption = false;
+@@ -324,8 +325,8 @@
+ 
+   // Compute various directory locations based on the derived location
+   // information.
+-  std::string ActivePrefix, ActiveBinDir, ActiveIncludeDir, ActiveLibDir,
+-              ActiveCMakeDir;
++  std::string ActivePrefix, ActiveBinDir, ActiveIncludeDir,
++              ActiveSharedLib, ActiveStaticLibDir, ActiveCMakeDir;
+   std::string ActiveIncludeOption;
+   if (IsInDevelopmentTree) {
+     ActiveIncludeDir = std::string(LLVM_SRC_ROOT) + "/include";
+@@ -336,14 +337,15 @@
+     switch (DevelopmentTreeLayout) {
+     case CMakeStyle:
+       ActiveBinDir = ActiveObjRoot + "/bin";
+-      ActiveLibDir = ActiveObjRoot + "/lib" + LLVM_LIBDIR_SUFFIX;
+-      ActiveCMakeDir = ActiveLibDir + "/cmake/llvm";
++      ActiveStaticLibDir = ActiveSharedLibDir =
++          ActiveObjRoot + "/lib" + LLVM_LIBDIR_SUFFIX;
++      ActiveCMakeDir = ActiveSharedLibDir + "/cmake/llvm";
+       break;
+     case CMakeBuildModeStyle:
+       // FIXME: Should we consider the build-mode-specific path as the prefix?
+       ActivePrefix = ActiveObjRoot;
+       ActiveBinDir = ActiveObjRoot + "/" + build_mode + "/bin";
+-      ActiveLibDir =
++      ActiveStaticLibDir = ActiveSharedLibDir =
+           ActiveObjRoot + "/" + build_mode + "/lib" + LLVM_LIBDIR_SUFFIX;
+       // The CMake directory isn't separated by build mode.
+       ActiveCMakeDir =
+@@ -366,7 +368,16 @@
        sys::fs::make_absolute(ActivePrefix, Path);
-       ActiveBinDir = std::string(Path.str());
+       ActiveBinDir = std::string(Path);
      }
 -    ActiveLibDir = ActivePrefix + "/lib" + LLVM_LIBDIR_SUFFIX;
 +    {
 +      SmallString<256> Path(LLVM_INSTALL_LIBDIR LLVM_LIBDIR_SUFFIX);
 +      sys::fs::make_absolute(ActivePrefix, Path);
-+      ActiveLibDir = std::string(Path.str());
++      ActiveSharedLibDir = std::string(Path.str());
++    }
++    {
++      SmallString<256> Path(LLVM_INSTALL_STATICLIBDIR LLVM_LIBDIR_SUFFIX);
++      sys::fs::make_absolute(ActivePrefix, Path);
++      ActiveStaticLibDir = std::string(Path.str());
 +    }
      {
        SmallString<256> Path(LLVM_INSTALL_PACKAGE_DIR);
        sys::fs::make_absolute(ActivePrefix, Path);
+@@ -399,25 +410,28 @@
+       std::replace(ActiveObjRoot.begin(), ActiveObjRoot.end(), '/', '\\');
+       std::replace(ActivePrefix.begin(), ActivePrefix.end(), '/', '\\');
+       std::replace(ActiveBinDir.begin(), ActiveBinDir.end(), '/', '\\');
+-      std::replace(ActiveLibDir.begin(), ActiveLibDir.end(), '/', '\\');
++      std::replace(ActiveSharedLibDir.begin(), ActiveSharedLibDir.end(), '/', '\\');
++      std::replace(ActiveStaticLibDir.begin(), ActiveStaticLibDir.end(), '/', '\\');
+       std::replace(ActiveCMakeDir.begin(), ActiveCMakeDir.end(), '/', '\\');
+       std::replace(ActiveIncludeOption.begin(), ActiveIncludeOption.end(), '/',
+                    '\\');
+     }
+-    SharedDir = ActiveBinDir;
+-    StaticDir = ActiveLibDir;
++    SharedDir = ActiveSharedLibDir;
++    StaticDir = ActiveStaticLibDir;
+   } else if (HostTriple.isOSDarwin()) {
+     SharedExt = "dylib";
+     SharedVersionedExt = LLVM_DYLIB_VERSION ".dylib";
+     StaticExt = "a";
+-    StaticDir = SharedDir = ActiveLibDir;
++    SharedDir = ActiveSharedLibDir;
++    StaticDir = ActiveStaticLibDir;
+     StaticPrefix = SharedPrefix = "lib";
+   } else {
+     // default to the unix values:
+     SharedExt = "so";
+     SharedVersionedExt = LLVM_DYLIB_VERSION ".so";
+     StaticExt = "a";
+-    StaticDir = SharedDir = ActiveLibDir;
++    SharedDir = ActiveSharedLibDir;
++    StaticDir = ActiveStaticLibDir;
+     StaticPrefix = SharedPrefix = "lib";
+   }
+ 
+@@ -518,7 +532,7 @@
+       } else if (Arg == "--includedir") {
+         OS << ActiveIncludeDir << '\n';
+       } else if (Arg == "--libdir") {
+-        OS << ActiveLibDir << '\n';
++        OS << ActiveSharedLibDir << '\n';
+       } else if (Arg == "--cmakedir") {
+         OS << ActiveCMakeDir << '\n';
+       } else if (Arg == "--cppflags") {
+@@ -528,8 +542,7 @@
+       } else if (Arg == "--cxxflags") {
+         OS << ActiveIncludeOption << ' ' << LLVM_CXXFLAGS << '\n';
+       } else if (Arg == "--ldflags") {
+-        OS << ((HostTriple.isWindowsMSVCEnvironment()) ? "-LIBPATH:" : "-L")
+-           << ActiveLibDir << ' ' << LLVM_LDFLAGS << '\n';
++        PrintLdFlags = true;
+       } else if (Arg == "--system-libs") {
+         PrintSystemLibs = true;
+       } else if (Arg == "--libs") {
+@@ -616,8 +629,13 @@
+     return 1;
+   }
+ 
+-  if (PrintLibs || PrintLibNames || PrintLibFiles || PrintSystemLibs ||
+-      PrintSharedMode) {
++  if (PrintLdFlags || PrintLibs || PrintLibNames || PrintLibFiles
++      PrintSystemLibs || PrintSharedMode) {
++    if (PrintLdFlags) {
++        OS << ((HostTriple.isWindowsMSVCEnvironment()) ? "-LIBPATH:" : "-L")
++           << (LinkMode == LinkModeShared ? SharedDir : StaticDir)
++           << ' ' << LLVM_LDFLAGS << '\n';
++    }
+ 
+     if (PrintSharedMode && BuiltSharedLibs) {
+       OS << "shared\n";
diff --git a/pkgs/development/compilers/llvm/20/llvm/gnu-install-dirs.patch b/pkgs/development/compilers/llvm/20/llvm/gnu-install-dirs.patch
index 6f9ed1cafc..5c258be50a 100644
--- a/pkgs/development/compilers/llvm/20/llvm/gnu-install-dirs.patch
+++ b/pkgs/development/compilers/llvm/20/llvm/gnu-install-dirs.patch
@@ -1,35 +1,43 @@
 diff --git a/CMakeLists.txt b/CMakeLists.txt
-index c9ff3696e22d..bd96aab5e237 100644
+index f5293e8663..ff53a08815 100644
 --- a/CMakeLists.txt
 +++ b/CMakeLists.txt
-@@ -1133,9 +1133,9 @@ if (NOT TENSORFLOW_AOT_PATH STREQUAL "")
-   add_subdirectory(${TENSORFLOW_AOT_PATH}/xla_aot_runtime_src
+@@ -442,6 +442,10 @@
+ set(LLVM_INSTALL_PACKAGE_DIR "${CMAKE_INSTALL_PACKAGEDIR}/llvm" CACHE STRING
+   "Path for CMake subdirectory for LLVM (defaults to '${CMAKE_INSTALL_PACKAGEDIR}/llvm')")
+ 
++set(LLVM_INSTALL_STATICLIBDIR "${CMAKE_INSTALL_LIBDIR}" CACHE STRING
++    "Path for LLVM static libraries (defaults to '${CMAKE_INSTALL_LIBDIR}')")
++mark_as_advanced(LLVM_INSTALL_STATICLIBDIR)
++
+ set(LLVM_TOOLS_INSTALL_DIR "${CMAKE_INSTALL_BINDIR}" CACHE STRING
+     "Path for binary subdirectory (defaults to '${CMAKE_INSTALL_BINDIR}')")
+ mark_as_advanced(LLVM_TOOLS_INSTALL_DIR)
+@@ -1135,8 +1139,6 @@
      ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}/tf_runtime)
    install(TARGETS tf_xla_runtime EXPORT LLVMExports
--    ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX} COMPONENT tf_xla_runtime)
-+    ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX} COMPONENT tf_xla_runtime)
-   install(TARGETS tf_xla_runtime EXPORT LLVMDevelopmentExports
--    ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX} COMPONENT tf_xla_runtime)
-+    ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX} COMPONENT tf_xla_runtime)
+     ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX} COMPONENT tf_xla_runtime)
+-  install(TARGETS tf_xla_runtime EXPORT LLVMDevelopmentExports
+-    ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX} COMPONENT tf_xla_runtime)
    set_property(GLOBAL APPEND PROPERTY LLVM_EXPORTS tf_xla_runtime)
    # Once we add more modules, we should handle this more automatically.
    if (DEFINED LLVM_OVERRIDE_MODEL_HEADER_INLINERSIZEMODEL)
 diff --git a/cmake/modules/AddLLVM.cmake b/cmake/modules/AddLLVM.cmake
-index baf47677b247..81954240a9bf 100644
+index d3e9377c8d..95e3544c46 100644
 --- a/cmake/modules/AddLLVM.cmake
 +++ b/cmake/modules/AddLLVM.cmake
-@@ -974,8 +974,8 @@ macro(add_llvm_library name)
+@@ -974,8 +974,8 @@
        endif()
        install(TARGETS ${name}
                ${export_to_llvmexports}
 -              LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX} COMPONENT ${name}
 -              ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX} COMPONENT ${name}
-+              LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX} COMPONENT ${name}
-+              ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX} COMPONENT ${name}
++              LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}" COMPONENT ${name}
++              ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}" COMPONENT ${name}
                RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" COMPONENT ${name})
  
        if (NOT LLVM_ENABLE_IDE)
-@@ -2243,7 +2243,7 @@ function(llvm_install_library_symlink name dest type)
+@@ -2240,7 +2240,7 @@
      set(LLVM_LINK_OR_COPY copy)
    endif()
  
@@ -38,7 +46,7 @@
    if(WIN32 AND "${type}" STREQUAL "SHARED")
      set(output_dir "${CMAKE_INSTALL_BINDIR}")
    endif()
-@@ -2519,16 +2519,37 @@ function(llvm_setup_rpath name)
+@@ -2516,16 +2516,37 @@
  
    if (APPLE)
      set(_install_name_dir INSTALL_NAME_DIR "@rpath")
@@ -80,10 +88,10 @@
        set_property(TARGET ${name} APPEND_STRING PROPERTY
                     LINK_FLAGS " -Wl,-z,origin ")
 diff --git a/cmake/modules/AddOCaml.cmake b/cmake/modules/AddOCaml.cmake
-index 2d9116b08a52..2dd7cad4ec66 100644
+index 2d9116b08a..2dd7cad4ec 100644
 --- a/cmake/modules/AddOCaml.cmake
 +++ b/cmake/modules/AddOCaml.cmake
-@@ -147,9 +147,9 @@ function(add_ocaml_library name)
+@@ -147,9 +147,9 @@
    endforeach()
  
    if( APPLE )
@@ -96,10 +104,10 @@
    list(APPEND ocaml_flags "-ldopt" "-Wl,-rpath,${ocaml_rpath}")
  
 diff --git a/cmake/modules/CMakeLists.txt b/cmake/modules/CMakeLists.txt
-index ef4cfa3acdb5..7478e157a7c2 100644
+index ef4cfa3acd..7478e157a7 100644
 --- a/cmake/modules/CMakeLists.txt
 +++ b/cmake/modules/CMakeLists.txt
-@@ -130,7 +130,7 @@ set(LLVM_CONFIG_INCLUDE_DIRS
+@@ -130,7 +130,7 @@
    )
  list(REMOVE_DUPLICATES LLVM_CONFIG_INCLUDE_DIRS)
  
@@ -109,22 +117,71 @@
    "${LLVM_CONFIG_LIBRARY_DIR}"
    # FIXME: Should there be other entries here?
 diff --git a/tools/llvm-config/BuildVariables.inc.in b/tools/llvm-config/BuildVariables.inc.in
-index 370005cd8d7d..7e790bc52111 100644
+index 370005cd8d..059edeb016 100644
 --- a/tools/llvm-config/BuildVariables.inc.in
 +++ b/tools/llvm-config/BuildVariables.inc.in
-@@ -23,6 +23,7 @@
+@@ -23,6 +23,9 @@
  #define LLVM_CXXFLAGS "@LLVM_CXXFLAGS@"
  #define LLVM_BUILDMODE "@LLVM_BUILDMODE@"
  #define LLVM_LIBDIR_SUFFIX "@LLVM_LIBDIR_SUFFIX@"
 +#define LLVM_INSTALL_LIBDIR "@CMAKE_INSTALL_LIBDIR@"
++#define LLVM_INSTALL_STATICLIBDIR "@LLVM_INSTALL_STATICLIBDIR@"
++#define LLVM_TOOLS_INSTALL_DIR "@LLVM_TOOLS_INSTALL_DIR@"
  #define LLVM_INSTALL_INCLUDEDIR "@CMAKE_INSTALL_INCLUDEDIR@"
  #define LLVM_INSTALL_PACKAGE_DIR "@LLVM_INSTALL_PACKAGE_DIR@"
  #define LLVM_TARGETS_BUILT "@LLVM_TARGETS_BUILT@"
 diff --git a/tools/llvm-config/llvm-config.cpp b/tools/llvm-config/llvm-config.cpp
-index d5b76b1bb6c1..1dbdb2a8f10d 100644
+index d5b76b1bb6..afc7ae2519 100644
 --- a/tools/llvm-config/llvm-config.cpp
 +++ b/tools/llvm-config/llvm-config.cpp
-@@ -366,7 +366,11 @@ int main(int argc, char **argv) {
+@@ -225,7 +225,7 @@
+   --ignore-libllvm  Ignore libLLVM and link component libraries instead.\n\
+   --includedir      Directory containing LLVM headers.\n\
+   --ldflags         Print Linker flags.\n\
+-  --libdir          Directory containing LLVM libraries.\n\
++  --libdir          Directory containing shared LLVM libraries.\n\
+   --libfiles        Fully qualified library filenames for makefile depends.\n\
+   --libnames        Bare library names for in-tree builds.\n\
+   --libs            Libraries needed to link against LLVM components.\n\
+@@ -279,6 +279,7 @@
+ 
+ int main(int argc, char **argv) {
+   std::vector<StringRef> Components;
++  bool PrintLdFlags = false;
+   bool PrintLibs = false, PrintLibNames = false, PrintLibFiles = false;
+   bool PrintSystemLibs = false, PrintSharedMode = false;
+   bool HasAnyOption = false;
+@@ -324,8 +325,8 @@
+ 
+   // Compute various directory locations based on the derived location
+   // information.
+-  std::string ActivePrefix, ActiveBinDir, ActiveIncludeDir, ActiveLibDir,
+-              ActiveCMakeDir;
++  std::string ActivePrefix, ActiveBinDir, ActiveIncludeDir,
++              ActiveSharedLib, ActiveStaticLibDir, ActiveCMakeDir;
+   std::string ActiveIncludeOption;
+   if (IsInDevelopmentTree) {
+     ActiveIncludeDir = std::string(LLVM_SRC_ROOT) + "/include";
+@@ -336,14 +337,15 @@
+     switch (DevelopmentTreeLayout) {
+     case CMakeStyle:
+       ActiveBinDir = ActiveObjRoot + "/bin";
+-      ActiveLibDir = ActiveObjRoot + "/lib" + LLVM_LIBDIR_SUFFIX;
+-      ActiveCMakeDir = ActiveLibDir + "/cmake/llvm";
++      ActiveStaticLibDir = ActiveSharedLibDir =
++          ActiveObjRoot + "/lib" + LLVM_LIBDIR_SUFFIX;
++      ActiveCMakeDir = ActiveSharedLibDir + "/cmake/llvm";
+       break;
+     case CMakeBuildModeStyle:
+       // FIXME: Should we consider the build-mode-specific path as the prefix?
+       ActivePrefix = ActiveObjRoot;
+       ActiveBinDir = ActiveObjRoot + "/" + build_mode + "/bin";
+-      ActiveLibDir =
++      ActiveStaticLibDir = ActiveSharedLibDir =
+           ActiveObjRoot + "/" + build_mode + "/lib" + LLVM_LIBDIR_SUFFIX;
+       // The CMake directory isn't separated by build mode.
+       ActiveCMakeDir =
+@@ -366,7 +368,16 @@
        sys::fs::make_absolute(ActivePrefix, Path);
        ActiveBinDir = std::string(Path);
      }
@@ -132,8 +189,82 @@
 +    {
 +      SmallString<256> Path(LLVM_INSTALL_LIBDIR LLVM_LIBDIR_SUFFIX);
 +      sys::fs::make_absolute(ActivePrefix, Path);
-+      ActiveLibDir = std::string(Path);
++      ActiveSharedLibDir = std::string(Path.str());
++    }
++    {
++      SmallString<256> Path(LLVM_INSTALL_STATICLIBDIR LLVM_LIBDIR_SUFFIX);
++      sys::fs::make_absolute(ActivePrefix, Path);
++      ActiveStaticLibDir = std::string(Path.str());
 +    }
      {
        SmallString<256> Path(LLVM_INSTALL_PACKAGE_DIR);
        sys::fs::make_absolute(ActivePrefix, Path);
+@@ -399,25 +410,28 @@
+       std::replace(ActiveObjRoot.begin(), ActiveObjRoot.end(), '/', '\\');
+       std::replace(ActivePrefix.begin(), ActivePrefix.end(), '/', '\\');
+       std::replace(ActiveBinDir.begin(), ActiveBinDir.end(), '/', '\\');
+-      std::replace(ActiveLibDir.begin(), ActiveLibDir.end(), '/', '\\');
++      std::replace(ActiveSharedLibDir.begin(), ActiveSharedLibDir.end(), '/', '\\');
++      std::replace(ActiveStaticLibDir.begin(), ActiveStaticLibDir.end(), '/', '\\');
+       std::replace(ActiveCMakeDir.begin(), ActiveCMakeDir.end(), '/', '\\');
+       std::replace(ActiveIncludeOption.begin(), ActiveIncludeOption.end(), '/',
+                    '\\');
+     }
+-    SharedDir = ActiveBinDir;
+-    StaticDir = ActiveLibDir;
++    SharedDir = ActiveSharedLibDir;
++    StaticDir = ActiveStaticLibDir;
+   } else if (HostTriple.isOSDarwin()) {
+     SharedExt = "dylib";
+     SharedVersionedExt = LLVM_DYLIB_VERSION ".dylib";
+     StaticExt = "a";
+-    StaticDir = SharedDir = ActiveLibDir;
++    SharedDir = ActiveSharedLibDir;
++    StaticDir = ActiveStaticLibDir;
+     StaticPrefix = SharedPrefix = "lib";
+   } else {
+     // default to the unix values:
+     SharedExt = "so";
+     SharedVersionedExt = LLVM_DYLIB_VERSION ".so";
+     StaticExt = "a";
+-    StaticDir = SharedDir = ActiveLibDir;
++    SharedDir = ActiveSharedLibDir;
++    StaticDir = ActiveStaticLibDir;
+     StaticPrefix = SharedPrefix = "lib";
+   }
+ 
+@@ -518,7 +532,7 @@
+       } else if (Arg == "--includedir") {
+         OS << ActiveIncludeDir << '\n';
+       } else if (Arg == "--libdir") {
+-        OS << ActiveLibDir << '\n';
++        OS << ActiveSharedLibDir << '\n';
+       } else if (Arg == "--cmakedir") {
+         OS << ActiveCMakeDir << '\n';
+       } else if (Arg == "--cppflags") {
+@@ -528,8 +542,7 @@
+       } else if (Arg == "--cxxflags") {
+         OS << ActiveIncludeOption << ' ' << LLVM_CXXFLAGS << '\n';
+       } else if (Arg == "--ldflags") {
+-        OS << ((HostTriple.isWindowsMSVCEnvironment()) ? "-LIBPATH:" : "-L")
+-           << ActiveLibDir << ' ' << LLVM_LDFLAGS << '\n';
++        PrintLdFlags = true;
+       } else if (Arg == "--system-libs") {
+         PrintSystemLibs = true;
+       } else if (Arg == "--libs") {
+@@ -616,8 +629,13 @@
+     return 1;
+   }
+ 
+-  if (PrintLibs || PrintLibNames || PrintLibFiles || PrintSystemLibs ||
+-      PrintSharedMode) {
++  if (PrintLdFlags || PrintLibs || PrintLibNames || PrintLibFiles
++      PrintSystemLibs || PrintSharedMode) {
++    if (PrintLdFlags) {
++        OS << ((HostTriple.isWindowsMSVCEnvironment()) ? "-LIBPATH:" : "-L")
++           << (LinkMode == LinkModeShared ? SharedDir : StaticDir)
++           << ' ' << LLVM_LDFLAGS << '\n';
++    }
+ 
+     if (PrintSharedMode && BuiltSharedLibs) {
+       OS << "shared\n";
diff --git a/pkgs/development/compilers/llvm/common/llvm/default.nix b/pkgs/development/compilers/llvm/common/llvm/default.nix
index 5d8506627a..9d49289a9d 100644
--- a/pkgs/development/compilers/llvm/common/llvm/default.nix
+++ b/pkgs/development/compilers/llvm/common/llvm/default.nix
@@ -677,6 +677,7 @@
                   (lib.cmakeFeature "CMAKE_INSTALL_BINDIR" "${placeholder "out"}/bin")
                   (lib.cmakeFeature "CMAKE_INSTALL_INCLUDEDIR" "${placeholder "dev"}/include")
                   (lib.cmakeFeature "CMAKE_INSTALL_LIBDIR" "${placeholder "lib"}/lib")
+                  (lib.cmakeFeature "LLVM_INSTALL_STATICLIBDIR" "${placeholder "dev"}/lib")
                   (lib.cmakeFeature "CMAKE_INSTALL_LIBEXECDIR" "${placeholder "lib"}/libexec")
                 ];
               in
@@ -699,6 +700,10 @@
       moveToOutput "bin/llvm-config*" "$dev"
       substituteInPlace "$dev/lib/cmake/llvm/LLVMExports-${lib.toLower finalAttrs.finalPackage.cmakeBuildType}.cmake" \
         --replace-fail "$out/bin/llvm-config" "$dev/bin/llvm-config"
+
+      # Move static libraries to `$dev` to keep them out of runtime
+      # closures (e.g. Mesa).
+      moveToOutput "lib/*.a" "$dev"
     ''
     + (
       if lib.versionOlder release_version "15" then
17:58:20
@aloisw:julia0815.dealoisw
In reply to @emilazy:matrix.org
I guess we can because microcode?
That's normally just concatenated to the normal initrd. I don't remember a nice way to pass the kernel multiple initrd files.
17:58:26
@emilazy:matrix.orgemilyyeah seems like GRUB will concatenate them for you17:58:55
@emilazy:matrix.orgemilybut not other stuff17:58:58
@elvishjerricco:matrix.orgElvishJerriccolove a good patch of a patch file :P17:59:22
@aloisw:julia0815.dealoisw
In reply to @elvishjerricco:matrix.org
so what we'd really want to do is split modules from user space and share the user space
… or put both modules in the same initrd side by side. The directory is versioned.
17:59:54
@elvishjerricco:matrix.orgElvishJerriccoIn practice microcode works by us just prepending to the initrd18:00:22

Show newer messages


Back to Room ListRoom Version: 9