From owner-svn-src-head@freebsd.org  Tue Sep 12 17:06:36 2017
Return-Path: <owner-svn-src-head@freebsd.org>
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 9BAE7E12D09;
 Tue, 12 Sep 2017 17:06:36 +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 733607D8DE;
 Tue, 12 Sep 2017 17:06:36 +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 v8CH6Z2e024988;
 Tue, 12 Sep 2017 17:06:35 GMT (envelope-from imp@FreeBSD.org)
Received: (from imp@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8CH6ZAG024985;
 Tue, 12 Sep 2017 17:06:35 GMT (envelope-from imp@FreeBSD.org)
Message-Id: <201709121706.v8CH6ZAG024985@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org
 using -f
From: Warner Losh <imp@FreeBSD.org>
Date: Tue, 12 Sep 2017 17:06:35 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r323500 - in head: . libexec/rtld-elf/arm
X-SVN-Group: head
X-SVN-Commit-Author: imp
X-SVN-Commit-Paths: in head: . libexec/rtld-elf/arm
X-SVN-Commit-Revision: 323500
X-SVN-Commit-Repository: base
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.23
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 <svn-src-head.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-head>,
 <mailto:svn-src-head-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-head/>
List-Post: <mailto:svn-src-head@freebsd.org>
List-Help: <mailto:svn-src-head-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-head>,
 <mailto:svn-src-head-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 12 Sep 2017 17:06:36 -0000

Author: imp
Date: Tue Sep 12 17:06:35 2017
New Revision: 323500
URL: https://svnweb.freebsd.org/changeset/base/323500

Log:
  End softfp->hardfp transition period for arm
  
  On hard-float 32-bit arm platforms, always search for the soft float
  binaries in the alternative locations.
  
  Sponsored by: Netflix
  Differential Review: https://reviews.freebsd.org/D12274
  MFC After: 1 week

Modified:
  head/UPDATING
  head/libexec/rtld-elf/arm/reloc.c
  head/libexec/rtld-elf/arm/rtld_machdep.h

Modified: head/UPDATING
==============================================================================
--- head/UPDATING	Tue Sep 12 16:00:51 2017	(r323499)
+++ head/UPDATING	Tue Sep 12 17:06:35 2017	(r323500)
@@ -51,6 +51,13 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12.x IS SLOW:
 
 ****************************** SPECIAL WARNING: ******************************
 
+20170912:
+	For 32-bit arm compiled for hard-float support, soft-floating point
+	binaries now always get their shared libraries from
+	LD_SOFT_LIBRARY_PATH (in the past, this was only used if
+	/usr/libsoft also existed). Only users with a hard-float ld.so, but
+	soft-float everything else should be affected.
+
 20170826:
        During boot the geli passphrase will be hidden. To restore previous
        behavior see geli(8) configuration options.

Modified: head/libexec/rtld-elf/arm/reloc.c
==============================================================================
--- head/libexec/rtld-elf/arm/reloc.c	Tue Sep 12 16:00:51 2017	(r323499)
+++ head/libexec/rtld-elf/arm/reloc.c	Tue Sep 12 17:06:35 2017	(r323500)
@@ -18,11 +18,18 @@ __FBSDID("$FreeBSD$");
 #include "rtld.h"
 #include "paths.h"
 
+#ifdef __ARM_FP
+/*
+ * On processors that have hard floating point supported, we also support
+ * running soft float binaries. If we're being built with hard float support,
+ * check the ELF headers to make sure that this is a hard float binary. If it is
+ * a soft float binary, force the dynamic linker to use the alternative soft
+ * float path.
+ */
 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
@@ -40,17 +47,6 @@ arm_abi_variant_hook(Elf_Auxinfo **aux_info)
 		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.
 	 */
@@ -60,6 +56,7 @@ arm_abi_variant_hook(Elf_Auxinfo **aux_info)
 	ld_standard_library_path = SOFT_STANDARD_LIBRARY_PATH;
 	ld_env_prefix = LD_SOFT_;
 }
+#endif
 
 void
 init_pltgot(Obj_Entry *obj)

Modified: head/libexec/rtld-elf/arm/rtld_machdep.h
==============================================================================
--- head/libexec/rtld-elf/arm/rtld_machdep.h	Tue Sep 12 16:00:51 2017	(r323499)
+++ head/libexec/rtld-elf/arm/rtld_machdep.h	Tue Sep 12 17:06:35 2017	(r323500)
@@ -31,6 +31,7 @@
 
 #include <sys/types.h>
 #include <machine/atomic.h>
+#include <machine/acle-compat.h>
 
 struct Struct_Obj_Entry;
 
@@ -74,7 +75,11 @@ extern void *__tls_get_addr(tls_index *ti);
 
 extern void arm_abi_variant_hook(Elf_Auxinfo **);
 
+#ifdef __ARM_FP
 #define md_abi_variant_hook(x)		arm_abi_variant_hook(x)
 #define RTLD_VARIANT_ENV_NAMES
+#else
+#define md_abi_variant_hook(x)
+#endif
 
 #endif