-
Notifications
You must be signed in to change notification settings - Fork 10.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[WebAssembly] Add linker options to control feature checking
Summary: Adds --check-features and --no-check-features. The default for now is to enable the checking, but this might change in the future. Also adds --features=foo,bar for precisely controlling the features used in the output binary. Depends on D59173. Reviewers: sbc100, aheejin Subscribers: dschuff, jgravelle-google, sunfish, jdoerfert, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D59274 llvm-svn: 356805
- Loading branch information
Showing
8 changed files
with
200 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# RUN: yaml2obj %s -o %t1.o | ||
|
||
# RUN: wasm-ld --no-entry -o - %t1.o | obj2yaml | FileCheck %s --check-prefix EMPTY | ||
|
||
# RUN: wasm-ld --no-entry --features= -o - %t1.o | obj2yaml | FileCheck %s --check-prefix EMPTY | ||
|
||
# RUN: wasm-ld --no-entry --features=foo,bar,baz -o - %t1.o | obj2yaml | FileCheck %s --check-prefix SPECIFIED | ||
|
||
--- !WASM | ||
FileHeader: | ||
Version: 0x00000001 | ||
Sections: | ||
- Type: CUSTOM | ||
Name: linking | ||
Version: 2 | ||
- Type: CUSTOM | ||
Name: target_features | ||
Features: [ ] | ||
... | ||
|
||
# section is not emitted if it would be empty | ||
# EMPTY-NOT: target_features | ||
|
||
# SPECIFIED: - Type: CUSTOM | ||
# SPECIFIED-NEXT: Name: target_features | ||
# SPECIFIED-NEXT: Features: | ||
# SPECIFIED-NEXT: - Prefix: USED | ||
# SPECIFIED-NEXT: Name: bar | ||
# SPECIFIED-NEXT: - Prefix: USED | ||
# SPECIFIED-NEXT: Name: baz | ||
# SPECIFIED-NEXT: - Prefix: USED | ||
# SPECIFIED-NEXT: Name: foo | ||
# SPECIFIED-NEXT: ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters