aboutsummaryrefslogtreecommitdiff
path: root/lib/libc
diff options
context:
space:
mode:
authorWarner Losh <imp@FreeBSD.org>2023-09-05 20:58:06 +0000
committerWarner Losh <imp@FreeBSD.org>2023-09-05 22:08:02 +0000
commitb19d8afe4dd205f7d4bfa3282f58b73d504926db (patch)
tree09d0decdafb4f115657fa4765627381d06668bb9 /lib/libc
parent815b7436a7c6302365b6514194d27d41cb736227 (diff)
downloadsrc-b19d8afe4dd205f7d4bfa3282f58b73d504926db.tar.gz
src-b19d8afe4dd205f7d4bfa3282f58b73d504926db.zip
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
Diffstat (limited to 'lib/libc')
-rw-r--r--lib/libc/Makefile14
1 files changed, 8 insertions, 6 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