Skip to content

Commit

Permalink
nvidia-k8s-device-plugin: clean up linker flags
Browse files Browse the repository at this point in the history
`--export-dynamic` is a separate option, independent of `-z`, so pass
it as its own `-Wl` flag.

For consistency, pass the same flags to the external linker.

Signed-off-by: Ben Cressey <bcressey@amazon.com>
  • Loading branch information
bcressey committed Apr 27, 2024
1 parent 7d92f05 commit 7bbd73f
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ BuildRequires: %{_cross_os}glibc-devel
%cross_go_configure %{goimport}
# We don't set `-Wl,-z,now`, because the binary uses lazy loading
# to load the NVIDIA libraries in the host
export CGO_LDFLAGS="-Wl,-z,relro,-export-dynamic"
export CGO_LDFLAGS="-Wl,-z,relro -Wl,--export-dynamic"
export GOLDFLAGS="-compressdwarf=false -linkmode=external -extldflags '${CGO_LDFLAGS}'"
go build -ldflags="${GOLDFLAGS}" -o nvidia-device-plugin ./cmd/nvidia-device-plugin/

%install
Expand Down

0 comments on commit 7bbd73f

Please sign in to comment.