Commit Graph

190 Commits

Author SHA1 Message Date
Francis Visoiu Mistrih
dd42236c6c Reland "[Remarks] Add -foptimization-record-passes to filter remark emission"
Currently we have -Rpass for filtering the remarks that are displayed as
diagnostics, but when using -fsave-optimization-record, there is no way
to filter the remarks while generating them.

This adds support for filtering remarks by passes using a regex.
Ex: `clang -fsave-optimization-record -foptimization-record-passes=inline`

will only emit the remarks coming from the pass `inline`.

This adds:

* `-fsave-optimization-record` to the driver
* `-opt-record-passes` to cc1
* `-lto-pass-remarks-filter` to the LTOCodeGenerator
* `--opt-remarks-passes` to lld
* `-pass-remarks-filter` to llc, opt, llvm-lto, llvm-lto2
* `-opt-remarks-passes` to gold-plugin

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

Original llvm-svn: 355964

llvm-svn: 355984
2019-03-12 21:22:27 +00:00
Francis Visoiu Mistrih
1d6c47ad2b Revert "[Remarks] Add -foptimization-record-passes to filter remark emission"
This reverts commit 20fff32b7d.

llvm-svn: 355976
2019-03-12 20:54:18 +00:00
Francis Visoiu Mistrih
20fff32b7d [Remarks] Add -foptimization-record-passes to filter remark emission
Currently we have -Rpass for filtering the remarks that are displayed as
diagnostics, but when using -fsave-optimization-record, there is no way
to filter the remarks while generating them.

This adds support for filtering remarks by passes using a regex.
Ex: `clang -fsave-optimization-record -foptimization-record-passes=inline`

will only emit the remarks coming from the pass `inline`.

This adds:

* `-fsave-optimization-record` to the driver
* `-opt-record-passes` to cc1
* `-lto-pass-remarks-filter` to the LTOCodeGenerator
* `--opt-remarks-passes` to lld
* `-pass-remarks-filter` to llc, opt, llvm-lto, llvm-lto2
* `-opt-remarks-passes` to gold-plugin

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

llvm-svn: 355964
2019-03-12 20:28:50 +00:00
Fangrui Song
7507208a9a [ELF] Explain some options in ld.lld.1
Reviewers: ruiu, grimar

Reviewed By: ruiu

Subscribers: srhines, jdoerfert, llvm-commits

Tags: #llvm

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

llvm-svn: 355173
2019-03-01 04:49:42 +00:00
Rui Ueyama
5945ad5c43 Split a long line to avoid annoying horizontal scrolling on a browser.
llvm-svn: 354707
2019-02-23 00:24:18 +00:00
Rui Ueyama
81c0880c99 s/method/function/g since function is the correct name in C++.
llvm-svn: 354704
2019-02-22 23:59:51 +00:00
Sam Clegg
6540e57002 [WebAssembly] Don't generate invalid modules when function signatures mismatch
Previously we could emit a warning and generate a potentially invalid
wasm module (due to call sites and functions having conflicting
signatures). Now, rather than create invalid binaries we handle such
cases by creating stub functions containing unreachable, effectively
turning these into runtime errors rather than validation failures.

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

llvm-svn: 354528
2019-02-20 23:19:31 +00:00
Nico Weber
3a35a2a51c lld-link: Mention comdat selection work in the 9.0.0 wip release notes
Differential Revision: https://reviews.llvm.org/D58301

llvm-svn: 354241
2019-02-18 01:32:16 +00:00
Sam Clegg
230dc11d24 [WebAssembly] Refactor handling of weak undefined functions. NFC.
Also add to the docs.

This is refactor in preparation for https://reviews.llvm.org/D57909

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

llvm-svn: 353478
2019-02-07 22:42:16 +00:00
Sam Clegg
adf0aad794 [WebAssembly] Improve docs for wasm linker
Differential Revision: https://reviews.llvm.org/D57913

