From owner-svn-src-head@freebsd.org Mon Jan 18 21:40:21 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C0F71A87394; Mon, 18 Jan 2016 21:40:21 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 81616185C; Mon, 18 Jan 2016 21:40:21 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0ILeKQX013638; Mon, 18 Jan 2016 21:40:20 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0ILeKMw013635; Mon, 18 Jan 2016 21:40:20 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201601182140.u0ILeKMw013635@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 18 Jan 2016 21:40:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294296 - in head/libexec/rtld-elf: . arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Jan 2016 21:40:21 -0000 Author: imp Date: Mon Jan 18 21:40:20 2016 New Revision: 294296 URL: https://svnweb.freebsd.org/changeset/base/294296 Log: Restore ABI variants now that ldconfig groks -soft. In addition, as a transition mechanism, if we don't have /usr/libsoft, assume that soft float ABI binaries are the default, so treat them as default binaries. When we've fully transitioned, it will make no sense to do this stat, and it will be removed. Modified: head/libexec/rtld-elf/arm/reloc.c head/libexec/rtld-elf/paths.h head/libexec/rtld-elf/rtld.c Modified: head/libexec/rtld-elf/arm/reloc.c ============================================================================== --- head/libexec/rtld-elf/arm/reloc.c Mon Jan 18 21:40:18 2016 (r294295) +++ head/libexec/rtld-elf/arm/reloc.c Mon Jan 18 21:40:20 2016 (r294296) @@ -3,6 +3,7 @@ #include __FBSDID("$FreeBSD$"); #include +#include #include #include @@ -21,6 +22,7 @@ void arm_abi_variant_hook(Elf_Auxinfo **aux_info) { Elf_Word ehdr; + struct stat sb; /* * If we're running an old kernel that doesn't provide any data fail @@ -38,12 +40,19 @@ arm_abi_variant_hook(Elf_Auxinfo **aux_i return; /* + * If there's no /usr/libsoft, then we don't have a system with both + * hard and soft float. In that case, hope for the best and just + * return. Such systems are required to have all soft or all hard + * float ABI binaries and libraries. This is, at best, a transition + * compatibility hack. Once we're fully hard-float, this should + * be removed. + */ + if (stat("/usr/libsoft", &sb) != 0 || !S_ISDIR(sb.st_mode)) + return; + + /* * This is a soft float ABI binary. We need to use the soft float - * settings. For the moment, the standard library path includes the hard - * float paths as well. When upgrading, we need to execute the wrong - * kind of binary until we've installed the new binaries. We could go - * off whether or not /libsoft exists, but the simplicity of having it - * in the path wins. + * settings. */ ld_elf_hints_default = _PATH_SOFT_ELF_HINTS; ld_path_libmap_conf = _PATH_SOFT_LIBMAP_CONF; Modified: head/libexec/rtld-elf/paths.h ============================================================================== --- head/libexec/rtld-elf/paths.h Mon Jan 18 21:40:18 2016 (r294295) +++ head/libexec/rtld-elf/paths.h Mon Jan 18 21:40:20 2016 (r294296) @@ -62,7 +62,7 @@ #define _PATH_SOFT_ELF_HINTS "/var/run/ld-elf-soft.so.hints" #define _PATH_SOFT_LIBMAP_CONF "/etc/libmap-soft.conf" #define _PATH_SOFT_RTLD "/libexec/ld-elf.so.1" -#define SOFT_STANDARD_LIBRARY_PATH "/libsoft:/usr/libsoft:/lib:/usr/lib" +#define SOFT_STANDARD_LIBRARY_PATH "/usr/libsoft" #define LD_SOFT_ "LD_SOFT_" extern char *ld_elf_hints_default; Modified: head/libexec/rtld-elf/rtld.c ============================================================================== --- head/libexec/rtld-elf/rtld.c Mon Jan 18 21:40:18 2016 (r294295) +++ head/libexec/rtld-elf/rtld.c Mon Jan 18 21:40:20 2016 (r294296) @@ -435,7 +435,7 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_ trust = !issetugid(); -/* md_abi_variant_hook(aux_info); */ + md_abi_variant_hook(aux_info); ld_bind_now = getenv(_LD("BIND_NOW")); /*