[llvm-bugs] [Bug 36938] New: Add a warning to keep backward compatibility with GNU
via llvm-bugs
llvm-bugs at lists.llvm.org
Wed Mar 28 19:48:50 PDT 2018
https://bugs.llvm.org/show_bug.cgi?id=36938
Bug ID: 36938
Summary: Add a warning to keep backward compatibility with GNU
Product: lld
Version: unspecified
Hardware: All
OS: All
Status: NEW
Severity: enhancement
Priority: P
Component: ELF
Assignee: unassignedbugs at nondot.org
Reporter: ruiu at google.com
CC: llvm-bugs at lists.llvm.org
lld's symbol resolution semantics is different from traditional Unix linkers.
That's for a good reason, but that causes some practical issue when writing
code that should work on various targets. Once you migrate to lld, nothing
stops you from writing a Makefile (or equivalent) that works only with lld.
Since lld is not sensitive to the relative file order in the command line,
ld.lld foo.a bar.o
works even if bar.o depends on foo.a. But it fails with traditional linkers.
In order to catch that kind of error early, we may want to add a new command
line option to make lld to emit a warning when it finds backward references to
lazy symbols. I don't think that that option can catch all possible errors, but
it should still be useful.
Some background: once you completely migrate to lld, that kind of option is
useless. However, even if your company has completely migrated to lld, there is
a situation in which you still want to maintain compatibility with GNU linkers.
For example, if you open-source your internal code, you want to make it compile
and link with system default compiler and linker. Just like we can't force
users use clang++ instead of g++ to compile C++ source files, we can't really
say to users that they need lld instead of system's ld. Finding all
compatibility issues at once and fix all at once is hard, so we want to
identify and fix a compatibility issue as we create one. So, a feature for
making it easy to identify possible compatibility issue is useful.
--
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20180329/e2250535/attachment.html>
More information about the llvm-bugs
mailing list