Add ldconfig -soft to process the soft float abi libraries and put it

into startup scripts for armv6. It acts much like ldconfig -32 does.
This commit is contained in:
Warner Losh 2016-01-18 21:40:18 +00:00
parent 410df9fd8d
commit 4153c21113
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=294295
3 changed files with 37 additions and 1 deletions

View File

@ -619,6 +619,9 @@ ldconfig_paths="/usr/lib/compat /usr/local/lib /usr/local/lib/compat/pkg"
# shared library search paths
ldconfig32_paths="/usr/lib32 /usr/lib32/compat"
# 32-bit compatibility shared library search paths
ldconfigsoft_paths="/usr/libsoft /usr/libsoft/compat /usr/local/libsoft"
# soft float compatibility shared library search paths
# Note: temporarily with extra stuff for transition
ldconfig_paths_aout="/usr/lib/compat/aout /usr/local/lib/aout"
# a.out shared library search paths
ldconfig_local_dirs="/usr/local/libdata/ldconfig"
@ -626,6 +629,9 @@ ldconfig_local_dirs="/usr/local/libdata/ldconfig"
ldconfig_local32_dirs="/usr/local/libdata/ldconfig32"
# Local directories with 32-bit compatibility ldconfig
# configuration files.
ldconfig_localsoft_dirs="/usr/local/libdata/ldconfigsoft"
# Local directories with soft float compatibility ldconfig
# configuration files.
kern_securelevel_enable="NO" # kernel security level (see security(7))
kern_securelevel="-1" # range: -1..3 ; `-1' is the most insecure
# Note that setting securelevel to 0 will result

View File

@ -61,6 +61,28 @@ ldconfig_start()
;;
esac
case `sysctl -n hw.machine_arch` in
armv6)
for i in ${ldconfig_localsoft_dirs}; do
if [ -d "${i}" ]; then
_files=`find ${i} -type f`
if [ -n "${_files}" ]; then
ldconfigsoft_paths="${ldconfigsoft_paths} `cat ${_files} | sort -u`"
fi
fi
done
_LDC=""
for i in ${ldconfigsoft_paths}; do
if [ -r "${i}" ]; then
_LDC="${_LDC} ${i}"
fi
done
check_startmsgs &&
echo 'Soft Float compatibility ldconfig path:' ${_LDC}
${ldconfig} -soft -m ${_ins} ${_LDC}
;;
esac
# Legacy aout support for i386 only
case `sysctl -n hw.machine_arch` in
i386)

View File

@ -64,6 +64,7 @@ static const char rcsid[] =
#define _PATH_LD32_HINTS "/var/run/ld32.so.hints"
#define _PATH_ELF32_HINTS "/var/run/ld-elf32.so.hints"
#define _PATH_ELFSOFT_HINTS "/var/run/ld-elf-soft.so.hints"
#undef major
#undef minor
@ -111,6 +112,7 @@ main(int argc, char **argv)
int rval = 0;
int is_aout = 0;
int is_32 = 0;
int is_soft = 0;
while (argc > 1) {
if (strcmp(argv[1], "-aout") == 0) {
@ -125,12 +127,18 @@ main(int argc, char **argv)
is_32 = 1;
argc--;
argv++;
} else if (strcmp(argv[1], "-soft") == 0) {
is_soft = 1;
argc--;
argv++;
} else {
break;
}
}
if (is_32)
if (is_soft)
hints_file = _PATH_ELFSOFT_HINTS; /* Never will have a.out softfloat */
else if (is_32)
hints_file = is_aout ? _PATH_LD32_HINTS : _PATH_ELF32_HINTS;
else
hints_file = is_aout ? _PATH_LD_HINTS : _PATH_ELF_HINTS;