llvm-svn: 353451
2019-02-07 19:05:26 +00:00
Hans Wennborg
ccebc7e38c docs: add missingkeyfunction to doctree, fix title
llvm-svn: 353399
2019-02-07 12:39:35 +00:00
Fangrui Song
ae0294375f [ELF] Default to --no-allow-shlib-undefined for executables
Summary:
This follows the ld.bfd/gold behavior.

The error check is useful as it captures a common type of ld.so undefined symbol errors as link-time errors:

    // a.cc => a.so (not linked with -z defs)
    void f(); // f is undefined
    void g() { f(); }

    // b.cc => executable with a DT_NEEDED entry on a.so
    void g();
    int main() { g(); }

    // ld.so errors when g() is executed (lazy binding) or when the program is started (-z now)
    // symbol lookup error: ... undefined symbol: f

Reviewers: ruiu, grimar, pcc, espindola

Reviewed By: ruiu

Subscribers: llvm-commits, emaste, arichardson

Tags: #llvm

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

llvm-svn: 352943
2019-02-02 00:34:28 +00:00
James Y Knight
94b9709d84 Fix some sphinx doc errors.
llvm-svn: 352887
2019-02-01 17:06:41 +00:00
James Y Knight
5d71fc5d7b Adjust documentation for git migration.
This fixes most references to the paths:
 llvm.org/svn/
 llvm.org/git/
 llvm.org/viewvc/
 github.com/llvm-mirror/
 github.com/llvm-project/
 reviews.llvm.org/diffusion/

to instead point to https://github.com/llvm/llvm-project.

This is *not* a trivial substitution, because additionally, all the
checkout instructions had to be migrated to instruct users on how to
use the monorepo layout, setting LLVM_ENABLE_PROJECTS instead of
checking out various projects into various subdirectories.

I've attempted to not change any scripts here, only documentation. The
scripts will have to be addressed separately.

Additionally, I've deleted one document which appeared to be outdated
and unneeded:
  lldb/docs/building-with-debug-llvm.txt

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

llvm-svn: 352514
2019-01-29 16:37:27 +00:00
Chandler Carruth
2946cd7010 Update the file headers across all of the LLVM projects in the monorepo
to reflect the new license.

We understand that people may be surprised that we're moving the header
entirely to discuss the new license. We checked this carefully with the
Foundation's lawyer and we believe this is the correct approach.

Essentially, all code in the project is now made available by the LLVM
project under our new license, so you will see that the license headers
include that license only. Some of our contributors have contributed
code under our old license, and accordingly, we have retained a copy of
our old license notice in the top-level files in each project and
repository.

llvm-svn: 351636
2019-01-19 08:50:56 +00:00
Peter Smith
13d134684f [ELF] Implement option to force PIC compatible Thunks
By default LLD will generate position independent Thunks when the --pie or
--shared option is used. Reference to absolute addresses is permitted in
other cases. For some embedded systems position independent thunks are
needed for code that executes before the MMU has been set up. The option
--pic-veneer is used by ld.bfd to force position independent thunks.
    
The patch adds --pic-veneer as the option is needed for the Linux kernel
on Arm.
    
fixes pr39886
    
Differential Revision: https://reviews.llvm.org/D55505

llvm-svn: 351326
2019-01-16 12:09:13 +00:00
Hans Wennborg
1fe469ae6c Bump the trunk version to 9.0.0svn
llvm-svn: 351320
2019-01-16 10:57:02 +00:00
Nico Weber
6a5d94cc08 lld/include/lld/Core/TODO.txt
- fix minor grammar stuff (I'm not a native speaker either, but it's hopefully a net improvement)
- mention that lld/coff is used in production
- update AArch64, ARM to production quality
- remove lld/include/lld/Core/TODO.txt which looks outdated

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

llvm-svn: 351030
2019-01-14 00:45:27 +00:00
Rui Ueyama
4f194250ec Add a release note about MSP430 support.
llvm-svn: 350975
2019-01-11 22:31:35 +00:00
Martin Storsjo
17fb13bb40 [docs] Add a known limitation to the comment about lld supporting GCC/MinGW object files. NFC.
Differential Revision: https://reviews.llvm.org/D56335

