From 41e2a53c0007540cbb54e1f7b2980f0f886f8749 Mon Sep 17 00:00:00 2001 From: Amanieu d'Antras Date: Tue, 30 Nov 2021 02:42:35 +0000 Subject: [PATCH] Android: -ldl must appear after -lgcc when linking --- library/unwind/build.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/library/unwind/build.rs b/library/unwind/build.rs index 1d0b4a59a287b..a3f5224151d94 100644 --- a/library/unwind/build.rs +++ b/library/unwind/build.rs @@ -17,6 +17,9 @@ fn main() { } else { println!("cargo:rustc-link-lib=gcc"); } + + // Android's unwinding library depends on dl_iterate_phdr in `libdl`. + println!("cargo:rustc-link-lib=dl"); } else if target.contains("freebsd") { println!("cargo:rustc-link-lib=gcc_s"); } else if target.contains("netbsd") {