Skip to content

Commit 9924cf6

Browse files
committed
chore: set linker soname
Due to android's ndk dllopen fail, a linker option `soname` has to be set, wihle building out-of-tree, i.e. `-Wl,-soname,<lib_name.so>` Change-Id: I7b2340d3d25e67525ec7fd52f72479cd021024b5 Signed-off-by: Sebastian Birunt <[email protected]>
1 parent d1addf5 commit 9924cf6

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

core/androidninja_backend.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,12 @@ func (g *androidNinjaGenerator) getSharedLibFlags(m BackendCommonLibraryInterfac
238238
ldlibs = append(ldlibs, tc.GetLinker().SetRpath(rpaths))
239239
}
240240
}
241+
242+
// https://stackoverflow.com/questions/47279824/android-ndk-dlopen-failed/48291044#48291044
243+
if l, ok := m.(BackendCommonSharedLibraryInterface); ok {
244+
ldlibs = append(ldlibs, "-Wl,-soname,"+l.getRealName())
245+
}
246+
241247
return
242248
}
243249

0 commit comments

Comments
 (0)