From d1b3ab953e42970d043bc938bf8bbf2b5454ecdd Mon Sep 17 00:00:00 2001 From: Ben Gras Date: Sat, 15 Jun 2013 23:43:39 +0000 Subject: [PATCH] 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 --- lib/libc/arch/arm/Makefile.inc | 4 ++ lib/libc/softfloat/Makefile.inc | 9 +++++ lib/libminc/Makefile | 53 ++++++++++++++----------- lib/libminc/arch/i386/Makefile.libc.inc | 4 +- lib/libutil/login_cap.c | 2 + 5 files changed, 46 insertions(+), 26 deletions(-) diff --git a/lib/libc/arch/arm/Makefile.inc b/lib/libc/arch/arm/Makefile.inc index 0d5c191c8..679031c71 100644 --- a/lib/libc/arch/arm/Makefile.inc +++ b/lib/libc/arch/arm/Makefile.inc @@ -21,4 +21,8 @@ SRCS+= fixunsgen64_ieee754.c fixunsdfsi_ieee754.c SOFTFLOAT_BITS=32 .endif +.if defined(__MINIX) +.include "${LIBCDIR}/softfloat/Makefile.inc" +.else .include +.endif diff --git a/lib/libc/softfloat/Makefile.inc b/lib/libc/softfloat/Makefile.inc index d31d18768..33dbd3f30 100644 --- a/lib/libc/softfloat/Makefile.inc +++ b/lib/libc/softfloat/Makefile.inc @@ -1,10 +1,19 @@ # $NetBSD: Makefile.inc,v 1.10 2011/07/04 02:53:15 mrg Exp $ SOFTFLOAT_BITS?=64 +.if defined(__MINIX) +.PATH: ${ARCHDIR}/softfloat \ + ${LIBCDIR}/softfloat/bits${SOFTFLOAT_BITS} ${LIBCDIR}/softfloat +.else .PATH: ${ARCHDIR}/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 +.endif CPPFLAGS+= -DSOFTFLOAT_FOR_GCC SRCS.softfloat= softfloat.c diff --git a/lib/libminc/Makefile b/lib/libminc/Makefile index 442b848be..cc4bbf79f 100644 --- a/lib/libminc/Makefile +++ b/lib/libminc/Makefile @@ -8,11 +8,11 @@ LIB= minc CPPFLAGS.sched_start.c+= -I${NETBSDSRCDIR} -LIBCSRCDIR= ${NETBSDSRCDIR}/lib/libc -CPPFLAGS+= -I${LIBCSRCDIR}/include -I${LIBCSRCDIR} +LIBCDIR= ${NETBSDSRCDIR}/lib/libc +CPPFLAGS+= -I${LIBCDIR}/include -I${LIBCDIR} CPPFLAGS+= -D_LIBMINC -ARCHDIR?= ${LIBCSRCDIR}/arch/${MACHINE_CPU} +ARCHDIR?= ${LIBCDIR}/arch/${MACHINE_CPU} # # Customized versions of libc functions. # @@ -63,7 +63,7 @@ CPPFLAGS.strlcpy.c+= -D_LIBC # Import from misc (_libc_init symbols) .for i in initfini.c stack_protector.c -.PATH.c: ${LIBCSRCDIR}/misc +.PATH.c: ${LIBCDIR}/misc SRCS+= ${i} CPPFLAGS.${i}+= -Dxprintf=printf .endfor @@ -71,23 +71,23 @@ CPPFLAGS.${i}+= -Dxprintf=printf # Import from stdio .for i in findfp.c sprintf.c fprintf.c perror.c vsnprintf.c snprintf.c \ _rand48.c lrand48.c srand48.c -.PATH.c: ${LIBCSRCDIR}/stdio -CPPFLAGS.${i}= -I${LIBCSRCDIR}/stdio +.PATH.c: ${LIBCDIR}/stdio +CPPFLAGS.${i}= -I${LIBCDIR}/stdio SRCS+= ${i} .endfor # Import from stdlib .for i in abort.c atexit.c atoi.c exit.c getenv.c \ getopt.c ldiv.c malloc.c -.PATH.c: ${LIBCSRCDIR}/stdlib +.PATH.c: ${LIBCDIR}/stdlib SRCS+= ${i} -CPPFLAGS.${i}+= -I${LIBCSRCDIR}/stdlib +CPPFLAGS.${i}+= -I${LIBCDIR}/stdlib .endfor # Import from gen -errlist.c: ${LIBCSRCDIR}/gen/errlist.awk \ +errlist.c: ${LIBCDIR}/gen/errlist.awk \ ${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 .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 \ signbitf_ieee754.c signbitd_ieee754.c \ nanf.c -.PATH.c .PATH.S: ${ARCHDIR}/gen ${LIBCSRCDIR}/gen/minix \ - ${LIBCSRCDIR}/gen ${LIBCSRCDIR} +.PATH.c .PATH.S: ${ARCHDIR}/gen ${LIBCDIR}/gen/minix \ + ${LIBCDIR}/gen ${LIBCDIR} SRCS+= ${i} .endfor -CPPFLAGS.ctype_.c+= -I${LIBCSRCDIR}/locale -CPPFLAGS.isctype.c+= -I${LIBCSRCDIR}/locale -CPPFLAGS.tolower_.c+= -I${LIBCSRCDIR}/locale -CPPFLAGS.toupper_.c+= -I${LIBCSRCDIR}/locale +CPPFLAGS.ctype_.c+= -I${LIBCDIR}/locale +CPPFLAGS.isctype.c+= -I${LIBCDIR}/locale +CPPFLAGS.tolower_.c+= -I${LIBCDIR}/locale +CPPFLAGS.toupper_.c+= -I${LIBCDIR}/locale # Import from regex .for i in regcomp.c regerror.c regexec.c regfree.c -.PATH.c: ${LIBCSRCDIR}/regex +.PATH.c: ${LIBCDIR}/regex SRCS+= ${i} .endfor @@ -119,15 +119,15 @@ SRCS+= ${i} .for i in strcspn.c strerror.c strerror_r.c strtol.c \ bcopy.S bzero.S .PATH.S: ${ARCHDIR}/string -.PATH.c: ${LIBCSRCDIR}/string +.PATH.c: ${LIBCDIR}/string SRCS+= ${i} CPPFLAGS.${i}+= -D_LIBC .endfor -CPPFLAGS.strtol.c+= -I${LIBCSRCDIR}/../../common/lib/libc/stdlib +CPPFLAGS.strtol.c+= -I${LIBCDIR}/../../common/lib/libc/stdlib # Import from time .for i in asctime.c localtime.c strftime.c -.PATH.c: ${LIBCSRCDIR}/time +.PATH.c: ${LIBCDIR}/time SRCS+= ${i} .endfor @@ -137,23 +137,28 @@ SRCS += __aeabi_ldivmod.S __aeabi_uldivmod.S # Import from locale .for i in _def_time.c -.PATH.c: ${LIBCSRCDIR}/locale +.PATH.c: ${LIBCDIR}/locale SRCS+= ${i} -CPPFLAGS.${i}+= -I${LIBCSRCDIR}/locale +CPPFLAGS.${i}+= -I${LIBCDIR}/locale .endfor # Import from sys-minix .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 \ read.c sbrk.c select.c setuid.c sigprocmask.c stat.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 -.PATH.c: ${LIBCSRCDIR}/sys-minix +.PATH.c: ${LIBCDIR}/sys-minix .PATH.S: ${ARCHDIR}/sys-minix SRCS+= ${i} .endfor CPPFLAGS+= -D_LIBSYS +.if exists (${ARCHDIR}/Makefile.inc) +.PATH: ${ARCHDIR} +.include "${ARCHDIR}/Makefile.inc" +.endif + .include diff --git a/lib/libminc/arch/i386/Makefile.libc.inc b/lib/libminc/arch/i386/Makefile.libc.inc index c22501b4b..8ad9600a0 100644 --- a/lib/libminc/arch/i386/Makefile.libc.inc +++ b/lib/libminc/arch/i386/Makefile.libc.inc @@ -4,12 +4,12 @@ SRCS+= memchr.S memcmp.S memcpy.S memmove.S memset.S \ strncmp.S strrchr.S .for i in infinityl.c -.PATH.c: ${LIBCSRCDIR}/arch/${MACHINE_ARCH}/gen +.PATH.c: ${LIBCDIR}/arch/${MACHINE_ARCH}/gen SRCS+= ${i} .endfor # Import from string .for i in bcmp.S -.PATH.S: ${LIBCSRCDIR}/arch/${MACHINE_ARCH}/string +.PATH.S: ${LIBCDIR}/arch/${MACHINE_ARCH}/string SRCS+= ${i} CPPFLAGS.${i}+= -D_LIBC .endfor diff --git a/lib/libutil/login_cap.c b/lib/libutil/login_cap.c index 593888e40..915884eaa 100644 --- a/lib/libutil/login_cap.c +++ b/lib/libutil/login_cap.c @@ -700,6 +700,7 @@ setusercontext(login_cap_t *lc, struct passwd *pwd, uid_t uid, u_int flags) } errno = 0; +#ifndef __minix if (flags & LOGIN_SETLOGIN) if (setlogin(pwd->pw_name) == -1) { 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); return (-1); } +#endif if (flags & LOGIN_SETUSER) if (setuid(uid) == -1) {