mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-07-21 08:01:31 +00:00
cudaPackages.cuda_nvcc: patch math_functions.h signatures
Fix compatibility with glibc 2.42
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
cudaAtLeast,
|
||||
cudaOlder,
|
||||
cuda_cccl,
|
||||
glibc,
|
||||
lib,
|
||||
libnvvm,
|
||||
makeBinaryWrapper,
|
||||
@@ -163,6 +164,32 @@ buildRedist (finalAttrs: {
|
||||
"''${!outputBin:?}/bin/nvcc" \
|
||||
--prefix PATH : ${lib.makeBinPath [ backendStdenv.cc ]}
|
||||
''
|
||||
# Fix compatibility with glibc 2.42:
|
||||
# The cospi|sinpi|rsqrt function signatures in include/common/math_functions.h do not match
|
||||
# glibc 2.42's.
|
||||
# Indeed, there they are declared with noexcept(true) which is not the case in cuda_nvcc.
|
||||
+ lib.optionals (lib.versionAtLeast glibc.version "2.42") ''
|
||||
nixLog "Patching math_functions.h signatures to match glibc's ones"
|
||||
substituteInPlace "''${!outputInclude:?}/include/crt/math_functions.h" \
|
||||
--replace-fail \
|
||||
"sinpi(double x);" \
|
||||
"sinpi(double x) noexcept (true);" \
|
||||
--replace-fail \
|
||||
"sinpif(float x);" \
|
||||
"sinpif(float x) noexcept (true);" \
|
||||
--replace-fail \
|
||||
"cospi(double x);" \
|
||||
"cospi(double x) noexcept (true);" \
|
||||
--replace-fail \
|
||||
"cospif(float x);" \
|
||||
"cospif(float x) noexcept (true);" \
|
||||
--replace-fail \
|
||||
"rsqrt(double x);" \
|
||||
"rsqrt(double x) noexcept (true);" \
|
||||
--replace-fail \
|
||||
"rsqrtf(float x);" \
|
||||
"rsqrtf(float x) noexcept (true);"
|
||||
''
|
||||
);
|
||||
|
||||
brokenAssertions = [
|
||||
|
||||
Reference in New Issue
Block a user