dxc/gn: fix rpath for Linux builds

GN seems to add rpath properly for debug, but not non-debug builds. Fix
this in the same way I did for CMake, but setting rpath to $ORIGIN.

Change-Id: I97923291e73ad78f458a4a7951939e214a78008a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/163781
Commit-Queue: Antonio Maiorano <amaiorano@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
diff --git a/third_party/gn/dxc/BUILD.gn b/third_party/gn/dxc/BUILD.gn
index 8e7ae64..b1a60bb 100644
--- a/third_party/gn/dxc/BUILD.gn
+++ b/third_party/gn/dxc/BUILD.gn
@@ -2338,9 +2338,11 @@
 
   data_deps = [ ":dxcompiler" ]
 
-  # Set rpath to executable_path to be able to find dxcompiler.so on MacOS
+  # Set rpath to be able to find the dxcompiler shared library
   if (is_mac) {
     ldflags = [ "-Wl,-rpath,@executable_path" ]
+  } else if (is_linux) {
+    ldflags = [ "-Wl,-rpath=\$ORIGIN" ]
   }
 
   if (is_win) {