Skip to content

Commit 5192810

Browse files
authored
Rollup merge of #132750 - daltenty:daltenty/libs, r=jieyouxu
[AIX] handle libunwind native_libs AIX should follow a similar path here to other libunwind platforms, with regards to system vs in-tree libunwind and the native lib search directories. Having the right native lib search directories here is also required to get the correct default library search paths, due to some quirks of the AIX linker.
2 parents dd99f11 + a9cb2d6 commit 5192810

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

compiler/rustc_metadata/src/native_libs.rs

+4
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,13 @@ pub fn walk_native_lib_search_dirs<R>(
5454
// The targets here should be in sync with `copy_third_party_objects` in bootstrap.
5555
// FIXME: implement `-Clink-self-contained=+/-unwind,+/-sanitizers`, move the shipped libunwind
5656
// and sanitizers to self-contained directory, and stop adding this search path.
57+
// FIXME: On AIX this also has the side-effect of making the list of library search paths
58+
// non-empty, which is needed or the linker may decide to record the LIBPATH env, if
59+
// defined, as the search path instead of appending the default search paths.
5760
if sess.target.vendor == "fortanix"
5861
|| sess.target.os == "linux"
5962
|| sess.target.os == "fuchsia"
63+
|| sess.target.is_like_aix
6064
|| sess.target.is_like_osx && !sess.opts.unstable_opts.sanitizer.is_empty()
6165
{
6266
f(&sess.target_tlib_path.dir, false)?;

src/bootstrap/src/core/build_steps/compile.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ fn copy_third_party_objects(
330330

331331
if target == "x86_64-fortanix-unknown-sgx"
332332
|| builder.config.llvm_libunwind(target) == LlvmLibunwind::InTree
333-
&& (target.contains("linux") || target.contains("fuchsia"))
333+
&& (target.contains("linux") || target.contains("fuchsia") || target.contains("aix"))
334334
{
335335
let libunwind_path =
336336
copy_llvm_libunwind(builder, target, &builder.sysroot_target_libdir(*compiler, target));

0 commit comments

Comments
 (0)