瀏覽代碼

[libcxx] Use relative path for libc++ library when generating script

This addresses the issue introduced in D60309 which leads to linker
scripts being generated with absolute paths.

Differential Revision: https://reviews.llvm.org/D61039

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@359045 91177308-0d34-0410-b5e6-96231b3b80d8
Petr Hosek 6 年之前
父節點
當前提交
82c110a209
共有 1 個文件被更改,包括 4 次插入1 次删除
  1. 4 1
      utils/gen_link_script.py

+ 4 - 1
utils/gen_link_script.py

@@ -29,11 +29,14 @@ def main():
                         help="List of libraries libc++ depends on")
     args = parser.parse_args()
 
+    # Use the relative path for the libc++ library.
+    libcxx = os.path.relpath(args.input, os.path.dirname(args.output))
+
     # Prepare the list of public libraries to link.
     public_libs = ['-l%s' % l for l in args.libraries]
 
     # Generate the linker script contents.
-    contents = "INPUT(%s)" % ' '.join([args.input] + public_libs)
+    contents = "INPUT(%s)" % ' '.join([libcxx] + public_libs)
     print("GENERATING SCRIPT: '%s' as file %s" % (contents, args.output))
 
     if args.dryrun: