Unverified Commit b7c27844 authored by dram's avatar dram Committed by GitHub
Browse files

onnxruntime: fix cross-compilation (#504885)

parents 8826bafa 18a283c0
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -21,7 +21,7 @@
  protobuf,
  microsoft-gsl,
  darwinMinVersionHook,
  pythonSupport ? true,
  pythonSupport ? (stdenv.buildPlatform.canExecute stdenv.hostPlatform),
  cudaSupport ? config.cudaSupport,
  ncclSupport ? cudaSupport && cudaPackages.nccl.meta.available,
  rocmSupport ? config.rocmSupport,
@@ -165,6 +165,7 @@ effectiveStdenv.mkDerivation (finalAttrs: {
    libpng
    nlohmann_json
    microsoft-gsl
    protobuf
    zlib
  ]
  ++ lib.optionals (lib.meta.availableOn effectiveStdenv.hostPlatform cpuinfo) [
@@ -313,6 +314,8 @@ effectiveStdenv.mkDerivation (finalAttrs: {
    !(
      cudaSupport
      || rocmSupport
      # cross-compiled test binaries can't execute on the build platform
      || (effectiveStdenv.hostPlatform != effectiveStdenv.buildPlatform)
      || builtins.elem effectiveStdenv.buildPlatform.system [
        # aarch64-linux fails cpuinfo test, because /sys/devices/system/cpu/ does not exist in the sandbox
        "aarch64-linux"