diff options
author | imp <imp@FreeBSD.org> | 2016-01-18 21:40:18 +0000 |
---|---|---|
committer | imp <imp@FreeBSD.org> | 2016-01-18 21:40:18 +0000 |
commit | 4e5086551d319f9c7fe728a3eab713a1d1bfbcb3 (patch) | |
tree | 6d5589431473f385aa2333e1b087cd0a910738ad | |
parent | a4bbea0419ac706a7197d1db72bb3c784a075776 (diff) | |
download | FreeBSD-src-4e5086551d319f9c7fe728a3eab713a1d1bfbcb3.zip FreeBSD-src-4e5086551d319f9c7fe728a3eab713a1d1bfbcb3.tar.gz |
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.
-rw-r--r-- | etc/defaults/rc.conf | 6 | ||||
-rwxr-xr-x | etc/rc.d/ldconfig | 22 | ||||
-rw-r--r-- | sbin/ldconfig/ldconfig.c | 10 |
3 files changed, 37 insertions, 1 deletions
diff --git a/etc/defaults/rc.conf b/etc/defaults/rc.conf index 12aaf31..54facb8 100644 --- a/etc/defaults/rc.conf +++ b/etc/defaults/rc.conf @@ -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 diff --git a/etc/rc.d/ldconfig b/etc/rc.d/ldconfig index 2dbb5b4..08a2237 100755 --- a/etc/rc.d/ldconfig +++ b/etc/rc.d/ldconfig @@ -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) diff --git a/sbin/ldconfig/ldconfig.c b/sbin/ldconfig/ldconfig.c index 31d8083..85d97e6 100644 --- a/sbin/ldconfig/ldconfig.c +++ b/sbin/ldconfig/ldconfig.c @@ -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; |