nvidia-container-toolkit: document the ldflags

This commit is contained in:
Someone Serge 2024-02-13 13:08:48 +00:00
parent 9daafdfcfb
commit eeb1b2ffec
No known key found for this signature in database
GPG Key ID: 7B0E3B1390D61DA4

View File

@ -74,9 +74,15 @@ buildGoModule rec {
--replace '/sbin/ldconfig' '${lib.getBin glibc}/sbin/ldconfig'
'';
# Try to keep this close to the ldflags in the original Makefile. See:
# Based on upstream's Makefile:
# https://gitlab.com/nvidia/container-toolkit/container-toolkit/-/blob/03cbf9c6cd26c75afef8a2dd68e0306aace80401/Makefile#L64
ldflags = [ "-extldflags=-Wl,-z,lazy" "-s" "-w" "-X" "${cliVersionPackage}.version=${version}" ];
ldflags = [
"-extldflags=-Wl,-z,lazy" # May be redunandant, cf. `man ld`: "Lazy binding is the default".
"--strip-all" # May be redundant. Upstream: "-s".
# Omitting the upstream flag: "-w" (suppresses errors and warnings).
"--discard-locals" # May be redundant. Upstream: "-X".
"${cliVersionPackage}.version=${version}"
];
nativeBuildInputs = [
cudaPackages.autoAddOpenGLRunpathHook