llvm_tools: Fix bug in creating symlink

Pass "-r" to ln to keep the symlink relative rather than
absolute.

BUG=chromium:1041590
TEST=unit tests.

Change-Id: I925df430abd0d25a94e17a06186ee9f503efa264
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/2142920
Reviewed-by: George Burgess <gbiv@chromium.org>
Tested-by: Manoj Gupta <manojgupta@chromium.org>
diff --git a/llvm_tools/update_chromeos_llvm_hash.py b/llvm_tools/update_chromeos_llvm_hash.py
index c18e72f..4f55a5d 100755
--- a/llvm_tools/update_chromeos_llvm_hash.py
+++ b/llvm_tools/update_chromeos_llvm_hash.py
@@ -394,7 +394,7 @@
 
   # Create a symlink of the renamed ebuild
   new_symlink = new_ebuild[:-len('.ebuild')] + '-r1.ebuild'
-  cmd = ['ln', '-s', new_ebuild, new_symlink]
+  cmd = ['ln', '-s', '-r', new_ebuild, new_symlink]
   ExecCommandAndCaptureOutput(cmd, verbose=verbose)
 
   if not os.path.islink(new_symlink):
diff --git a/llvm_tools/update_chromeos_llvm_hash_unittest.py b/llvm_tools/update_chromeos_llvm_hash_unittest.py
index b6d8c5d..a9f1841 100755
--- a/llvm_tools/update_chromeos_llvm_hash_unittest.py
+++ b/llvm_tools/update_chromeos_llvm_hash_unittest.py
@@ -361,7 +361,7 @@
     self.assertEqual(mock_command_output.call_args_list[0],
                      mock.call(expected_cmd, verbose=False))
 
-    expected_cmd = ['ln', '-s', new_ebuild, new_symlink]
+    expected_cmd = ['ln', '-s', '-r', new_ebuild, new_symlink]
     self.assertEqual(mock_command_output.call_args_list[1],
                      mock.call(expected_cmd, verbose=False))