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

Fortanix SGX target libunwind build process changes #72937

Merged
merged 3 commits into from
Jun 27, 2020

Conversation

AdrianCX
Copy link
Contributor

@AdrianCX AdrianCX commented Jun 3, 2020

Ticket: fortanix/rust-sgx#174
LLVM related changes (merged): rust-lang/llvm-project#57

Description: libunwind changes needed to run code in sgx environment via rust-sgx.

Target that uses this in rust: x86_64-fortanix-unknown-sgx.

Without this change, rust std for this toolchain is forced to use a precompiled library loaded via environment variable.

With this change we act the same as musl target.

@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 @nikomatsakis (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@rust-highfive
Copy link
Collaborator

⚠️ Warning ⚠️

  • These commits modify submodules.

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jun 3, 2020
bors added a commit to rust-lang-ci/rust that referenced this pull request Jun 7, 2020
Update LLVM submodule to include lld NOLOAD fix

> Rust nightly 2020-05-22 and later ships lld with a regression related to linker scripts: NOLOAD sections incorrectly generate sections filled with 0s. This causes gdb and other elf loaders to write to reserved or otherwise invalid addresses (gdb also seems confused by the resulting ELF files and spits out a warning about the sections). This is particularly a problem for embedded rust projects that use lld by default and have affected linker scripts (cortex-m-rt based projects for instance).

rust-lang/llvm-project#64

Note that this also pulls in llvm changes from rust-lang#72937
@bors
Copy link
Contributor

bors commented Jun 7, 2020

☔ The latest upstream changes (presumably #73072) made this pull request unmergeable. Please resolve the merge conflicts.

@jethrogb
Copy link
Contributor

jethrogb commented Jun 8, 2020

Let's wait with this until after #72655 is merged. I don't think you can remove build-x86_64-fortanix-unknown-sgx-toolchain.sh entirely then.

@nikomatsakis nikomatsakis added S-blocked Status: Blocked on something else such as an RFC or other implementation work. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jun 8, 2020
@nikomatsakis
Copy link
Contributor

Blocked on #72655

@bors
Copy link
Contributor

bors commented Jun 9, 2020

☔ The latest upstream changes (presumably #72655) made this pull request unmergeable. Please resolve the merge conflicts.

@AdrianCX AdrianCX force-pushed the master branch 2 times, most recently from e8183ce to 411dfc7 Compare June 23, 2020 17:47
@jethrogb
Copy link
Contributor

@rustbot modify labels: -S-blocked +S-waiting-on-review

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-blocked Status: Blocked on something else such as an RFC or other implementation work. labels Jun 25, 2020
@@ -24,39 +24,4 @@ install_prereq() {
clang-11
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should also be able to delete these lines:

url="https://github.com/fortanix/llvm-project/archive/${1}.tar.gz"
repo_name="llvm-project"

and

if [ -z "$1" ]; then
    echo "Usage: ${0} <commit_id>"
    exit -1
fi

(and make the corresponding change in the Dockerfile)

// libunwind requires support for rwlock and printing to stderr,
// which is provided by std for this target.
if target == "x86_64-fortanix-unknown-sgx" {
let src_path_env = "X86_FORTANIX_SGX_LIBS";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we issue a warning for some time that this env var is no longer used?

Copy link
Contributor

@jethrogb jethrogb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@@ -73,7 +73,7 @@ COPY dist-various-2/x86_64-fortanix-unknown-sgx-clang-wrap.sh /usr/bin/x86_64-fo
RUN ln -s /usr/bin/x86_64-fortanix-unknown-sgx-clang-11 /usr/bin/x86_64-fortanix-unknown-sgx-clang++-11
# We pass the commit id of the port of LLVM's libunwind to the build script.
# Any update to the commit id here, should cause the container image to be re-built from this point on.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment is now obsolete

@nikomatsakis
Copy link
Contributor

@bors r+

@bors
Copy link
Contributor

bors commented Jun 26, 2020

📌 Commit db6fa2f has been approved by nikomatsakis

@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-review Status: Awaiting review from the assignee but also interested parties. labels Jun 26, 2020
bors added a commit to rust-lang-ci/rust that referenced this pull request Jun 27, 2020
…arth

Rollup of 12 pull requests

Successful merges:

 - rust-lang#72771 (Warn if linking to a private item)
 - rust-lang#72937 (Fortanix SGX target libunwind build process changes)
 - rust-lang#73485 (Perform obligation deduplication to avoid buggy `ExistentialMismatch`)
 - rust-lang#73529 (Add liballoc impl SpecFromElem for i8)
 - rust-lang#73579 (add missing doc links)
 - rust-lang#73627 (Shortcuts for min/max on double-ended BTreeMap/BTreeSet iterators)
 - rust-lang#73691 (Bootstrap: detect Windows based on sys.platform)
 - rust-lang#73694 (Document the Self keyword)
 - rust-lang#73718 (Document the super keyword)
 - rust-lang#73728 (Document some invariants correctly/more)
 - rust-lang#73738 (Remove irrelevant comment)
 - rust-lang#73765 (Remove blank line)

Failed merges:

r? @ghost
@bors bors merged commit 38cbf15 into rust-lang:master Jun 27, 2020
ehuss added a commit to ehuss/rust that referenced this pull request Jun 23, 2022
The code using `fetch_github_commit_archive` was removed in rust-lang#72937.
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants