Skip to content
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

Add pie as another relocation-model value #88820

Merged
merged 1 commit into from
Oct 1, 2021

Conversation

hlopko
Copy link
Contributor

@hlopko hlopko commented Sep 10, 2021

@rust-highfive
Copy link
Collaborator

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @wesleywiser (or someone else) soon.

Please see the contribution instructions for more information.

@rust-highfive
Copy link
Collaborator

⚠️ Warning ⚠️

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Sep 10, 2021
@rust-log-analyzer

This comment has been minimized.

@hlopko
Copy link
Contributor Author

hlopko commented Sep 10, 2021

And I discovered a bug already - external functions should not be marked dso_local. I will add a fix and a test.

@hlopko hlopko force-pushed the add_pie_relocation_model branch from 2954c0b to 23dd820 Compare September 10, 2021 16:09
@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@apiraino apiraino added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Sep 13, 2021
@wesleywiser
Copy link
Member

r? @petrochenkov or @tmandry

src/doc/rustc/src/codegen-options/index.md Outdated Show resolved Hide resolved
src/doc/rustc/src/codegen-options/index.md Outdated Show resolved Hide resolved
compiler/rustc_codegen_llvm/src/back/write.rs Outdated Show resolved Hide resolved
compiler/rustc_codegen_llvm/src/context.rs Outdated Show resolved Hide resolved
@petrochenkov petrochenkov removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Sep 22, 2021
@petrochenkov
Copy link
Contributor

Also fn link_output_kind needs to be updated to treat pie in the same way as pic.

@petrochenkov petrochenkov added the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Sep 22, 2021
@rust-log-analyzer

This comment has been minimized.

@petrochenkov
Copy link
Contributor

r=me with commits squashed.

@hlopko
Copy link
Contributor Author

hlopko commented Sep 27, 2021

(ftr, I believe I addressed all the comments, maybe I need to comment so bors continues with the r= command?)

@bjorn3
Copy link
Member

bjorn3 commented Sep 27, 2021

The comments haven't been squashed into a single commit yet. Once that is done someone with review permission will need to tell bors to merge this PR.

@hlopko
Copy link
Contributor Author

hlopko commented Sep 27, 2021

@bjorn3 are you saying that I should squash the commits? Or bors is going to do that?

@bjorn3
Copy link
Member

bjorn3 commented Sep 27, 2021

You need to squash. Bors doesn't.

@hlopko hlopko force-pushed the add_pie_relocation_model branch from ff7d253 to d033e9b Compare September 27, 2021 07:52
@hlopko
Copy link
Contributor Author

hlopko commented Sep 27, 2021

I see, thank you! Done.

@bjorn3
Copy link
Member

bjorn3 commented Sep 27, 2021

@bors r=petrochenkov

@bors
Copy link
Contributor

bors commented Sep 27, 2021

📌 Commit d033e9b2c8d0eff1a49f4283f5c623c9503cdf10 has been approved by petrochenkov

@hlopko
Copy link
Contributor Author

hlopko commented Sep 28, 2021

@bors r=petrochenkov

@bors
Copy link
Contributor

bors commented Sep 28, 2021

@hlopko: 🔑 Insufficient privileges: Not in reviewers

@hlopko
Copy link
Contributor Author

hlopko commented Sep 28, 2021

Had to try :)

@petrochenkov
Copy link
Contributor

@bors r+

@bors
Copy link
Contributor

bors commented Sep 28, 2021

📌 Commit dea3ee1 has been approved by petrochenkov

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Sep 28, 2021
Manishearth added a commit to Manishearth/rust that referenced this pull request Sep 30, 2021
…petrochenkov

Add `pie` as another `relocation-model` value

MCP: rust-lang/compiler-team#461
Manishearth added a commit to Manishearth/rust that referenced this pull request Sep 30, 2021
…petrochenkov

Add `pie` as another `relocation-model` value

MCP: rust-lang/compiler-team#461
@Manishearth
Copy link
Member

Failed in #89411 (comment) on x86_64-apple

@bors r-

---- [codegen] codegen/pie-relocation-model.rs stdout ----

