summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPetr Hosek <phosek@chromium.org>2019-04-23 22:55:28 +0000
committerPetr Hosek <phosek@chromium.org>2019-04-23 22:55:28 +0000
commit80b578c7325352187d0aff7bd2bdb5a76b51cf37 (patch)
tree92970d3b9b4571a1100363b22862abae99bebb17
parent9766bf1854d00e069736511834e2c94c31ee80c9 (diff)
downloadbcm5719-llvm-80b578c7325352187d0aff7bd2bdb5a76b51cf37.tar.gz
bcm5719-llvm-80b578c7325352187d0aff7bd2bdb5a76b51cf37.zip
[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 llvm-svn: 359045
-rwxr-xr-xlibcxx/utils/gen_link_script.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/libcxx/utils/gen_link_script.py b/libcxx/utils/gen_link_script.py
index 36c922c7d40..238c5747cc8 100755
--- a/libcxx/utils/gen_link_script.py
+++ b/libcxx/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:
OpenPOWER on IntegriCloud