From nobody Sun Sep 17 14:42:27 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 4RpVyC5Xhwz4sxL0; Sun, 17 Sep 2023 14:42:27 +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 4RpVyC4lVlz3fTw; Sun, 17 Sep 2023 14:42:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1694961747; 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=Yj+ipE9Sux6AHXNjExDzHoJZymzrNs/ZYdETncYXbkI=; b=Iz8qtspm59LPNN2kKURJsf3vziBGrgel1ZnaRAEQWwVZjdo/Na0FgAVbKTgdT3ySBaTw/k yKIBOzI0O0ckIXB/BLQqpFHbYFgCCYOM+YUk2x0xhNi0UheCLIxTgu8TGLOSC5asEjHX59 VSZXq/3gL9Hra69M+yOJnYd26Vgt3JjEP3WQ0PzLBeenlYDIHwqcdJTg5F6BW4yjDeOf/I k160+PB4cITSYyLKJ2iL9toKk273J3nZgfaI6KpU5JIsMqZ3lf8WkxONFrLghbdb9ZaztL SXeZkeaaXV9UjR794PPhreCB6xG3v/peFsekuOxGXQl/7Jw9UWiHWGm51KOWTA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1694961747; a=rsa-sha256; cv=none; b=X23wl3Qzv0BANvrYaXycyl/cVO3OvGWBDFzGqtDgJ0mlG2g3d4EJuPpdreA/+itZYyHKUQ UfTVXF0ydQAIAqzRUCN47HSBMXveQEEFeNzfCiWMqRCHOTw5fsPuFLSPmjUrgulvsb+ePX sAgedwU5UWoqYUax1uzeO+ISdZh9EOKYL++re6EtMBrv23BtI5u/egqIljBwyJzf9IPV2g HVgXytxqFPXsQu7laZ/sliJb/CV2iqsd3dgfTFtAq3VJdFBqJpd2f/B66RvKeI2PC2Sbzo /RRx9f00FUV9mtghUz+sD7fvmc6NU1ql4D0xCBXyKI9VtB7KaXllrWCSucYDbg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1694961747; 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=Yj+ipE9Sux6AHXNjExDzHoJZymzrNs/ZYdETncYXbkI=; b=iP7RMBp5spnU6E2SfdmAeAKRAsWDU52H82jt0yaw45troICD+4ivRkVegWaK2luqGMnjTb f9XizJrS/EVJL3Td3xZla7S06fTkgZJ0GGDWjAFi2eutaIhMFbAw5sb3rOZ5yC4VFU/uxG xSRxGOT42el8g0RRQuCXLXpYaX6vZPk4Y0sf/ohAV1IDMfZKRMBvestQFvBaqC250VSQzT bGwY9jLnIiBgoG5uc0IsjbSoSitwDdB1A4Sa3k/yWLuoua1gHNug+psxrFNkzKyZ12o9b0 wTn3b2iFbb/SDcK/g/ZB6jgEhGGhvxJR1XZGvBv3pA05f4s8ggiUcVfZLUDFcQ== 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 4RpVyC3rNlzss1; Sun, 17 Sep 2023 14:42:27 +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 38HEgRir037770; Sun, 17 Sep 2023 14:42:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 38HEgRvg037767; Sun, 17 Sep 2023 14:42:27 GMT (envelope-from git) Date: Sun, 17 Sep 2023 14:42:27 GMT Message-Id: <202309171442.38HEgRvg037767@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: 1972e2eba48f - stable/14 - msun: LIBCSRCDIR is too fragile, use ${SRCTOP}/lib/libc instead 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: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 1972e2eba48f2e9924dc96d9eaa18d39c00d480f Auto-Submitted: auto-generated The branch stable/14 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=1972e2eba48f2e9924dc96d9eaa18d39c00d480f commit 1972e2eba48f2e9924dc96d9eaa18d39c00d480f Author: Warner Losh AuthorDate: 2023-09-05 20:58:06 +0000 Commit: Warner Losh CommitDate: 2023-09-17 14:34:41 +0000 msun: LIBCSRCDIR is too fragile, use ${SRCTOP}/lib/libc instead LIBCSRCDIR is defined in bsd.libnames.mk, which is read in later in the Makefile than the line: .if exists(${LIBCSRCDIR}/${MACHINE_ARCH}) so we test to see if /${MARCHIN_ARCH} exists which it usually doesn't (but did for me since I mounted 13.2R SD image there). Move to defining our own LIBC_SRCTOP in terms of SRCTOP to treat these uniformily. Sponsored by: Netflix Reviewed by: sjg Differential Revision: https://reviews.freebsd.org/D41661 (cherry picked from commit b19d8afe4dd205f7d4bfa3282f58b73d504926db) Approved by: re (cperciva@) --- lib/libc/Makefile | 14 ++++++++------ lib/msun/Makefile | 20 +++++++++++++++----- 2 files changed, 23 insertions(+), 11 deletions(-) diff --git a/lib/libc/Makefile b/lib/libc/Makefile index a26215324332..7540eb8c21ad 100644 --- a/lib/libc/Makefile +++ b/lib/libc/Makefile @@ -7,12 +7,14 @@ SHLIBDIR?= /lib LIBC_SRCTOP?= ${.CURDIR} -# Pick the current architecture directory for libc. In general, this is -# named MACHINE_CPUARCH, but some ABIs are different enough to require -# their own libc, so allow a directory named MACHINE_ARCH to override this. - -.if exists(${LIBC_SRCTOP}/${MACHINE_ARCH:S/powerpc64le/powerpc64/}) -LIBC_ARCH=${MACHINE_ARCH:S/powerpc64le/powerpc64/} +# Pick the current architecture directory for libc. In general, this is named +# MACHINE_CPUARCH, but some ABIs are different enough to require their own libc, +# so allow a directory named MACHINE_ARCH to override this (though treat +# powerpc64le and powerpc64 the same). +# Note: This is copeid to msun/Makefile +M=${MACHINE_ARCH:S/powerpc64le/powerpc64/} +.if exists(${LIBC_SRCTOP}/${M}) +LIBC_ARCH=${M} .else LIBC_ARCH=${MACHINE_CPUARCH} .endif diff --git a/lib/msun/Makefile b/lib/msun/Makefile index 8bc984c2c342..9917be01d863 100644 --- a/lib/msun/Makefile +++ b/lib/msun/Makefile @@ -97,17 +97,27 @@ COMMON_SRCS+= s_cospi.c s_cospif.c \ s_sinpi.c s_sinpif.c \ s_tanpi.c s_tanpif.c +# LIBCSRCDIR is defined lazily, so can't be used for exists() below +LIBC_SRCTOP=${SRCTOP}/lib/libc # Location of fpmath.h and _fpmath.h -.if exists(${LIBCSRCDIR}/${MACHINE_ARCH}) -LIBC_ARCH=${MACHINE_ARCH} + +# Pick the current architecture directory for libc. In general, this is named +# MACHINE_CPUARCH, but some ABIs are different enough to require their own libc, +# so allow a directory named MACHINE_ARCH to override this (though treat +# powerpc64le and powerpc64 the same). +# Note: This is copied from libc/Makefile +M=${MACHINE_ARCH:S/powerpc64le/powerpc64/} +.if exists(${LIBC_SRCTOP}/${M}) +LIBC_ARCH=${M} .else LIBC_ARCH=${MACHINE_CPUARCH} .endif -CFLAGS+= -I${.CURDIR}/src -I${LIBCSRCDIR}/include \ - -I${LIBCSRCDIR}/${LIBC_ARCH} + +CFLAGS+= -I${.CURDIR}/src -I${LIBC_SRCTOP}/include \ + -I${LIBC_SRCTOP}/${LIBC_ARCH} SYM_MAPS+= ${.CURDIR}/Symbol.map -VERSION_DEF= ${LIBCSRCDIR}/Versions.def +VERSION_DEF= ${LIBC_SRCTOP}/Versions.def SYMBOL_MAPS= ${SYM_MAPS} # C99 long double functions