error: verification with 'FileCheck' failed
status: exit status: 1
command: "/Users/runner/work/rust/rust/build/x86_64-apple-darwin/llvm/build/bin/FileCheck" "--input-file" "/Users/runner/work/rust/rust/build/x86_64-apple-darwin/test/codegen/pie-relocation-model/pie-relocation-model.ll" "/Users/runner/work/rust/rust/src/test/codegen/pie-relocation-model.rs" "--allow-unused-prefixes" "--check-prefixes" "CHECK,NONMSVC"
stdout:
------------------------------------------

------------------------------------------
stderr:
------------------------------------------
/Users/runner/work/rust/rust/src/test/codegen/pie-relocation-model.rs:7:11: error: CHECK: expected string not found in input
// CHECK: define dso_local i8 @call_foreign_fn()
          ^
/Users/runner/work/rust/rust/build/x86_64-apple-darwin/test/codegen/pie-relocation-model/pie-relocation-model.ll:1:1: note: scanning from here
; ModuleID = 'pie_relocation_model.8d7ed54a-cgu.0'
^
/Users/runner/work/rust/rust/build/x86_64-apple-darwin/test/codegen/pie-relocation-model/pie-relocation-model.ll:9:10: note: possible intended match here
 %0 = tail call zeroext i8 @foreign_fn()
         ^

Input file: /Users/runner/work/rust/rust/build/x86_64-apple-darwin/test/codegen/pie-relocation-model/pie-relocation-model.ll
Check file: /Users/runner/work/rust/rust/src/test/codegen/pie-relocation-model.rs

-dump-input=help explains the following input dump.

Input was:
<<<<<<
           1: ; ModuleID = 'pie_relocation_model.8d7ed54a-cgu.0' 
check:7'0     X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ error: no match found
           2: source_filename = "pie_relocation_model.8d7ed54a-cgu.0" 
check:7'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           3: target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" 
check:7'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           4: target triple = "x86_64-apple-macosx10.8.0" 
check:7'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           5:  
check:7'0     ~
           6: ; Function Attrs: uwtable 
check:7'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~
           7: define i8 @call_foreign_fn() unnamed_addr #0 { 
check:7'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           8: start: 
check:7'0     ~~~~~~~
           9:  %0 = tail call zeroext i8 @foreign_fn() 
check:7'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
check:7'1              ?                                possible intended match
          10:  ret i8 %0 
check:7'0     ~~~~~~~~~~~
          11: } 
check:7'0     ~~
          12:  
check:7'0     ~
          13: ; Function Attrs: uwtable 
check:7'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~
          14: declare zeroext i8 @foreign_fn() unnamed_addr #0 
check:7'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           .
           .
           .
>>>>>>

------------------------------------------



failures:
    [codegen] codegen/pie-relocation-model.rs

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Oct 1, 2021
@hlopko hlopko force-pushed the add_pie_relocation_model branch from dea3ee1 to 198d907 Compare October 1, 2021 06:06
@hlopko
Copy link
Contributor Author

hlopko commented Oct 1, 2021

Restricted the codegen test only to x86_64 linux, the test doesn't make sense on mac as functions are (almost?) never marked dso_local there. And I don't know of PIE makes any sense for Windows.

@petrochenkov
Copy link
Contributor

@bors r+

@bors
Copy link
Contributor

bors commented Oct 1, 2021

📌 Commit 198d907 has been approved by petrochenkov

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Oct 1, 2021
fee1-dead added a commit to fee1-dead-contrib/rust that referenced this pull request Oct 1, 2021
…petrochenkov

Add `pie` as another `relocation-model` value

MCP: rust-lang/compiler-team#461
bors added a commit to rust-lang-ci/rust that referenced this pull request Oct 1, 2021
…arth

Rollup of 6 pull requests

Successful merges:

 - rust-lang#87868 (Added -Z randomize-layout flag)
 - rust-lang#88820 (Add `pie` as another `relocation-model` value)
 - rust-lang#89029 (feat(rustc_parse): recover from pre-RFC-2000 const generics syntax)
 - rust-lang#89322 (Reapply "Remove optimization_fuel_crate from Session")
 - rust-lang#89340 (Improve error message for `printf`-style format strings)
 - rust-lang#89415 (Correct caller/callsite confusion in inliner message)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 6f1e930 into rust-lang:master Oct 1, 2021
@rustbot rustbot added this to the 1.57.0 milestone Oct 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants