[PATCH] D65543: Use library basenames when autolinking on Windows

Reid Kleckner via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 31 15:00:55 PDT 2019


rnk created this revision.
rnk added reviewers: russell.gallop, thakis, pcc.
Herald added a subscriber: srhines.
Herald added a project: clang.

Otherwise we embed a potentially absolute and potentially relative path
to clang's resource directory into the object file. Object files with
paths embedded in them are fragile and system specific, even when the
path is relative. They cannot be put in an archive and distributed, for
example.

This will require users to add clang's library directory in its resource
directory to the linker libpath, but that is relatively easy compared to
computing the name of the appropriate compiler-rt library, which is
currently architecture dependent.

This is also consistent with how autolinking seems to work for PS4.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D65543

Files:
  clang/include/clang/Driver/ToolChain.h
  clang/lib/Driver/SanitizerArgs.cpp
  clang/lib/Driver/ToolChain.cpp
  clang/lib/Driver/ToolChains/Clang.cpp
  clang/test/Driver/cl-options.c
  clang/test/Driver/sanitizer-ld.c

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D65543.212672.patch
Type: text/x-patch
Size: 8886 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190731/4f5247a3/attachment-0001.bin>


More information about the cfe-commits mailing list