From 31a46e2cc84d7ebfc25ce5a33e54681057e9ed9a Mon Sep 17 00:00:00 2001 From: Brooks Davis Date: Tue, 14 Nov 2023 22:25:24 +0000 Subject: [PATCH] libc: Move per-arch sys/Makefile.inc to libsys libc//sys/Makefile.inc -> libsys//Makefile.sys. Require that libsys//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 ++++- .../sys/Makefile.inc => libsys/aarch64/Makefile.sys} | 0 .../amd64/sys/Makefile.inc => libsys/amd64/Makefile.sys} | 0 lib/{libc/arm/sys/Makefile.inc => libsys/arm/Makefile.sys} | 2 +- .../i386/sys/Makefile.inc => libsys/i386/Makefile.sys} | 0 .../sys/Makefile.inc => libsys/powerpc/Makefile.sys} | 0 .../sys/Makefile.inc => libsys/powerpc64/Makefile.sys} | 0 lib/libsys/powerpcspe/Makefile.sys | 7 +++++++ .../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(-) delete mode 100644 lib/libc/powerpcspe/sys/Makefile.inc rename lib/{libc/aarch64/sys/Makefile.inc => libsys/aarch64/Makefile.sys} (100%) rename lib/{libc/amd64/sys/Makefile.inc => libsys/amd64/Makefile.sys} (100%) rename lib/{libc/arm/sys/Makefile.inc => libsys/arm/Makefile.sys} (56%) rename lib/{libc/i386/sys/Makefile.inc => libsys/i386/Makefile.sys} (100%) rename lib/{libc/powerpc/sys/Makefile.inc => libsys/powerpc/Makefile.sys} (100%) rename lib/{libc/powerpc64/sys/Makefile.inc => libsys/powerpc64/Makefile.sys} (100%) create mode 100644 lib/libsys/powerpcspe/Makefile.sys rename lib/{libc/riscv/sys/Makefile.inc => libsys/riscv/Makefile.sys} (100%) rename lib/{libc/x86/sys/Makefile.inc => libsys/x86/Makefile.sys} (100%) rename lib/{libc/x86/sys => libsys/x86}/sched_getcpu_x86.c (100%) 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