summaryrefslogtreecommitdiff
path: root/lib/libc/sys
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2001-09-20 20:52:11 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2001-09-20 20:52:11 +0000
commit4e9408f19825cf62714518d8932f18563b44cd7b (patch)
treea6b52feaebb23e89ad560dfbf6a01b67e80c9b11 /lib/libc/sys
parentbca0bac323557ad790813fb7c2d4e2539df9193d (diff)
Add PSEUDO_NOERROR similar to that used by NetBSD.
Some ports were setting errno in PSEUDO and some were not. Now errno is set for all in PSEUDO and PSEUDO_NOERROR is provided for the non-errno case (only used by _exit). Needs testing on vax and m88k. XXX - hppa and powerpc still lack a real PSEUDO_NOERROR implementation. Currently PSEUDO_NOERROR and PSEUDO are the same (so builds don't break on those platforms).
Diffstat (limited to 'lib/libc/sys')
-rw-r--r--lib/libc/sys/Makefile.inc37
1 files changed, 34 insertions, 3 deletions
diff --git a/lib/libc/sys/Makefile.inc b/lib/libc/sys/Makefile.inc
index 03a9ce6454b..8424e1ae6ee 100644
--- a/lib/libc/sys/Makefile.inc
+++ b/lib/libc/sys/Makefile.inc
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile.inc,v 1.45 2001/07/09 00:20:52 fgsch Exp $
+# $OpenBSD: Makefile.inc,v 1.46 2001/09/20 20:52:09 millert Exp $
# $NetBSD: Makefile.inc,v 1.35 1995/10/16 23:49:07 jtc Exp $
# @(#)Makefile.inc 8.1 (Berkeley) 6/17/93
@@ -66,12 +66,17 @@ GASM= ${ASM:.o=.go}
PASM= ${ASM:.o=.po}
SASM= ${ASM:.o=.so}
-PSEUDO= _exit.o _getlogin.o _setlogin.o _ptrace.o
+PSEUDO= _getlogin.o _setlogin.o _ptrace.o
GPSEUDO=${PSEUDO:.o=.go}
PPSEUDO=${PSEUDO:.o=.po}
SPSEUDO=${PSEUDO:.o=.so}
-OBJS+= ${ASM} ${PSEUDO}
+PSEUDO_NOERR= _exit.o
+GPSEUDO_NOERR=${PSEUDO_NOERR:.o=.go}
+PPSEUDO_NOERR=${PSEUDO_NOERR:.o=.po}
+SPSEUDO_NOERR=${PSEUDO_NOERR:.o=.so}
+
+OBJS+= ${ASM} ${PSEUDO} ${PSEUDO_NOERR}
${GASM}: ${LIBCSRCDIR}/arch/${MACHINE_ARCH}/SYS.h /usr/include/sys/syscall.h
@echo creating ${.TARGET}
@@ -139,6 +144,32 @@ ${PSEUDO}: ${LIBCSRCDIR}/arch/${MACHINE_ARCH}/SYS.h /usr/include/sys/syscall.h
@${LD} -X -r ${.TARGET}.o -o ${.TARGET}
@rm -f ${.TARGET}.o
+${PPSEUDO_NOERR}: ${LIBCSRCDIR}/arch/${MACHINE_ARCH}/SYS.h /usr/include/sys/syscall.h
+ @echo creating ${.TARGET}
+ @printf '#include "SYS.h"\nPSEUDO_NOERROR(${.PREFIX},${.PREFIX:S/_//})\n' | \
+ ${CPP} -DPROF ${CFLAGS:M-[ID]*} ${AINC} | ${AS} -o ${.TARGET}.o
+ @${LD} -X -r ${.TARGET}.o -o ${.TARGET}
+ @rm -f ${.TARGET}.o
+
+.if (${MACHINE_ARCH} != "mips")
+${SPSEUDO_NOERR}: ${LIBCSRCDIR}/arch/${MACHINE_ARCH}/SYS.h /usr/include/sys/syscall.h
+ @echo creating ${.TARGET}
+ @printf '#include "SYS.h"\nPSEUDO_NOERROR(${.PREFIX},${.PREFIX:S/_//})\n' | \
+ ${CPP} -DPIC ${CFLAGS:M-[ID]*} ${AINC} | ${AS} -k -o ${.TARGET}
+.else
+${SPSEUDO_NOERR}: ${LIBCSRCDIR}/arch/${MACHINE_ARCH}/SYS.h /usr/include/sys/syscall.h
+ @echo creating ${.TARGET}
+ @printf '#include "SYS.h"\nPSEUDO_NOERROR(${.PREFIX},${.PREFIX:S/_//})\n' | \
+ ${CPP} -DPIC ${CFLAGS:M-[ID]*} ${AINC} | ${AS} -o ${.TARGET}
+.endif
+
+${PSEUDO_NOERR}: ${LIBCSRCDIR}/arch/${MACHINE_ARCH}/SYS.h /usr/include/sys/syscall.h
+ @echo creating ${.TARGET}
+ @printf '#include "SYS.h"\nPSEUDO_NOERROR(${.PREFIX},${.PREFIX:S/_//})\n' | \
+ ${CPP} ${CFLAGS:M-[ID]*} ${AINC} | ${AS} -o ${.TARGET}.o
+ @${LD} -X -r ${.TARGET}.o -o ${.TARGET}
+ @rm -f ${.TARGET}.o
+
# Lint stubs for all automatically-generated assembly stubs (GENERATED)
#LSRCS+= LintSysNormal.c LintSysNoerr.c LintSysPseudoNoerr.c
#DPSRCS+= LintSysNormal.c LintSysNoerr.c LintSysPseudoNoerr.c