onnxruntime: fix loongarch64-linux build (#442711)

authored by Sandro and committed by GitHub 9e61ebaa cde4445b

+18 -3
+18 -3
pkgs/by-name/on/onnxruntime/package.nix
··· 135 135 ]; 136 136 137 137 buildInputs = [ 138 - cpuinfo 139 138 eigen 140 139 glibcLocales 141 140 howard-hinnant-date ··· 144 143 microsoft-gsl 145 144 pytorch_clog 146 145 zlib 146 + ] 147 + ++ lib.optionals (lib.meta.availableOn effectiveStdenv.hostPlatform cpuinfo) [ 148 + cpuinfo 147 149 ] 148 150 ++ lib.optionals pythonSupport ( 149 151 with python3Packages; ··· 234 236 NIX_CFLAGS_COMPILE = "-Wno-error"; 235 237 }; 236 238 237 - # aarch64-linux fails cpuinfo test, because /sys/devices/system/cpu/ does not exist in the sandbox 238 - doCheck = !(cudaSupport || effectiveStdenv.buildPlatform.system == "aarch64-linux"); 239 + doCheck = 240 + !( 241 + cudaSupport 242 + || builtins.elem effectiveStdenv.buildPlatform.system [ 243 + # aarch64-linux fails cpuinfo test, because /sys/devices/system/cpu/ does not exist in the sandbox 244 + "aarch64-linux" 245 + # 1 - onnxruntime_test_all (Failed) 246 + # 4761 tests from 311 test suites ran, 57 failed. 247 + "loongarch64-linux" 248 + ] 249 + ); 239 250 240 251 requiredSystemFeatures = lib.optionals cudaSupport [ "big-parallel" ]; 252 + 253 + hardeningEnable = lib.optionals (effectiveStdenv.hostPlatform.system == "loongarch64-linux") [ 254 + "nostrictaliasing" 255 + ]; 241 256 242 257 postPatch = '' 243 258 substituteInPlace cmake/libonnxruntime.pc.cmake.in \