[libcxx-commits] [libcxx] r359045 - [libcxx] Use relative path for libc++ library when generating script
Petr Hosek via libcxx-commits
libcxx-commits at lists.llvm.org
Tue Apr 23 15:55:29 PDT 2019
Author: phosek
Date: Tue Apr 23 15:55:28 2019
New Revision: 359045
URL: http://llvm.org/viewvc/llvm-project?rev=359045&view=rev
Log:
[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
Modified:
libcxx/trunk/utils/gen_link_script.py
Modified: libcxx/trunk/utils/gen_link_script.py
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/utils/gen_link_script.py?rev=359045&r1=359044&r2=359045&view=diff
==============================================================================
--- libcxx/trunk/utils/gen_link_script.py (original)
+++ libcxx/trunk/utils/gen_link_script.py Tue Apr 23 15:55:28 2019
@@ -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:
More information about the libcxx-commits
mailing list