MKCOMPAT fixes for when compat MACHINE_CPU != normal MACHINE_CPU

This commit is contained in:
matt 2014-08-10 23:25:49 +00:00
parent 5d708bdeab
commit 11614bb2b2
7 changed files with 43 additions and 29 deletions

View File

@ -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 hash/rmd160 hash/murmurhash
.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}

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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 lrintf.S s_fabsf.S s_fma.S s_fmaf.S
${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 e_exp.S e_expf.S e_fmod.S e_log.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 e_cosh.S e_exp.S e_fmod.S e_log.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_asinh.c n_atan.c n_atanh.c n_cosh.c \
# 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

View File

@ -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

View File

@ -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})