a few DBG=-g build fixes, both arches

- setlogin() not available
	- softfloat needed in -lminc for arm
	- libminc: we have to set LIBCDIR for the included files,
	  so use that instead of LIBCSRCDIR

Change-Id: I7f92621ebbca9ce08dc377b3fa61dee089071757
This commit is contained in:
Ben Gras 2013-06-15 23:43:39 +00:00
parent 71ac8a3a8a
commit d1b3ab953e
5 changed files with 46 additions and 26 deletions

View file

@ -21,4 +21,8 @@ SRCS+= fixunsgen64_ieee754.c fixunsdfsi_ieee754.c
SOFTFLOAT_BITS=32 SOFTFLOAT_BITS=32
.endif .endif
.if defined(__MINIX)
.include "${LIBCDIR}/softfloat/Makefile.inc"
.else
.include <softfloat/Makefile.inc> .include <softfloat/Makefile.inc>
.endif

View file

@ -1,10 +1,19 @@
# $NetBSD: Makefile.inc,v 1.10 2011/07/04 02:53:15 mrg Exp $ # $NetBSD: Makefile.inc,v 1.10 2011/07/04 02:53:15 mrg Exp $
SOFTFLOAT_BITS?=64 SOFTFLOAT_BITS?=64
.if defined(__MINIX)
.PATH: ${ARCHDIR}/softfloat \
${LIBCDIR}/softfloat/bits${SOFTFLOAT_BITS} ${LIBCDIR}/softfloat
.else
.PATH: ${ARCHDIR}/softfloat \ .PATH: ${ARCHDIR}/softfloat \
${.CURDIR}/softfloat/bits${SOFTFLOAT_BITS} ${.CURDIR}/softfloat ${.CURDIR}/softfloat/bits${SOFTFLOAT_BITS} ${.CURDIR}/softfloat
.endif
.if defined(__MINIX)
CPPFLAGS+= -I${ARCHDIR}/softfloat -I${LIBCDIR}/softfloat
.else
CPPFLAGS+= -I${ARCHDIR}/softfloat -I${.CURDIR}/softfloat CPPFLAGS+= -I${ARCHDIR}/softfloat -I${.CURDIR}/softfloat
.endif
CPPFLAGS+= -DSOFTFLOAT_FOR_GCC CPPFLAGS+= -DSOFTFLOAT_FOR_GCC
SRCS.softfloat= softfloat.c SRCS.softfloat= softfloat.c

View file

