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

L4Re Target: Add the needed Libraries and locate them #44011

Merged
merged 2 commits into from
Aug 24, 2017

Conversation

TobiasSchaffner
Copy link

@TobiasSchaffner TobiasSchaffner commented Aug 21, 2017

Add the libraries and objects that have to be linked to a get working L4Re Binary using pre- and post-link-args. Additionaly some ld commands had to be passed.

  • L4Re libraries and objects will be located by an environment variable.
  • gcc libraries and objects will be located using a gcc call.

GCC is mandatory for this target, that might need documentation somewhere. As soon as something mandatory cannot be found, the compiler will panic. This is intended, because the functions involved don't allow the usage of a Result type. libgcc_eh is now passed using -l and crtbeginT.o and crtend.o are now located using gcc -print-filename.

@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 @arielb1 (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.

@TobiasSchaffner
Copy link
Author

TobiasSchaffner commented Aug 21, 2017

As we want the build to fail if the L4RE_LIBDIR environment variable is not set, this behavior is intended.

[00:59:28] 	thread 'target::test_json_encode_decode::x86_64_unknown_l4re_uclibc' panicked at 'Unable to find L4Re library directory: L4RE_LIBDIR not set.', /checkout/src/libcore/option.rs:819:4
[00:59:28] note: Run with `RUST_BACKTRACE=1` for a backtrace.
[00:59:28] 
[00:59:28] 
[00:59:28] failures:
[00:59:28]     target::test_json_encode_decode::x86_64_unknown_l4re_uclibc
[00:59:28] 
[00:59:28] test result: FAILED. 73 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out
[00:59:28] 
[00:59:28] error: test failed, to rerun pass '--lib'

Can the test be adjustet or the environment variable be set before running the test?

@arielb1
Copy link
Contributor

arielb1 commented Aug 21, 2017

r? @alexcrichton - that's more of his area.

@arielb1 arielb1 added the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Aug 21, 2017
@alexcrichton
Copy link
Member

This seems fine to me, thanks! The CI test can probably fixed in w/e the same way iOS doesn't cause failures today (which can also fail at runtime when calculating the target). I'll leave it up to you whether you'd like to hardcode all these values, I'm not sure if they change much for y'all!

Add the libraries and objects that have to be linked to a get working L4Re
Binary using pre- and post-link-args. Additionaly some ld commands had to
be passed.

* L4Re libraries and objects will be located by an environment variable.
* gcc libraries and objects will be located using a gcc call.

GCC is mandatory for this target, that might need documentation somewhere.
As soon as something mandatory cannot be found, the compiler will panic.
This is intended, because the functions involved don't allow the usage of
a Result type. libgcc_eh is now passed using `-l` and crtbeginT.o and
crtend.o are now located using `gcc -print-filename`.

Co-authored-by: TobiasSchaffner <[email protected]>
@alexcrichton
Copy link
Member

Hm sorry that's not quite what I had in mind, I believe the target function returns a Result, so if the env var isn't defined can it just return an error?

If the environment variable L4RE_LIBDIR ist not set an Error will be
returned wrapped in a result type instead of a panic.
@TobiasSchaffner
Copy link
Author

r? @alexcrichton

@alexcrichton
Copy link
Member

@bors: r+

Thanks!

@bors
Copy link
Contributor

bors commented Aug 23, 2017

📌 Commit c60fc4b has been approved by alexcrichton

@bors
Copy link
Contributor

bors commented Aug 24, 2017

⌛ Testing commit c60fc4b with merge af6298d...

bors added a commit that referenced this pull request Aug 24, 2017
…alexcrichton

L4Re Target: Add the needed Libraries and locate them

Add the libraries and objects that have to be linked to a get working L4Re Binary using pre- and post-link-args. Additionaly some ld commands had to be passed.

* L4Re libraries and objects will be located by an environment variable.
* gcc libraries and objects will be located using a gcc call.

GCC is mandatory for this target, that might need documentation somewhere. As soon as something mandatory cannot be found, the compiler will panic. This is intended, because the functions involved don't allow the usage of a Result type. libgcc_eh is now passed using `-l` and crtbeginT.o and crtend.o are now located using `gcc -print-filename`.
@bors
Copy link
Contributor

bors commented Aug 24, 2017

☀️ Test successful - status-appveyor, status-travis
Approved by: alexcrichton
Pushing af6298d to master...

@bors bors merged commit c60fc4b into rust-lang:master Aug 24, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants