Module Name: src Committed By: matt Date: Sun Aug 10 23:25:50 UTC 2014
Modified Files: src/common/lib/libc: Makefile.inc src/lib/csu: Makefile src/lib/libarch: Makefile src/lib/libarch/arm: Makefile.inc src/lib/libm: Makefile src/lib/libposix: Makefile src/lib/libpthread: Makefile Log Message: MKCOMPAT fixes for when compat MACHINE_CPU != normal MACHINE_CPU To generate a diff of this commit: cvs rdiff -u -r1.15 -r1.16 src/common/lib/libc/Makefile.inc cvs rdiff -u -r1.34 -r1.35 src/lib/csu/Makefile cvs rdiff -u -r1.27 -r1.28 src/lib/libarch/Makefile cvs rdiff -u -r1.1 -r1.2 src/lib/libarch/arm/Makefile.inc cvs rdiff -u -r1.162 -r1.163 src/lib/libm/Makefile cvs rdiff -u -r1.16 -r1.17 src/lib/libposix/Makefile cvs rdiff -u -r1.83 -r1.84 src/lib/libpthread/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/common/lib/libc/Makefile.inc diff -u src/common/lib/libc/Makefile.inc:1.15 src/common/lib/libc/Makefile.inc:1.16 --- src/common/lib/libc/Makefile.inc:1.15 Wed Jan 29 23:37:18 2014 +++ src/common/lib/libc/Makefile.inc Sun Aug 10 23:25:49 2014 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.inc,v 1.15 2014/01/29 23:37:18 joerg Exp $ +# $NetBSD: Makefile.inc,v 1.16 2014/08/10 23:25:49 matt Exp $ .include <bsd.own.mk> @@ -9,6 +9,9 @@ COMMON_CODEDIRS+=hash/sha1 hash/sha2 has .if defined(COMMON_MACHINE_ARCH) && !empty(COMMON_MACHINE_ARCH) && \ exists(${COMMON_DIR}/arch/${COMMON_MACHINE_ARCH}) COMMON_ARCHSUBDIR= ${COMMON_MACHINE_ARCH} +.elif defined(COMMON_MACHINE_CPU) && !empty(COMMON_MACHINE_CPU) && \ + exists(${COMMON_DIR}/arch/${COMMON_MACHINE_CPU}) +COMMON_ARCHSUBDIR= ${COMMON_MACHINE_CPU} .elif defined(LIBKERN_ARCH) && !empty(LIBKERN_ARCH) && \ exists(${KERNDIR}/arch/${LIBKERN_ARCH}) COMMON_ARCHSUBDIR= ${LIBKERN_ARCH} Index: src/lib/csu/Makefile diff -u src/lib/csu/Makefile:1.34 src/lib/csu/Makefile:1.35 --- src/lib/csu/Makefile:1.34 Tue Apr 22 13:20:58 2014 +++ src/lib/csu/Makefile Sun Aug 10 23:25:49 2014 @@ -1,17 +1,18 @@ -# $NetBSD: Makefile,v 1.34 2014/04/22 13:20:58 joerg Exp $ +# $NetBSD: Makefile,v 1.35 2014/08/10 23:25:49 matt Exp $ .include <bsd.own.mk> CSU_MACHINE_ARCH?= ${MACHINE_ARCH} +CSU_MACHINE_CPU?= ${MACHINE_CPU} .if !empty(CSU_MACHINE_ARCH:Mearm*) ARCHDIR:= ${.CURDIR}/arch/earm .elif exists(${.CURDIR}/arch/${CSU_MACHINE_ARCH}/Makefile.inc) ARCHDIR:= ${.CURDIR}/arch/${CSU_MACHINE_ARCH} -.elif exists(${.CURDIR}/arch/${MACHINE_CPU}/Makefile.inc) -ARCHDIR:= ${.CURDIR}/arch/${MACHINE_CPU} +.elif exists(${.CURDIR}/arch/${CSU_MACHINE_CPU}/Makefile.inc) +ARCHDIR:= ${.CURDIR}/arch/${CSU_MACHINE_CPU} .else -.error Architecture (${CSU_MACHINE_ARCH} or ${MACHINE_CPU}) unsupported +.error Architecture (${CSU_MACHINE_ARCH} or ${CSU_MACHINE_CPU}) unsupported .endif Index: src/lib/libarch/Makefile diff -u src/lib/libarch/Makefile:1.27 src/lib/libarch/Makefile:1.28 --- src/lib/libarch/Makefile:1.27 Tue Mar 18 18:20:36 2014 +++ src/lib/libarch/Makefile Sun Aug 10 23:25:49 2014 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.27 2014/03/18 18:20:36 riastradh Exp $ +# $NetBSD: Makefile,v 1.28 2014/08/10 23:25:49 matt Exp $ .include <bsd.own.mk> @@ -14,12 +14,14 @@ OBJS+= ${ASM} POBJS+= ${ASM:.o=.po} CLEANFILES+= ${ASM} ${POBJS} +LIBC_MACHINE_CPU?= ${MACHINE_CPU} + # Build the library if SRCS is now defined ... .if defined(SRCS) -.if defined(MLIBDIR) && ${MLIBDIR} != "none" && ${MACHINE_CPU} != "arm" +.if defined(MLIBDIR) && ${MLIBDIR} != "none" && ${LIBC_MACHINE_CPU} != "arm" LIB= ${MLIBDIR} .else -LIB= ${MACHINE_CPU} +LIB= ${LIBC_MACHINE_CPU} .endif SHLIB_VERSION_FILE= ${.CURDIR}/${LIB}/shlib_version Index: src/lib/libarch/arm/Makefile.inc diff -u src/lib/libarch/arm/Makefile.inc:1.1 src/lib/libarch/arm/Makefile.inc:1.2 --- src/lib/libarch/arm/Makefile.inc:1.1 Sat Mar 30 06:24:34 2002 +++ src/lib/libarch/arm/Makefile.inc Sun Aug 10 23:25:50 2014 @@ -1,8 +1,10 @@ -# $NetBSD: Makefile.inc,v 1.1 2002/03/30 06:24:34 thorpej Exp $ +# $NetBSD: Makefile.inc,v 1.2 2014/08/10 23:25:50 matt Exp $ .include <bsd.own.mk> -.if (${MACHINE_CPU} == "arm") +LIBC_MACHINE_CPU?= ${MACHINE_CPU} + +.if (${LIBC_MACHINE_CPU} == "arm") SRCS+= arm_sync_icache.c arm_drain_writebuf.c .endif Index: src/lib/libm/Makefile diff -u src/lib/libm/Makefile:1.162 src/lib/libm/Makefile:1.163 --- src/lib/libm/Makefile:1.162 Sun Aug 10 20:48:34 2014 +++ src/lib/libm/Makefile Sun Aug 10 23:25:50 2014 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.162 2014/08/10 20:48:34 joerg Exp $ +# $NetBSD: Makefile,v 1.163 2014/08/10 23:25:50 matt Exp $ # # @(#)Makefile 5.1beta 93/09/24 # @@ -47,10 +47,13 @@ USE_SHLIBDIR= yes # require this for the value of I387_LIBM from mk.conf, if set. .include <bsd.own.mk> +LIBC_MACHINE_ARCH?= ${MACHINE_ARCH} +LIBC_MACHINE_CPU?= ${MACHINE_CPU} + # compiler_rt uses typeof() and __extension__ LINTFLAGS += -g -.if (${MACHINE_CPU} == "aarch64") +.if (${LIBC_MACHINE_CPU} == "aarch64") .PATH: ${.CURDIR}/arch/aarch64 ARCH_SRCS = e_sqrt.S e_sqrtf.S s_fabsf.S ARCH_SRCS+= s_fma.S s_fmaf.S s_fmax.S s_fmaxf.S s_fmin.S s_fminf.S @@ -58,11 +61,11 @@ COPTS.e_sqrtl.c += -DHAVE_FENV_H COMMON_SRCS+= fenv.c COMMON_SRCS+= e_sqrtl.c COMMON_SRCS+= s_fma.c s_fmaf.c s_fmal.c -.elif (${MACHINE_ARCH} == "alpha") +.elif (${LIBC_MACHINE_ARCH} == "alpha") .PATH: ${.CURDIR}/arch/alpha ARCH_SRCS = s_copysign.S s_copysignf.S lrint.S COPTS+= -mfloat-ieee -mieee-with-inexact -mfp-trap-mode=sui -mtrap-precision=i -.elif (${MACHINE_CPU} == "arm") +.elif (${LIBC_MACHINE_CPU} == "arm") .PATH: ${.CURDIR}/arch/arm COMMON_SRCS+= fenv.c s_nexttowardf.c \ s_nearbyint.c s_rintl.c @@ -75,12 +78,12 @@ ARCH_SRCS = e_sqrt.S e_sqrtf.S lrint.S l ${i} ${i:.o=.po} ${i:.o=.pico} ${i:.o=.go} ${i:.o=.ln}: ${i:.o=.c} .endfor .endif -.elif (${MACHINE_ARCH} == "sparc") +.elif (${LIBC_MACHINE_ARCH} == "sparc") .PATH: ${.CURDIR}/arch/sparc COMMON_SRCS+= fenv.c COPTS.e_sqrtl.c += -DHAVE_FENV_H COMMON_SRCS+= s_fma.c s_fmaf.c s_fmal.c -.elif (${MACHINE_ARCH} == "sparc64") +.elif (${LIBC_MACHINE_ARCH} == "sparc64") .PATH: ${.CURDIR}/arch/sparc64 COMMON_SRCS+= fenv.c s_nexttowardf.c \ s_nearbyint.c s_rintl.c @@ -89,9 +92,9 @@ COPTS.e_sqrtl.c += -DHAVE_FENV_H COMMON_SRCS+= s_nexttoward.c .endif COMMON_SRCS+= s_fma.c s_fmaf.c s_fmal.c -.elif ((${MACHINE_ARCH} == "i386") || (${MACHINE_ARCH} == "x86_64")) +.elif ((${LIBC_MACHINE_ARCH} == "i386") || (${LIBC_MACHINE_ARCH} == "x86_64")) -.if (${MACHINE_ARCH} == "x86_64") +.if (${LIBC_MACHINE_ARCH} == "x86_64") .PATH: ${.CURDIR}/arch/x86_64 .endif .PATH: ${.CURDIR}/arch/i387 @@ -113,10 +116,10 @@ ARCH_SRCS = e_acos.S e_asin.S e_atan2.S # do not pick up the i387 asm version, it is incorrect s_modf.o s_modf.pico s_modf.po s_modf.d: s_modf.c -.if (${MACHINE_ARCH} == "i386") +.if (${LIBC_MACHINE_ARCH} == "i386") SUBDIR=arch/i387 .endif -.elif (${MACHINE_ARCH} == "m68k") +.elif (${LIBC_MACHINE_ARCH} == "m68k") .if defined(M68060) .PATH: ${.CURDIR}/arch/m68060 .include "${.CURDIR}/arch/m68060/Makefile.list" @@ -137,7 +140,7 @@ ARCH_SRCS = e_acos.S e_asin.S e_atanh.S .endif .endif # end of m68k -.elif (${MACHINE_ARCH} == "vax") +.elif (${LIBC_MACHINE_ARCH} == "vax") .PATH: ${.CURDIR}/arch/vax #NOIEEE_ARCH= n_infnan.S n_argred.S n_sqrt.S @@ -154,11 +157,11 @@ WARNS?=5 .PATH: ${.CURDIR}/src .PATH: ${.CURDIR}/noieee_src -.if (${MACHINE_ARCH} == "alpha") +.if (${LIBC_MACHINE_ARCH} == "alpha") COPTS+= -mfp-rounding-mode=d .endif -.if (${MACHINE_ARCH} != "vax") +.if (${LIBC_MACHINE_ARCH} != "vax") CPPFLAGS+= -D_MULTI_LIBM -D_POSIX_MODE # XXX noieee libm is gross COPTS+= -fno-strict-aliasing @@ -229,7 +232,7 @@ NOIEEE_SRCS = n_asincos.c n_acosh.c n_as # NetBSD's C library supplies these functions: #COMMON_SRCS+= s_fabs.c s_frexp.c s_isinf.c s_isnan.c s_ldexp.c s_modf.c -.if (${MACHINE_ARCH} == "vax") +.if (${LIBC_MACHINE_ARCH} == "vax") SRCS= ${NOIEEE_SRCS} ${NOIEEE_ARCH} .else SRCS= ${COMMON_SRCS} @@ -244,13 +247,13 @@ SRCS+= ${ARCH_ADDS} SRCS:=${SRCS:S/^${i:S/.S/.c/}/$i/} .endfor -.if (${MACHINE_ARCH} == "vax") # XXX until POLYD is written. +.if (${LIBC_MACHINE_ARCH} == "vax") # XXX until POLYD is written. .PATH: ${.CURDIR}/arch/vax SRCS:=${SRCS} n_sqrt.S n_argred.S n_infnan.S n_atan2.S n_cabs.S n_cbrt.S \ n_support.S n_scalbn.S .endif -.if (${MACHINE_ARCH} == "i386") +.if (${LIBC_MACHINE_ARCH} == "i386") # XXX this gets miscompiled. There should be a better fix. COPTS.s_tanh.c+= -O0 .endif Index: src/lib/libposix/Makefile diff -u src/lib/libposix/Makefile:1.16 src/lib/libposix/Makefile:1.17 --- src/lib/libposix/Makefile:1.16 Thu Oct 27 19:56:50 2011 +++ src/lib/libposix/Makefile Sun Aug 10 23:25:49 2014 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.16 2011/10/27 19:56:50 christos Exp $ +# $NetBSD: Makefile,v 1.17 2014/08/10 23:25:49 matt Exp $ LIB= posix @@ -14,7 +14,7 @@ CPPFLAGS+=-I${NETBSDSRCDIR}/sys AFLAGS+=-I${ARCHDIR} -.if ${MACHINE_ARCH} == "powerpc64" +.if ${LIBC_MACHINE_ARCH} == "powerpc64" # XXX: How come it does not resolve from libc? .PATH.c: ${NETBSDSRCDIR}/lib/libc/gen SRCS+= _errno.c Index: src/lib/libpthread/Makefile diff -u src/lib/libpthread/Makefile:1.83 src/lib/libpthread/Makefile:1.84 --- src/lib/libpthread/Makefile:1.83 Wed Oct 9 22:33:41 2013 +++ src/lib/libpthread/Makefile Sun Aug 10 23:25:49 2014 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.83 2013/10/09 22:33:41 matt Exp $ +# $NetBSD: Makefile,v 1.84 2014/08/10 23:25:49 matt Exp $ # WARNS?= 5 @@ -8,6 +8,9 @@ WARNS?= 5 .if defined(PTHREAD_MACHINE_ARCH) && !empty(PTHREAD_MACHINE_ARCH) && \ exists(${.CURDIR}/arch/${PTHREAD_MACHINE_ARCH}) ARCHSUBDIR= ${PTHREAD_MACHINE_ARCH} +.elif defined(PTHREAD_MACHINE_CPU) && !empty(PTHREAD_MACHINE_CPU) && \ + exists(${.CURDIR}/arch/${PTHREAD_MACHINE_CPU}) +ARCHSUBDIR= ${PTHREAD_MACHINE_CPU} .elif exists(${.CURDIR}/arch/${MACHINE_ARCH}) ARCHSUBDIR= ${MACHINE_ARCH} .elif exists(${.CURDIR}/arch/${MACHINE_CPU})