llvm-svn: 350465
2019-01-05 10:44:03 +00:00
Fangrui Song
f747971bf1 keymethod -> keyfunction
Pointed out by ruiu in rLLD349969

llvm-svn: 349974
2018-12-21 22:57:11 +00:00
Fangrui Song
f874871c9e key method -> key function
The latter is what is actually called in the ABI http://itanium-cxx-abi.github.io/cxx-abi/abi.html#vague-vtable

Pointed out by rsmith

llvm-svn: 349969
2018-12-21 22:40:10 +00:00
Rui Ueyama
afe9673df2 Add a doc for missing key function and an error message referencing the doc.
Summary:
This is a common error, and because many people don't know what the key
function is, it is sometimes very confusing.

The doc was originally written by Brooks Moses and slightly edited by me.

Reviewers: MaskRay, espindola

Subscribers: emaste, llvm-commits, arichardson

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

llvm-svn: 349941
2018-12-21 19:28:49 +00:00
Sam Clegg
db8dd23204 [WebAssembly] Update docs
This is an reland of rL343155 which got reverted because
of a sphinx failure on the buildbot.

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

llvm-svn: 347830
2018-11-29 02:55:25 +00:00
George Rimar
a1b3ddbfec [ELF] - Implement -z nodefaultlib
This is https://bugs.llvm.org//show_bug.cgi?id=38978

Spec says that:
"Objects may be built with the -z nodefaultlib option to
suppress any search of the default locations at runtime.
Use of this option implies that all the dependencies of an
object can be located using its runpaths.
Without this option, which is the most common case, no
matter how you augment the runtime linker's library
search path, its last element is always /usr/lib for 32-bit
objects and /usr/lib/64 for 64-bit objects."

The patch implements this option.

Differential revision: https://reviews.llvm.org/D54577

llvm-svn: 347647
2018-11-27 09:48:17 +00:00
George Rimar
5f8fc76b4e [LLD][ELF] - Fix mistype. NFC.
llvm-svn: 347485
2018-11-23 07:59:28 +00:00
Sam Clegg
bfb75348e2 [WebAssembly] Initial support for shared objects (-shared)
Based on the initial spec proposal:
https://github.com/WebAssembly/tool-conventions/blob/master/DynamicLinking.md

The llvm/codegen side of this is still missing but I believe this change is
still worth landing as an incremental step

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

llvm-svn: 346918
2018-11-15 00:37:21 +00:00
Rui Ueyama
c2921f002e Add an entry to the release notes.
llvm-svn: 344062
2018-10-09 17:53:33 +00:00
Martin Storsjo
db9148d21d [docs] Mention some notable feature in the release notes
Differential Revision: https://reviews.llvm.org/D52908

llvm-svn: 343878
2018-10-05 19:43:20 +00:00
Ed Maste
bf378b808a ReleaseNotes: remove superfluous 's' in 'can promotes'
llvm-svn: 343820
2018-10-04 21:37:32 +00:00
Ali Tamur
63830b2794 Introduce a flag to warn when ifunc symbols are used with text relocations.
Summary:
This patch adds a new flag, --warn-ifunc-textrel, to work around a glibc bug. When a code with ifunc symbols is used to produce an object file with text relocations, lld always succeeds. However, if that object file is linked using an old version of glibc, the resultant binary just crashes with segmentation fault when it is run (The bug is going to be corrected as of glibc 2.19).

Since there is no way to tell beforehand what library the object file will be linked against in the future, there does not seem to be a fool-proof way for lld to give an error only in cases where the binary will crash. So, with this change (dated 2018-09-25), lld starts to give a warning, contingent on a new command line flag that does not have a gnu counter part. The default value for --warn-ifunc-textrel is false, so lld behaviour will not change unless the user explicitly asks lld to give a warning. Users that link with a glibc library with version 2.19 or newer, or does not use ifunc symbols, or does not generate object files with text relocations do not need to take any action. Other users may consider to start passing warn-ifunc-textrel to lld to get early warnings.

