Page MenuHomeFreeBSD

D44117.diff
No OneTemporary

D44117.diff

diff --git a/lib/libc/Makefile b/lib/libc/Makefile
--- a/lib/libc/Makefile
+++ b/lib/libc/Makefile
@@ -122,7 +122,6 @@
.include "${LIBC_SRCTOP}/stdlib/Makefile.inc"
.include "${LIBC_SRCTOP}/stdtime/Makefile.inc"
.include "${LIBC_SRCTOP}/string/Makefile.inc"
-SHARED_CFLAGS+= -D'_SYSCALL_BODY(name)='
.include "${LIBSYS_SRCTOP}/Makefile.sys"
.include "${LIBC_SRCTOP}/secure/Makefile.inc"
.include "${LIBC_SRCTOP}/rpc/Makefile.inc"
diff --git a/lib/libsys/Makefile b/lib/libsys/Makefile
--- a/lib/libsys/Makefile
+++ b/lib/libsys/Makefile
@@ -58,7 +58,6 @@
NOASM=
SYM_MAPS+= ${LIBSYS_SRCTOP}/Symbol.map
-SRCS+= auxv.c
.include "${LIBSYS_SRCTOP}/Makefile.sys"
diff --git a/lib/libsys/Makefile.sys b/lib/libsys/Makefile.sys
--- a/lib/libsys/Makefile.sys
+++ b/lib/libsys/Makefile.sys
@@ -27,11 +27,12 @@
.include "${LIBSYS_SRCTOP}/x86/Makefile.sys"
.endif
-SRCS+= \
+SYS_SRCS+= \
POSIX2x_Fork.c \
__error.c \
__getosreldate.c \
__vdso_gettimeofday.c \
+ auxv.c \
brk.c \
clock_gettime.c \
closefrom.c \
@@ -58,14 +59,6 @@
waitid.c \
waitpid.c
-.if ${LIB} == "c"
-# Trapping stubs in dynamic libc to be filtered by libsys.
-SOBJS+= libc_stubs.pico
-
-# Link the full implementation of ELF auxargs for static libc.
-STATICOBJS+= auxv.o
-.endif
-
PSEUDO= \
clock_gettime \
exit \
@@ -114,11 +107,11 @@
write \
writev
-SRCS+= ${INTERPOSED:S/$/.c/}
+SYS_SRCS+= ${INTERPOSED:S/$/.c/}
PSEUDO+= ${INTERPOSED}
# Add machine dependent asm sources:
-SRCS+=${MDASM}
+SYS_SRCS+=${MDASM}
# Look though the complete list of syscalls (MIASM) for names that are
# not defined with machine dependent implementations (MDASM), not declared
@@ -134,17 +127,18 @@
SPSEUDO= ${PSEUDO:C/^.*$/_&.S/}
-SRCS+= ${SASM} ${SPSEUDO}
-
-SYM_MAPS+= ${LIBSYS_SRCTOP}/syscalls.map
-SYM_MAPS+= ${LIBSYS_SRCTOP}/Symbol.sys.map
-.if exists(${LIBSYS_SRCTOP}/${LIBC_ARCH}/Symbol.sys.map)
-SYM_MAPS+= ${LIBSYS_SRCTOP}/${LIBC_ARCH}/Symbol.sys.map
-.endif
+SYS_SRCS+= ${SASM} ${SPSEUDO}
# Generated files
CLEANFILES+= ${SASM} ${SPSEUDO}
+SYS_SYM_MAPS+= ${LIBSYS_SRCTOP}/syscalls.map
+SYS_SYM_MAPS+= ${LIBSYS_SRCTOP}/Symbol.sys.map
+.if exists(${LIBSYS_SRCTOP}/${LIBC_ARCH}/Symbol.sys.map)
+SYS_SYM_MAPS+= ${LIBSYS_SRCTOP}/${LIBC_ARCH}/Symbol.sys.map
+.endif
+SYM_MAPS+= ${SYS_SYM_MAPS}
+
.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386" || \
${MACHINE_CPUARCH} == "powerpc" || ${MACHINE_CPUARCH} == "arm"
NOTE_GNU_STACK='\t.section .note.GNU-stack,"",%%progbits\n'
@@ -157,6 +151,28 @@
FEATURE_NOTE=''
.endif
+.if ${LIB} == "c"
+# Trapping stubs in dynamic libc to be filtered by libsys.
+SOBJS+= libsys_stubs.pico
+CLEANFILES+= libsys_stubs.c
+CFLAGS.libsys_stubs.c+= -Wno-incompatible-library-redeclaration
+
+libsys_stubs.c: ${SYS_SYM_MAPS} ${LIBSYS_SRCTOP}/Makefile.sys
+ printf '/* %sgenerated by libsys/Makefile.sys */\n' @ > ${.TARGET}
+ printf '#include <sys/cdefs.h>\n' >> ${.TARGET}
+ printf '#define STUB_FUNC(f) \\\n' >> ${.TARGET}
+ printf ' void (f)(void); \\\n' >> ${.TARGET}
+ printf ' void (f)(void) { __builtin_trap(); }\n' >> ${.TARGET}
+ awk 'BEGIN {FS=";"}; /};/ {next}; /;/ {gsub(/[\t ]/,""); print "STUB_FUNC("$$1")" }' ${SYS_SYM_MAPS} >> ${.TARGET}
+
+# Link the full implementations for static libc.
+STATICOBJS+= ${SYS_SRCS:R:C/^.*$/&.o/}
+NOSSPSOBJS+= ${SYS_SRCS:R:C/^.*$/&.nossppico/}
+
+.else # !libc
+SRCS+= ${SYS_SRCS}
+.endif # !libc
+
${SASM}:
printf '/* %sgenerated by libc/sys/Makefile.inc */\n' @ > ${.TARGET}
printf '#include "compat.h"\n' >> ${.TARGET}
diff --git a/lib/libsys/aarch64/Makefile.sys b/lib/libsys/aarch64/Makefile.sys
--- a/lib/libsys/aarch64/Makefile.sys
+++ b/lib/libsys/aarch64/Makefile.sys
@@ -1,6 +1,7 @@
MIASM:= ${MIASM:Nfreebsd[467]_*}
-SRCS+= __vdso_gettc.c \
+SYS_SRCS+= \
+ __vdso_gettc.c \
sched_getcpu_gen.c
MDASM= cerror.S \
diff --git a/lib/libsys/amd64/Makefile.sys b/lib/libsys/amd64/Makefile.sys
--- a/lib/libsys/amd64/Makefile.sys
+++ b/lib/libsys/amd64/Makefile.sys
@@ -1,4 +1,4 @@
-SRCS+= \
+SYS_SRCS+= \
amd64_get_fsbase.c \
amd64_get_gsbase.c \
amd64_set_fsbase.c \
diff --git a/lib/libsys/arm/Makefile.sys b/lib/libsys/arm/Makefile.sys
--- a/lib/libsys/arm/Makefile.sys
+++ b/lib/libsys/arm/Makefile.sys
@@ -1,4 +1,5 @@
-SRCS+= __vdso_gettc.c \
+SYS_SRCS+= \
+ __vdso_gettc.c \
sched_getcpu_gen.c
MDASM= vfork.S cerror.S syscall.S
diff --git a/lib/libsys/i386/Makefile.sys b/lib/libsys/i386/Makefile.sys
--- a/lib/libsys/i386/Makefile.sys
+++ b/lib/libsys/i386/Makefile.sys
@@ -1,4 +1,5 @@
-SRCS+= i386_get_fsbase.c i386_get_gsbase.c i386_get_ioperm.c i386_get_ldt.c \
+SYS_SRCS+= \
+ i386_get_fsbase.c i386_get_gsbase.c i386_get_ioperm.c i386_get_ldt.c \
i386_set_fsbase.c i386_set_gsbase.c i386_set_ioperm.c i386_set_ldt.c \
i386_clr_watch.c i386_set_watch.c i386_vm86.c \
rfork_thread.S
diff --git a/lib/libsys/libc_stubs.c b/lib/libsys/libc_stubs.c
deleted file mode 100644
--- a/lib/libsys/libc_stubs.c
+++ /dev/null
@@ -1,11 +0,0 @@
-/*-
- * SPDX-License-Identifier: BSD-2-Clause
- *
- * Copyright (c) 2024 SRI International
- */
-
-#define STUB_FUNC(f) \
- void (f)(void); \
- void (f)(void) { __builtin_trap(); }
-
-STUB_FUNC(elf_aux_info);
diff --git a/lib/libsys/powerpc/Makefile.sys b/lib/libsys/powerpc/Makefile.sys
--- a/lib/libsys/powerpc/Makefile.sys
+++ b/lib/libsys/powerpc/Makefile.sys
@@ -1,4 +1,5 @@
-SRCS+= __vdso_gettc.c \
+SYS_SRCS+= \
+ __vdso_gettc.c \
sched_getcpu_gen.c
MDASM+= cerror.S
diff --git a/lib/libsys/powerpc64/Makefile.sys b/lib/libsys/powerpc64/Makefile.sys
--- a/lib/libsys/powerpc64/Makefile.sys
+++ b/lib/libsys/powerpc64/Makefile.sys
@@ -1,4 +1,5 @@
-SRCS+= __vdso_gettc.c \
+SYS_SRCS+= \
+ __vdso_gettc.c \
sched_getcpu_gen.c
MDASM+= cerror.S
diff --git a/lib/libsys/riscv/Makefile.sys b/lib/libsys/riscv/Makefile.sys
--- a/lib/libsys/riscv/Makefile.sys
+++ b/lib/libsys/riscv/Makefile.sys
@@ -1,4 +1,5 @@
-SRCS+= __vdso_gettc.c \
+SYS_SRCS+= \
+ __vdso_gettc.c \
sched_getcpu_gen.c
MDASM= cerror.S \
diff --git a/lib/libsys/x86/Makefile.sys b/lib/libsys/x86/Makefile.sys
--- a/lib/libsys/x86/Makefile.sys
+++ b/lib/libsys/x86/Makefile.sys
@@ -1,6 +1,6 @@
.PATH: ${LIBSYS_SRCTOP}/x86
-SRCS+= \
+SYS_SRCS+= \
__vdso_gettc.c \
pkru.c \
sched_getcpu_x86.c

File Metadata

Mime Type
text/plain
Expires
Thu, May 21, 4:36 PM (4 h, 33 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
33399705
Default Alt Text
D44117.diff (6 KB)

Event Timeline