Skip to content

Rpath is not supported on AIX #109525

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 1 commit into from
Jun 4, 2023
Merged

Conversation

bzEq
Copy link
Contributor

@bzEq bzEq commented Mar 23, 2023

Both -Wl,-rapth and -Wl,-z,origin are not supported on AIX.

AIX linker is documented in https://www.ibm.com/docs/en/aix/7.1?topic=l-ld-command.

@rustbot
Copy link
Collaborator

rustbot commented Mar 23, 2023

r? @albertlarsan68

(rustbot has picked a reviewer for you, use r? to override)

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) labels Mar 23, 2023
@albertlarsan68
Copy link
Member

Can you give an explanation/rationale please?
@rustbot author

@rustbot rustbot 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-review Status: Awaiting review from the assignee but also interested parties. labels Mar 23, 2023
@bzEq
Copy link
Contributor Author

bzEq commented Mar 24, 2023

Hi @albertlarsan68 , are you asking me or the rustbot?

@albertlarsan68
Copy link
Member

It was you.
Thanks!

@bzEq
Copy link
Contributor Author

bzEq commented Mar 24, 2023

Added description for this PR at the first comment.

@albertlarsan68
Copy link
Member

I'll leave this to someone else, that knows more about this.
r? @Mark-Simulacrum

@@ -1554,7 +1554,7 @@ impl<'a> Builder<'a> {
// flesh out rpath support more fully in the future.
rustflags.arg("-Zosx-rpath-install-name");
Some("-Wl,-rpath,@loader_path/../lib")
} else if !target.contains("windows") {
} else if !target.contains("windows") && !target.contains("aix") {
Copy link
Member

@bjorn3 bjorn3 Mar 25, 2023

Choose a reason for hiding this comment

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

You will have to put librustc_driver.so and libstd.so in bin/ instead of lib/ for AIX too then, right? Or does AIX not look for dynamic libraries in the same directory as the executable?

Copy link
Contributor Author

@bzEq bzEq Mar 28, 2023

Choose a reason for hiding this comment

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

does AIX not look for dynamic libraries in the same directory as the executable?

It doesn't.

It's very unfortunate that AIX doesn't support rpath and $ORIGIN directive.
We are currently using launch scripts to wrap executables. To be more specific, in tree

.
├── bin
│   ├── .cargo
│   ├── cargo
│   ├── .rustc
│   └── rustc
└── lib
    ├── librustc_driver.a
    └── libstd.a

bin/cargo and bin/rustc are wrappers, where we implement something like

EXEC_DIR=`/usr/bin/dirname $0`
EXEC=`/usr/bin/basename $0`
BASE=`/usr/lib/instl/realpath "${EXEC_DIR}/../"`
export LIBPATH="${BASE}/lib":"${LIBPATH:-/usr/lib:/lib}"
exec "${EXEC_DIR}/.${EXEC}" "$@"

I guess using rustup to generate rustc and cargo can also mitigate this issue.

@bzEq bzEq requested a review from bjorn3 March 28, 2023 11:13
@JohnCSimon
Copy link
Member

@bzEq
Triage:
FYI: when a PR is ready for review, send a message containing
@rustbot ready to switch to S-waiting-on-review so the PR is in the reviewer's backlog, otherwise it's still in the "Waiting on author" state.

@rustbot ready

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels May 28, 2023
@Mark-Simulacrum
Copy link
Member

@bors r+

@bors
Copy link
Collaborator

bors commented Jun 3, 2023

📌 Commit 91471c8 has been approved by Mark-Simulacrum

It is now in the queue for this repository.

@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 3, 2023
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Jun 4, 2023
…k-Simulacrum

Rpath is not supported on AIX

Both `-Wl,-rapth` and `-Wl,-z,origin` are not supported on AIX.

AIX linker is documented in https://www.ibm.com/docs/en/aix/7.1?topic=l-ld-command.
@bors
Copy link
Collaborator

bors commented Jun 4, 2023

⌛ Testing commit 91471c8 with merge a28e125...

@bors
Copy link
Collaborator

bors commented Jun 4, 2023

☀️ Test successful - checks-actions
Approved by: Mark-Simulacrum
Pushing a28e125 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Jun 4, 2023
@bors bors merged commit a28e125 into rust-lang:master Jun 4, 2023
@rustbot rustbot added this to the 1.72.0 milestone Jun 4, 2023
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (a28e125): comparison URL.

Overall result: no relevant changes - no action needed

@rustbot label: -perf-regression

Instruction count

This benchmark run did not return any relevant results for this metric.

Max RSS (memory usage)

This benchmark run did not return any relevant results for this metric.

Cycles

This benchmark run did not return any relevant results for this metric.

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 645.202s -> 645.973s (0.12%)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants