git: 31a46e2cc84d - main - libc: Move per-arch sys/Makefile.inc to libsys

From: Brooks Davis <brooks_at_FreeBSD.org>
Date: Mon, 05 Feb 2024 20:38:34 UTC
The branch main has been updated by brooks:

URL: https://cgit.FreeBSD.org/src/commit/?id=31a46e2cc84d7ebfc25ce5a33e54681057e9ed9a

commit 31a46e2cc84d7ebfc25ce5a33e54681057e9ed9a
Author:     Brooks Davis <brooks@FreeBSD.org>
AuthorDate: 2023-11-14 22:25:24 +0000
Commit:     Brooks Davis <brooks@FreeBSD.org>
CommitDate: 2024-02-05 20:34:55 +0000

    libc: Move per-arch sys/Makefile.inc to libsys
    
    libc/<arch>/sys/Makefile.inc -> libsys/<arch>/Makefile.sys.
    
    Require that libsys/<arch>/Makefile.sys exist.  At least for current
    archtiectures, it's not possible for an architecture to not have and MD
    syscall bits.
    
    powerpcspe/Makefile.sys's structure means it had to be modified when moved
    so rename detection won't work, but it has trivial contents so the
    history is unimportant.
    
    Reviewed by:    kib, emaste, imp
    Pull Request:   https://github.com/freebsd/freebsd-src/pull/908
---
 lib/libc/Makefile                                                  | 1 -
 lib/libc/powerpcspe/sys/Makefile.inc                               | 2 --
 lib/libsys/Makefile.sys                                            | 5 ++++-
 lib/{libc/aarch64/sys/Makefile.inc => libsys/aarch64/Makefile.sys} | 0
 lib/{libc/amd64/sys/Makefile.inc => libsys/amd64/Makefile.sys}     | 0
 lib/{libc/arm/sys/Makefile.inc => libsys/arm/Makefile.sys}         | 2 +-
 lib/{libc/i386/sys/Makefile.inc => libsys/i386/Makefile.sys}       | 0
 lib/{libc/powerpc/sys/Makefile.inc => libsys/powerpc/Makefile.sys} | 0
 .../powerpc64/sys/Makefile.inc => libsys/powerpc64/Makefile.sys}   | 0
 lib/libsys/powerpcspe/Makefile.sys                                 | 7 +++++++
 lib/{libc/riscv/sys/Makefile.inc => libsys/riscv/Makefile.sys}     | 0
 lib/{libc/x86/sys/Makefile.inc => libsys/x86/Makefile.sys}         | 0
 lib/{libc/x86/sys => libsys/x86}/sched_getcpu_x86.c                | 0
 13 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/lib/libc/Makefile b/lib/libc/Makefile
index 2662d8b6aad0..72300e88d3d7 100644
--- a/lib/libc/Makefile
+++ b/lib/libc/Makefile
@@ -123,7 +123,6 @@ NOASM=
 .include "${LIBC_SRCTOP}/softfloat/Makefile.inc"
 .endif
 .if ${LIBC_ARCH} == "i386" || ${LIBC_ARCH} == "amd64"
-.include "${LIBC_SRCTOP}/x86/sys/Makefile.inc"
 .include "${LIBC_SRCTOP}/x86/gen/Makefile.inc"
 .endif
 .if ${MK_NIS} != "no"
diff --git a/lib/libc/powerpcspe/sys/Makefile.inc b/lib/libc/powerpcspe/sys/Makefile.inc
deleted file mode 100644
index 79a5fe2716be..000000000000
--- a/lib/libc/powerpcspe/sys/Makefile.inc
+++ /dev/null
@@ -1,2 +0,0 @@
-.PATH: ${LIBSYS_SRCTOP}/powerpc
-.sinclude "${LIBC_SRCTOP}/powerpc/sys/Makefile.inc"
diff --git a/lib/libsys/Makefile.sys b/lib/libsys/Makefile.sys
index 699117ff437b..7600c9ef2aae 100644
--- a/lib/libsys/Makefile.sys
+++ b/lib/libsys/Makefile.sys
@@ -20,7 +20,10 @@ NOASM=	exit.o \
 	yield.o
 PSEUDO=	_exit.o \
 	_getlogin.o
-.sinclude "${LIBC_SRCTOP}/${LIBC_ARCH}/sys/Makefile.inc"
+.include "${LIBSYS_SRCTOP}/${LIBC_ARCH}/Makefile.sys"
+.if ${LIBC_ARCH} == "i386" || ${LIBC_ARCH} == "amd64"
+.include "${LIBSYS_SRCTOP}/x86/Makefile.sys"
+.endif
 
 SRCS+= clock_gettime.c gettimeofday.c __vdso_gettimeofday.c
 NOASM+=  clock_gettime.o gettimeofday.o
diff --git a/lib/libc/aarch64/sys/Makefile.inc b/lib/libsys/aarch64/Makefile.sys
similarity index 100%
rename from lib/libc/aarch64/sys/Makefile.inc
rename to lib/libsys/aarch64/Makefile.sys
diff --git a/lib/libc/amd64/sys/Makefile.inc b/lib/libsys/amd64/Makefile.sys
similarity index 100%
rename from lib/libc/amd64/sys/Makefile.inc
rename to lib/libsys/amd64/Makefile.sys
diff --git a/lib/libc/arm/sys/Makefile.inc b/lib/libsys/arm/Makefile.sys
similarity index 56%
rename from lib/libc/arm/sys/Makefile.inc
rename to lib/libsys/arm/Makefile.sys
index d5b62d61c90d..ccfaa03a201b 100644
--- a/lib/libc/arm/sys/Makefile.inc
+++ b/lib/libsys/arm/Makefile.sys
@@ -1,4 +1,4 @@
 SRCS+=	__vdso_gettc.c \
 	sched_getcpu_gen.c
 
-MDASM= vfork.S cerror.S syscall.S
+MDASM=	vfork.S cerror.S syscall.S
diff --git a/lib/libc/i386/sys/Makefile.inc b/lib/libsys/i386/Makefile.sys
similarity index 100%
rename from lib/libc/i386/sys/Makefile.inc
rename to lib/libsys/i386/Makefile.sys
diff --git a/lib/libc/powerpc/sys/Makefile.inc b/lib/libsys/powerpc/Makefile.sys
similarity index 100%
rename from lib/libc/powerpc/sys/Makefile.inc
rename to lib/libsys/powerpc/Makefile.sys
diff --git a/lib/libc/powerpc64/sys/Makefile.inc b/lib/libsys/powerpc64/Makefile.sys
similarity index 100%
rename from lib/libc/powerpc64/sys/Makefile.inc
rename to lib/libsys/powerpc64/Makefile.sys
diff --git a/lib/libsys/powerpcspe/Makefile.sys b/lib/libsys/powerpcspe/Makefile.sys
new file mode 100644
index 000000000000..3862699ae8b2
--- /dev/null
+++ b/lib/libsys/powerpcspe/Makefile.sys
@@ -0,0 +1,7 @@
+CFLAGS+= -I${LIBC_SRCTOP}/powerpc
+CFLAGS+= -I${LIBSYS_SRCTOP}/powerpc
+
+SYM_MAPS+=	${LIBSYS_SRCTOP}/powerpc/Symbol.map
+
+.PATH: ${LIBSYS_SRCTOP}/powerpc
+.include "${LIBSYS_SRCTOP}/powerpc/Makefile.sys"
diff --git a/lib/libc/riscv/sys/Makefile.inc b/lib/libsys/riscv/Makefile.sys
similarity index 100%
rename from lib/libc/riscv/sys/Makefile.inc
rename to lib/libsys/riscv/Makefile.sys
diff --git a/lib/libc/x86/sys/Makefile.inc b/lib/libsys/x86/Makefile.sys
similarity index 100%
rename from lib/libc/x86/sys/Makefile.inc
rename to lib/libsys/x86/Makefile.sys
diff --git a/lib/libc/x86/sys/sched_getcpu_x86.c b/lib/libsys/x86/sched_getcpu_x86.c
similarity index 100%
rename from lib/libc/x86/sys/sched_getcpu_x86.c
rename to lib/libsys/x86/sched_getcpu_x86.c