@ -8,11 +8,11 @@ LIB= minc
CPPFLAGS.sched_start.c+= -I${NETBSDSRCDIR} CPPFLAGS.sched_start.c+= -I${NETBSDSRCDIR}
LIBCSRCDIR= ${NETBSDSRCDIR}/lib/libc LIBCDIR= ${NETBSDSRCDIR}/lib/libc
CPPFLAGS+= -I${LIBCSRCDIR}/include -I${LIBCSRCDIR} CPPFLAGS+= -I${LIBCDIR}/include -I${LIBCDIR}
CPPFLAGS+= -D_LIBMINC CPPFLAGS+= -D_LIBMINC
ARCHDIR?= ${LIBCSRCDIR}/arch/${MACHINE_CPU} ARCHDIR?= ${LIBCDIR}/arch/${MACHINE_CPU}
# #
# Customized versions of libc functions. # Customized versions of libc functions.
# #
@ -63,7 +63,7 @@ CPPFLAGS.strlcpy.c+= -D_LIBC
# Import from misc (_libc_init symbols) # Import from misc (_libc_init symbols)
.for i in initfini.c stack_protector.c .for i in initfini.c stack_protector.c
.PATH.c: ${LIBCSRCDIR}/misc .PATH.c: ${LIBCDIR}/misc
SRCS+= ${i} SRCS+= ${i}
CPPFLAGS.${i}+= -Dxprintf=printf CPPFLAGS.${i}+= -Dxprintf=printf
.endfor .endfor
@ -71,23 +71,23 @@ CPPFLAGS.${i}+= -Dxprintf=printf
# Import from stdio # Import from stdio
.for i in findfp.c sprintf.c fprintf.c perror.c vsnprintf.c snprintf.c \ .for i in findfp.c sprintf.c fprintf.c perror.c vsnprintf.c snprintf.c \
_rand48.c lrand48.c srand48.c _rand48.c lrand48.c srand48.c
.PATH.c: ${LIBCSRCDIR}/stdio .PATH.c: ${LIBCDIR}/stdio
CPPFLAGS.${i}= -I${LIBCSRCDIR}/stdio CPPFLAGS.${i}= -I${LIBCDIR}/stdio
SRCS+= ${i} SRCS+= ${i}
.endfor .endfor
# Import from stdlib # Import from stdlib
.for i in abort.c atexit.c atoi.c exit.c getenv.c \ .for i in abort.c atexit.c atoi.c exit.c getenv.c \
getopt.c ldiv.c malloc.c getopt.c ldiv.c malloc.c
.PATH.c: ${LIBCSRCDIR}/stdlib .PATH.c: ${LIBCDIR}/stdlib
SRCS+= ${i} SRCS+= ${i}
CPPFLAGS.${i}+= -I${LIBCSRCDIR}/stdlib CPPFLAGS.${i}+= -I${LIBCDIR}/stdlib
.endfor .endfor
# Import from gen # Import from gen
errlist.c: ${LIBCSRCDIR}/gen/errlist.awk \ errlist.c: ${LIBCDIR}/gen/errlist.awk \
${NETBSDSRCDIR}/sys/sys/errno.h ${NETBSDSRCDIR}/sys/sys/errno.h
${TOOL_CAT} ${NETBSDSRCDIR}/sys/sys/errno.h | ${TOOL_SED} 's/(_SIGN//' | ${TOOL_AWK} -f ${LIBCSRCDIR}/gen/errlist.awk > ${.TARGET} ${TOOL_CAT} ${NETBSDSRCDIR}/sys/sys/errno.h | ${TOOL_SED} 's/(_SIGN//' | ${TOOL_AWK} -f ${LIBCDIR}/gen/errlist.awk > ${.TARGET}
CLEANFILES+= errlist.c CLEANFILES+= errlist.c
.for i in assert.c _errno.c errno.c _env.c errlist.c \ .for i in assert.c _errno.c errno.c _env.c errlist.c \
@ -100,18 +100,18 @@ CLEANFILES+= errlist.c
isfinitef_ieee754.c isfinited_ieee754.c \ isfinitef_ieee754.c isfinited_ieee754.c \
signbitf_ieee754.c signbitd_ieee754.c \ signbitf_ieee754.c signbitd_ieee754.c \
nanf.c nanf.c
.PATH.c .PATH.S: ${ARCHDIR}/gen ${LIBCSRCDIR}/gen/minix \ .PATH.c .PATH.S: ${ARCHDIR}/gen ${LIBCDIR}/gen/minix \
${LIBCSRCDIR}/gen ${LIBCSRCDIR} ${LIBCDIR}/gen ${LIBCDIR}
SRCS+= ${i} SRCS+= ${i}
.endfor .endfor
CPPFLAGS.ctype_.c+= -I${LIBCSRCDIR}/locale CPPFLAGS.ctype_.c+= -I${LIBCDIR}/locale
CPPFLAGS.isctype.c+= -I${LIBCSRCDIR}/locale CPPFLAGS.isctype.c+= -I${LIBCDIR}/locale
CPPFLAGS.tolower_.c+= -I${LIBCSRCDIR}/locale CPPFLAGS.tolower_.c+= -I${LIBCDIR}/locale
CPPFLAGS.toupper_.c+= -I${LIBCSRCDIR}/locale CPPFLAGS.toupper_.c+= -I${LIBCDIR}/locale
# Import from regex # Import from regex
.for i in regcomp.c regerror.c regexec.c regfree.c .for i in regcomp.c regerror.c regexec.c regfree.c
.PATH.c: ${LIBCSRCDIR}/regex .PATH.c: ${LIBCDIR}/regex
SRCS+= ${i} SRCS+= ${i}
.endfor .endfor
@ -119,15 +119,15 @@ SRCS+= ${i}
.for i in strcspn.c strerror.c strerror_r.c strtol.c \ .for i in strcspn.c strerror.c strerror_r.c strtol.c \
bcopy.S bzero.S bcopy.S bzero.S
.PATH.S: ${ARCHDIR}/string .PATH.S: ${ARCHDIR}/string
.PATH.c: ${LIBCSRCDIR}/string .PATH.c: ${LIBCDIR}/string
SRCS+= ${i} SRCS+= ${i}
CPPFLAGS.${i}+= -D_LIBC CPPFLAGS.${i}+= -D_LIBC
.endfor .endfor
CPPFLAGS.strtol.c+= -I${LIBCSRCDIR}/../../common/lib/libc/stdlib CPPFLAGS.strtol.c+= -I${LIBCDIR}/../../common/lib/libc/stdlib
# Import from time # Import from time
.for i in asctime.c localtime.c strftime.c .for i in asctime.c localtime.c strftime.c
.PATH.c: ${LIBCSRCDIR}/time .PATH.c: ${LIBCDIR}/time
SRCS+= ${i} SRCS+= ${i}
.endfor .endfor
@ -137,23 +137,28 @@ SRCS += __aeabi_ldivmod.S __aeabi_uldivmod.S
# Import from locale # Import from locale
.for i in _def_time.c .for i in _def_time.c
.PATH.c: ${LIBCSRCDIR}/locale .PATH.c: ${LIBCDIR}/locale
SRCS+= ${i} SRCS+= ${i}
CPPFLAGS.${i}+= -I${LIBCSRCDIR}/locale CPPFLAGS.${i}+= -I${LIBCDIR}/locale
.endfor .endfor
# Import from sys-minix # Import from sys-minix
.for i in access.c brk.c close.c environ.c execve.c fork.c \ .for i in access.c brk.c close.c environ.c execve.c fork.c \
getgid.c getpid.c getuid.c gettimeofday.c loadname.c \ getgid.c getpid.c geteuid.c getuid.c gettimeofday.c loadname.c \
link.c _mcontext.c mknod.c mmap.c nanosleep.c open.c \ link.c _mcontext.c mknod.c mmap.c nanosleep.c open.c \
read.c sbrk.c select.c setuid.c sigprocmask.c stat.c \ read.c sbrk.c select.c setuid.c sigprocmask.c stat.c \
stime.c syscall.c _ucontext.c umask.c unlink.c waitpid.c \ stime.c syscall.c _ucontext.c umask.c unlink.c waitpid.c \
brksize.S _ipc.S _senda.S ucontext.S mmap.c init.c brksize.S _ipc.S _senda.S ucontext.S mmap.c init.c
.PATH.c: ${LIBCSRCDIR}/sys-minix .PATH.c: ${LIBCDIR}/sys-minix
.PATH.S: ${ARCHDIR}/sys-minix .PATH.S: ${ARCHDIR}/sys-minix
SRCS+= ${i} SRCS+= ${i}
.endfor .endfor
CPPFLAGS+= -D_LIBSYS CPPFLAGS+= -D_LIBSYS
.if exists (${ARCHDIR}/Makefile.inc)
.PATH: ${ARCHDIR}
.include "${ARCHDIR}/Makefile.inc"
.endif
.include <bsd.lib.mk> .include <bsd.lib.mk>

