Skip to content
Snippets Groups Projects
0001-Fix-linking-with-Android-NDK-linker.patch 872 B
Newer Older
From 18348bd65ce67bcd6f85e309f126792a96732943 Mon Sep 17 00:00:00 2001
From: Nirbheek Chauhan <nirbheek@centricular.com>
Date: Thu, 1 Sep 2022 21:33:29 +0530
Subject: [PATCH] Fix linking with Android NDK linker

Android ld.gold cannot handle -Wl, and it's incorrect anyway since all
the other linker arguments passed by cargo do not have a -Wl prefix.
---
 src/target.rs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/target.rs b/src/target.rs
index 0cc2018..4c9d369 100644
--- a/src/target.rs
+++ b/src/target.rs
@@ -70,7 +70,7 @@ impl Target {
         let env = &self.env;
 
         if os == "android" {
-            lines.push(format!("-Wl,-soname,lib{lib_name}.so"));
+            lines.push(format!("-soname,lib{lib_name}.so"));
         } else if os == "linux"
             || os == "freebsd"
             || os == "dragonfly"
-- 
2.39.1