From nobody Sun Jul 16 15:42:44 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R3qGr2Vqhz4n5X5; Sun, 16 Jul 2023 15:42:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R3qGr1ssXz4T0f; Sun, 16 Jul 2023 15:42:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689522164; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=truzyeu59rqPEbKInQl3LMna66AhI+F4336BGlnRZnk=; b=hsGeawTj5W1UJ+eTf5I6Ayin4hv7e4p4ASTCU9ayBFH+e2294nLccudqnqMT9MHfKkIhhM bIVGZXgjVEJiJA9uzXRKgahk+eGVTap4IV5iFJC1pJ3Iti4lWFSNIWmuLm2kbh84DMBMDZ 7J4yrnxYujKd51Qqzbm6A3rfZfw2fdMWxehP/aIId9avcJjJq1UZEJgIPw0LZVhimKNOtm BqzVR2S0P2pT2NkT2n4bJXjhNdPHRZPU7W4yQta3dkXaUujH0LwhFD4pV9FJi5YUlB42Bx NPtTlHQp6var+YjcKB/Q9uzJNWDvZ2ZLRwEDApMNJBIGQHvKYGRZOFGX+GgMbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689522164; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=truzyeu59rqPEbKInQl3LMna66AhI+F4336BGlnRZnk=; b=Ixo+MLi26V5JK4BhPi3dKJYUeVzNfxJYeYW8yAVLCOnn1jTvKlTd1xltayX37L5w5QQMfs bq0xOMwKiloiAYR2ONf85UlLtV4XjL0E83zUlQrVMkrZ+UROvthAskeid9noUdgUxCgACl 4fgetgQAgF4qeTNTSUMfKrOjdvemoKeJlAaBJOOEiLP8aWgpx1115PAZQdxhNLsMe1yJmp wdKG5ffIk2MOZ5IIRwKnQjTB3YRZxL7Ne1P+cILcECICy3dIr7EJKhg5wq4g2M4PDfVYmN IL4hh4+SNwR/S+kVZB5cSqZwQiXzj3RAD2c4TwKJZqhBCpnOS6qFB1EWP8VYmw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689522164; a=rsa-sha256; cv=none; b=UfGn9dimq9t3btUrzB2/drxeTYwrc5wYbrY/Hc7fEoBDIi0w9XRkdaycXRonnuIOpnP20E 5uW/yrv+Jncf2y7iZdSMVl78FqhQqS5tDNt2iSgkM+POMSD8tAp/oBe2kQOCcG/ZAOFOuo uqv5+WHuHDx3x8STF4TGUNkpj/ey5svOmdUUuUyvxRqQpSxyog/3KreRAHOq7VEB2Md3Tl 17ulFUE+qOt+3bbSJxxPRxz0JEL7rLgZJdZOhFCREHUXCbidFRGKAw4RQsB4f6iof4ov0e S3Ssx/2c9UhrIBh/G80BvXk00BXgp8GWva/8ZA37hq88/t253OtKUzBhc6y0Ag== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R3qGr0dkZznvx; Sun, 16 Jul 2023 15:42:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36GFgiPv096191; Sun, 16 Jul 2023 15:42:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36GFgiFE096190; Sun, 16 Jul 2023 15:42:44 GMT (envelope-from git) Date: Sun, 16 Jul 2023 15:42:44 GMT Message-Id: <202307161542.36GFgiFE096190@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Robert Clausecker Subject: git: c1e63e352e34 - main - libexec/rtld-elf/rtld-libc/Makefile.inc: do not use machdep string functions List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: fuz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c1e63e352e34b55ad577011fa4729f0638fb3fdf Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by fuz: URL: https://cgit.FreeBSD.org/src/commit/?id=c1e63e352e34b55ad577011fa4729f0638fb3fdf commit c1e63e352e34b55ad577011fa4729f0638fb3fdf Author: Robert Clausecker AuthorDate: 2023-06-28 17:18:15 +0000 Commit: Robert Clausecker CommitDate: 2023-07-16 15:41:55 +0000 libexec/rtld-elf/rtld-libc/Makefile.inc: do not use machdep string functions With ifunc based SIMD dispatch, we cannot use the amd64 assembly implementations of string functions. Modify rtld to instead use the generic functions. To avoid an architecture-specific special case, this change is applied to all architectures. This change is a prerequisite to and formerly part of D40693. Sponsored by: FreeBSD Foundation Approved by: kib See also: D40693 Differential Revision: https://reviews.freebsd.org/D41050 --- libexec/rtld-elf/rtld-libc/Makefile.inc | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/libexec/rtld-elf/rtld-libc/Makefile.inc b/libexec/rtld-elf/rtld-libc/Makefile.inc index 99da16d06509..5033b2207e32 100644 --- a/libexec/rtld-elf/rtld-libc/Makefile.inc +++ b/libexec/rtld-elf/rtld-libc/Makefile.inc @@ -38,11 +38,21 @@ SRCS+= errlst.c getcwd.c getprogname.c raise.c sigsetops.c sysctlnametomib.c \ # errlst.c needs the errlst.h header from libc: CFLAGS.errlst.c+=-I${LIBC_SRCTOP}/include -# Use the string and memory .o files from libc instead of rebuilding them (they -# might be using optimized assembly and duplicating that logic here is awkward). -_libc_string_objects= bcmp bcopy bzero memset memchr memcmp memcpy memmove \ - stpncpy strcat strchr strchrnul strcmp stpcpy strcpy strcspn strdup \ - strlcat strlcpy strlen strncmp strncpy strrchr strsep strspn strstr strtok +# use generic versions of string functions to avoid potential ifunc dispatch +.PATH: ${LIBC_SRCTOP}/string +SRCS+= bcopy.c bzero.c memchr.c memcmp.c memcpy.c memmove.c memset.c strcat.c \ + strchr.c strchrnul.c strcmp.c strcpy.c strcspn.c strdup.c strlcat.c \ + strlcpy.c strlen.c strncmp.c strncpy.c strrchr.c strsep.c strspn.c \ + strstr.c strtok.c +CFLAGS.memchr.c+=-Wno-cast-qual +CFLAGS.strchr.c+=-Wno-cast-qual +CFLAGS.strchrnul.c+=-Wno-cast-qual +CFLAGS.strcspn.c+=-Wno-sign-compare +CFLAGS.strrchr.c+=-Wno-cast-qual +CFLAGS.strspn.c+=-Wno-sign-compare +CFLAGS.strstr.c+=-Wno-cast-qual -Wno-sign-compare +CFLAGS.strtok.c+=-Wno-cast-qual + # Also use all the syscall .o files from libc_nossp_pic: _libc_other_objects= sigsetjmp lstat stat fstat fstatat fstatfs syscall \ cerror geteuid getegid sigfastblock munmap mprotect \ @@ -71,7 +81,7 @@ _libc_other_objects+=syncicache # we don't accidentally pull in the interposing table or similar by linking # directly against libc_nossp_pic.a _rtld_libc_objs= -.for _obj in ${_libc_other_objects} ${_libc_string_objects} +.for _obj in ${_libc_other_objects} _rtld_libc_objs+=${_obj}.nossppico CLEANFILES+=${_obj}.nossppico # LDFLAGS+= -Wl,--trace-symbol=${_obj}