From: Bruno Haible Date: Mon, 18 Sep 2023 10:47:08 +0000 (+0200) Subject: Fix shared library support on Android. X-Git-Tag: v2.5.0~54 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=47c71f61df9ace4956cc943f291480315174726b;p=thirdparty%2Flibtool.git Fix shared library support on Android. This patch fixes two problems: 1) A libtool library created with the -release option and no -version-info option was, when built with --enable-shared, installed without the symlink libNAME.so -> libNAME-RELEASE.so. This led to subsequent failures during "make install" of shared libraries that depend on it. 2) Executables were created without a RUNPATH property. These executables then did not find their shared libraries when run. * m4/libtool.m4: On Android, fix library_names_spec and hardcode_libdir_flag_spec. --- diff --git a/m4/libtool.m4 b/m4/libtool.m4 index 695ccac4d..20d2c3ab3 100644 --- a/m4/libtool.m4 +++ b/m4/libtool.m4 @@ -2839,7 +2839,7 @@ linux*android*) version_type=none # Android doesn't support versioned libraries. need_lib_prefix=no need_version=no - library_names_spec='$libname$release$shared_ext' + library_names_spec='$libname$release$shared_ext $libname$shared_ext' soname_spec='$libname$release$shared_ext' finish_cmds= shlibpath_var=LD_LIBRARY_PATH @@ -2851,8 +2851,9 @@ linux*android*) hardcode_into_libs=yes dynamic_linker='Android linker' - # Don't embed -rpath directories since the linker doesn't support them. - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + # -rpath works at least for libraries that are not overridden by + # libraries installed in system locations. + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' ;; # This must be glibc/ELF.