View file

@ -4,12 +4,12 @@ SRCS+= memchr.S memcmp.S memcpy.S memmove.S memset.S \
strncmp.S strrchr.S strncmp.S strrchr.S
.for i in infinityl.c .for i in infinityl.c
.PATH.c: ${LIBCSRCDIR}/arch/${MACHINE_ARCH}/gen .PATH.c: ${LIBCDIR}/arch/${MACHINE_ARCH}/gen
SRCS+= ${i} SRCS+= ${i}
.endfor .endfor
# Import from string # Import from string
.for i in bcmp.S .for i in bcmp.S
.PATH.S: ${LIBCSRCDIR}/arch/${MACHINE_ARCH}/string .PATH.S: ${LIBCDIR}/arch/${MACHINE_ARCH}/string
SRCS+= ${i} SRCS+= ${i}
CPPFLAGS.${i}+= -D_LIBC CPPFLAGS.${i}+= -D_LIBC
.endfor .endfor

View file

@ -700,6 +700,7 @@ setusercontext(login_cap_t *lc, struct passwd *pwd, uid_t uid, u_int flags)
} }
errno = 0; errno = 0;
#ifndef __minix
if (flags & LOGIN_SETLOGIN) if (flags & LOGIN_SETLOGIN)
if (setlogin(pwd->pw_name) == -1) { if (setlogin(pwd->pw_name) == -1) {
syslog(LOG_ERR, "setlogin(%s) failure: %m", syslog(LOG_ERR, "setlogin(%s) failure: %m",
@ -707,6 +708,7 @@ setusercontext(login_cap_t *lc, struct passwd *pwd, uid_t uid, u_int flags)
login_close(flc); login_close(flc);
return (-1); return (-1);
} }
#endif
if (flags & LOGIN_SETUSER) if (flags & LOGIN_SETUSER)
if (setuid(uid) == -1) { if (setuid(uid) == -1) {