-
Notifications
You must be signed in to change notification settings - Fork 13.3k
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
Rpath is not supported on AIX #109525
Conversation
(rustbot has picked a reviewer for you, use r? to override) |
Can you give an explanation/rationale please? |
Hi @albertlarsan68 , are you asking me or the rustbot? |
It was you. |
Added description for this PR at the first comment. |
I'll leave this to someone else, that knows more about this. |
@@ -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") { |
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.
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?
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.
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.
@bors r+ |
…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.
☀️ Test successful - checks-actions |
Finished benchmarking commit (a28e125): comparison URL. Overall result: no relevant changes - no action needed@rustbot label: -perf-regression Instruction countThis 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. CyclesThis benchmark run did not return any relevant results for this metric. Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 645.202s -> 645.973s (0.12%) |
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.