-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[lld-macho] Save all thin archive members in repro tarball #97169
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
059c082
[lld-macho] Fix unchecked Error crash for thin archive missing child
BertalanD 637e66f
Merge branch 'main' into thin-archive-missing
BertalanD dc53f82
Add test
BertalanD 8e29cd6
Add explanation
BertalanD 2216582
Fix Windows CI
BertalanD 6f6610f
Merge branch 'main' into thin-archive-missing
BertalanD 91e56d8
Merge branch 'main' into thin-archive-missing
BertalanD 02b3fae
Add warning and mechanism to suppress it
BertalanD 3ecb35c
Ensure that unreferenced members get included
BertalanD e51d1dc
Merge branch 'main' into thin-archive-missing
BertalanD 851013e
fix comment + consistently warn instead of erroring
BertalanD c17513d
fix formatting
BertalanD File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,25 @@ | ||
# REQUIRES: x86 | ||
|
||
## For a long time, LLD only included those members from thin archives that were actually used | ||
## during linking. However, we need to iterate over all members for -ObjC, check that we don't | ||
## crash when we encounter a missing member. | ||
|
||
# RUN: rm -rf %t; mkdir %t | ||
# RUN: sed s/SYM/_main/ %s | llvm-mc -filetype=obj -triple=x86_64-apple-macos -o %t/main.o | ||
# RUN: sed s/SYM/_unused/ %s | llvm-mc -filetype=obj -triple=x86_64-apple-macos -o %t/unused.o | ||
|
||
# RUN: cd %t; llvm-ar rcsT unused.a unused.o; rm unused.o | ||
## FIXME: Absolute paths don't end up relativized in the repro file. | ||
|
||
# RUN: %no-fatal-warnings-lld %t/main.o %t/unused.a -ObjC -o /dev/null 2>&1 \ | ||
# RUN: | FileCheck %s --check-prefix=WARN | ||
|
||
# RUN: %lld %t/main.o %t/unused.a -ObjC --no-warn-thin-archive-missing-members -o /dev/null \ | ||
# RUN: | FileCheck %s --implicit-check-not 'warning' --allow-empty | ||
|
||
# WARN: ld64.lld: warning: {{.*}}unused.a: -ObjC failed to open archive member: 'unused.o' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Made some adjustment to hopefully make the test more conventional 2d756d9 |
||
|
||
.text | ||
.globl SYM | ||
SYM: | ||
ret |
This file contains hidden or 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 |
---|---|---|
@@ -1,20 +1,31 @@ | ||
# REQUIRES: x86 | ||
|
||
# RUN: rm -rf %t.dir | ||
# RUN: mkdir -p %t.dir | ||
# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-macos %s -o %t.dir/foo.o | ||
# RUN: rm -rf %t.dir; split-file %s %t.dir | ||
|
||
# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-macos %t.dir/foo.s -o %t.dir/foo.o | ||
# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-macos %t.dir/unused.s -o %t.dir/unused.o | ||
# RUN: cd %t.dir | ||
# RUN: llvm-ar rcsT foo.a foo.o | ||
# RUN: llvm-ar rcsT foo.a foo.o unused.o | ||
|
||
# RUN: %lld foo.a -o /dev/null --reproduce repro.tar | ||
# RUN: tar tf repro.tar | FileCheck -DPATH='repro/%:t.dir' %s | ||
|
||
# RUN: %lld -all_load foo.a -o /dev/null --reproduce repro2.tar | ||
# RUN: tar tf repro2.tar | FileCheck -DPATH='repro2/%:t.dir' %s | ||
|
||
# RUN: %lld -ObjC foo.a -o /dev/null --reproduce repro3.tar | ||
# RUN: tar tf repro3.tar | FileCheck -DPATH='repro3/%:t.dir' %s | ||
|
||
# CHECK-DAG: [[PATH]]/foo.a | ||
# CHECK-DAG: [[PATH]]/foo.o | ||
# CHECK-DAG: [[PATH]]/unused.o | ||
|
||
#--- foo.s | ||
.globl _main | ||
_main: | ||
nop | ||
|
||
#--- unused.s | ||
.globl _unused | ||
_unused: | ||
nop |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is #97845