Reviewers: ruiu, espindola

Reviewed By: ruiu

Subscribers: grimar, MaskRay, markj, emaste, arichardson, llvm-commits

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

llvm-svn: 343628
2018-10-02 20:30:22 +00:00
Rui Ueyama
1e591d807b Add an explanation about cross linking.
Differential Revision: https://reviews.llvm.org/D52567

llvm-svn: 343495
2018-10-01 16:41:58 +00:00
James Henderson
194a4eb8f7 Fix typo in LLD man page
llvm-svn: 343449
2018-10-01 09:57:20 +00:00
Sam Clegg
bd37e09355 Revert "[WebAssembly] Update docs"
This change reverts rL343155.  It broke the builtbot, even though
it works for me locally:
http://lab.llvm.org:8011/builders/lld-sphinx-docs/builds/26336

Must be a sphinx version issue I guess.

llvm-svn: 343156
2018-09-27 00:42:49 +00:00
Sam Clegg
77ab7c1b30 [WebAssembly] Update docs
Differential Revision: https://reviews.llvm.org/D52048

llvm-svn: 343155
2018-09-27 00:22:24 +00:00
Rui Ueyama
378a028d91 Update a --help message and add -execute-only to the man page.
llvm-svn: 343032
2018-09-25 21:39:08 +00:00
George Rimar
b5a6538b07 [ELF] - Add -z global option to manual.
This was requested during review of D49374,
but for some unknown reason was not in the final commit.

llvm-svn: 342954
2018-09-25 09:32:31 +00:00
Ed Maste
c8ec7a9e1e Correct RISC-V link in release notes
llvm-svn: 342887
2018-09-24 14:47:56 +00:00
Rui Ueyama
c41985a50e Update release notes.
llvm-svn: 342754
2018-09-21 17:48:45 +00:00
Rui Ueyama
a3d0f40964 Update release notes.
llvm-svn: 342748
2018-09-21 17:13:55 +00:00
Ed Maste
c0b474f67a lld: add -z interpose support
-z interpose sets the DF_1_INTERPOSE flag, marking the object as an
interposer.

Via FreeBSD PR 230604, linking Valgrind with lld failed.

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

llvm-svn: 342239
2018-09-14 14:25:37 +00:00
Hans Wennborg
8ec9b16f27 ReleaseNotes: update links to use https
llvm-svn: 341788
2018-09-10 08:52:31 +00:00
Fangrui Song
3a84a093f2 [docs] Add --print-icf-sections to ld.lld.1
llvm-svn: 340253
2018-08-21 07:35:23 +00:00
Hans Wennborg
5f3be212b1 Update docs version and clear release notes after 8.0.0 version bump
llvm-svn: 338558
2018-08-01 14:07:20 +00:00
Hans Wennborg
1cc3f51b04 windows_support.rst: Add links for downloading
llvm-svn: 338363
2018-07-31 12:02:03 +00:00
Hans Wennborg
c7792a6cc7 index.rst: pe/coff does support pdbs now
llvm-svn: 338362
2018-07-31 12:00:26 +00:00
Fangrui Song
f35ff042f4 [docs] Sort ld.lld.1 options
Reviewers: ruiu

Subscribers: llvm-commits

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

llvm-svn: 338326
2018-07-30 23:07:44 +00:00
Fangrui Song
bac187bece [docs] Add missing options to ld.lld.1
Differential Revision: https://reviews.llvm.org/D49938

llvm-svn: 338320
2018-07-30 22:31:00 +00:00
Fangrui Song
05779bfcc8 [docs] Update ld.lld.1
llvm-svn: 338275
2018-07-30 17:36:38 +00:00
Peter Collingbourne
a327a4c34e ELF: Implement --icf=safe using address-significance tables.
Differential Revision: https://reviews.llvm.org/D48146

llvm-svn: 337429
2018-07-18 22:49:31 +00:00