From owner-svn-src-all@FreeBSD.ORG Tue Aug 24 20:54:44 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 11F2410656A6; Tue, 24 Aug 2010 20:54:44 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F37938FC27; Tue, 24 Aug 2010 20:54:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7OKshk0087595; Tue, 24 Aug 2010 20:54:43 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7OKshRm087585; Tue, 24 Aug 2010 20:54:43 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201008242054.o7OKshRm087585@svn.freebsd.org> From: Warner Losh Date: Tue, 24 Aug 2010 20:54:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211774 - in head/lib/libc: . compat-43 gen locale quad softfloat stdlib string sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Aug 2010 20:54:44 -0000 Author: imp Date: Tue Aug 24 20:54:43 2010 New Revision: 211774 URL: http://svn.freebsd.org/changeset/base/211774 Log: Powerpc is special here. powerpc and powerpc64 use different ABIs, so their implementations aren't in the same files. Introduce LIBC_ARCH and use that in preference to MACHINE_CPUARCH. Tested by amd64 and powerpc64 builds (thanks nathanw@) Modified: head/lib/libc/Makefile head/lib/libc/compat-43/Makefile.inc head/lib/libc/gen/Makefile.inc head/lib/libc/locale/Makefile.inc head/lib/libc/quad/Makefile.inc head/lib/libc/softfloat/Makefile.inc head/lib/libc/stdlib/Makefile.inc head/lib/libc/string/Makefile.inc head/lib/libc/sys/Makefile.inc Modified: head/lib/libc/Makefile ============================================================================== --- head/lib/libc/Makefile Tue Aug 24 20:50:08 2010 (r211773) +++ head/lib/libc/Makefile Tue Aug 24 20:54:43 2010 (r211774) @@ -5,6 +5,15 @@ SHLIBDIR?= /lib .include +# We have to special case powerpc and powerpc64, since they mostly have +# the same source implementation. libc is very different due to large +# ABI differences. +.if ${LIBC_ARCH} == "powerpc" +LIBC_ARCH=${MACHINE_ARCH} +.else +LIBC_ARCH=${LIBC_ARCH} +.endif + # All library objects contain FreeBSD revision strings by default; they may be # excluded as a space-saving measure. To produce a library that does # not contain these strings, add -DSTRIP_FBSDID (see ) to CFLAGS @@ -15,7 +24,7 @@ LIB=c SHLIB_MAJOR= 7 WARNS?= 2 CFLAGS+=-I${.CURDIR}/include -I${.CURDIR}/../../include -CFLAGS+=-I${.CURDIR}/${MACHINE_CPUARCH} +CFLAGS+=-I${.CURDIR}/${LIBC_ARCH} CFLAGS+=-DNLS CLEANFILES+=tags INSTALL_PIC_ARCHIVE= @@ -36,7 +45,7 @@ MDASM= MIASM= NOASM= -.include "${.CURDIR}/${MACHINE_CPUARCH}/Makefile.inc" +.include "${.CURDIR}/${LIBC_ARCH}/Makefile.inc" .include "${.CURDIR}/db/Makefile.inc" .include "${.CURDIR}/compat-43/Makefile.inc" .include "${.CURDIR}/gdtoa/Makefile.inc" @@ -49,14 +58,14 @@ NOASM= .include "${.CURDIR}/net/Makefile.inc" .include "${.CURDIR}/nls/Makefile.inc" .include "${.CURDIR}/posix1e/Makefile.inc" -.if ${MACHINE_CPUARCH} != "amd64" && \ - ${MACHINE_CPUARCH} != "ia64" && \ - ${MACHINE_ARCH} != "powerpc64" && \ - ${MACHINE_CPUARCH} != "sparc64" && \ - ${MACHINE_CPUARCH} != "mips" +.if ${LIBC_ARCH} != "amd64" && \ + ${LIBC_ARCH} != "ia64" && \ + ${LIBC_ARCH} != "powerpc64" && \ + ${LIBC_ARCH} != "sparc64" && \ + ${LIBC_ARCH} != "mips" .include "${.CURDIR}/quad/Makefile.inc" .endif -.if ${MACHINE_ARCH} == "mips" && \ +.if ${LIBC_ARCH} == "mips" && \ (!defined(TARGET_ABI) || ${TARGET_ABI} == "o32") .include "${.CURDIR}/quad/Makefile.inc" .endif @@ -70,7 +79,7 @@ NOASM= .include "${.CURDIR}/rpc/Makefile.inc" .include "${.CURDIR}/uuid/Makefile.inc" .include "${.CURDIR}/xdr/Makefile.inc" -.if ${MACHINE_CPUARCH} == "arm" || ${MACHINE_CPUARCH} == "mips" +.if ${LIBC_ARCH} == "arm" || ${LIBC_ARCH} == "mips" .include "${.CURDIR}/softfloat/Makefile.inc" .endif .if ${MK_NIS} != "no" @@ -115,14 +124,14 @@ KQSRCS= adddi3.c anddi3.c ashldi3.c ashr KSRCS= bcmp.c ffs.c ffsl.c fls.c flsl.c index.c mcount.c rindex.c \ strcat.c strcmp.c strcpy.c strlen.c strncpy.c -libkern: libkern.gen libkern.${MACHINE_CPUARCH} +libkern: libkern.gen libkern.${LIBC_ARCH} libkern.gen: ${KQSRCS} ${KSRCS} cp -p ${.CURDIR}/quad/quad.h ${.ALLSRC} ${DESTDIR}/sys/libkern -libkern.${MACHINE_CPUARCH}:: ${KMSRCS} +libkern.${LIBC_ARCH}:: ${KMSRCS} .if defined(KMSRCS) && !empty(KMSRCS) - cp -p ${.ALLSRC} ${DESTDIR}/sys/libkern/${MACHINE_CPUARCH} + cp -p ${.ALLSRC} ${DESTDIR}/sys/libkern/${LIBC_ARCH} .endif .include Modified: head/lib/libc/compat-43/Makefile.inc ============================================================================== --- head/lib/libc/compat-43/Makefile.inc Tue Aug 24 20:50:08 2010 (r211773) +++ head/lib/libc/compat-43/Makefile.inc Tue Aug 24 20:54:43 2010 (r211774) @@ -2,7 +2,7 @@ # $FreeBSD$ # compat-43 sources -.PATH: ${.CURDIR}/${MACHINE_CPUARCH}/compat-43 ${.CURDIR}/compat-43 +.PATH: ${.CURDIR}/${LIBC_ARCH}/compat-43 ${.CURDIR}/compat-43 SRCS+= creat.c gethostid.c getwd.c killpg.c sethostid.c setpgrp.c \ setrgid.c setruid.c sigcompat.c Modified: head/lib/libc/gen/Makefile.inc ============================================================================== --- head/lib/libc/gen/Makefile.inc Tue Aug 24 20:50:08 2010 (r211773) +++ head/lib/libc/gen/Makefile.inc Tue Aug 24 20:54:43 2010 (r211774) @@ -2,7 +2,7 @@ # $FreeBSD$ # machine-independent gen sources -.PATH: ${.CURDIR}/${MACHINE_CPUARCH}/gen ${.CURDIR}/gen +.PATH: ${.CURDIR}/${LIBC_ARCH}/gen ${.CURDIR}/gen SRCS+= __getosreldate.c __xuname.c \ _once_stub.c _pthread_stubs.c _rand48.c _spinlock_stub.c \ @@ -38,9 +38,7 @@ SRCS+= __getosreldate.c __xuname.c \ SYM_MAPS+=${.CURDIR}/gen/Symbol.map # machine-dependent gen sources -.if exists(${.CURDIR}/${MACHINE_CPUARCH}/gen/Makefile.inc) -.include "${.CURDIR}/${MACHINE_CPUARCH}/gen/Makefile.inc" -.endif +.sinclude "${.CURDIR}/${LIBC_ARCH}/gen/Makefile.inc" MAN+= alarm.3 arc4random.3 \ basename.3 check_utility_compat.3 clock.3 \ Modified: head/lib/libc/locale/Makefile.inc ============================================================================== --- head/lib/libc/locale/Makefile.inc Tue Aug 24 20:50:08 2010 (r211773) +++ head/lib/libc/locale/Makefile.inc Tue Aug 24 20:54:43 2010 (r211774) @@ -2,7 +2,7 @@ # $FreeBSD$ # locale sources -.PATH: ${.CURDIR}/${MACHINE_CPUARCH}/locale ${.CURDIR}/locale +.PATH: ${.CURDIR}/${LIBC_ARCH}/locale ${.CURDIR}/locale SRCS+= ascii.c big5.c btowc.c collate.c collcmp.c euc.c fix_grouping.c \ gb18030.c gb2312.c gbk.c isctype.c iswctype.c \ Modified: head/lib/libc/quad/Makefile.inc ============================================================================== --- head/lib/libc/quad/Makefile.inc Tue Aug 24 20:50:08 2010 (r211773) +++ head/lib/libc/quad/Makefile.inc Tue Aug 24 20:54:43 2010 (r211774) @@ -2,9 +2,9 @@ # $FreeBSD$ # Quad support, if needed -.PATH: ${.CURDIR}/${MACHINE_CPUARCH}/quad ${.CURDIR}/quad +.PATH: ${.CURDIR}/${LIBC_ARCH}/quad ${.CURDIR}/quad -.if ${MACHINE_CPUARCH} == "i386" +.if ${LIBC_ARCH} == "i386" SRCS+= cmpdi2.c divdi3.c moddi3.c qdivrem.c ucmpdi2.c udivdi3.c umoddi3.c Modified: head/lib/libc/softfloat/Makefile.inc ============================================================================== --- head/lib/libc/softfloat/Makefile.inc Tue Aug 24 20:50:08 2010 (r211773) +++ head/lib/libc/softfloat/Makefile.inc Tue Aug 24 20:54:43 2010 (r211774) @@ -2,10 +2,10 @@ # $FreeBSD$ SOFTFLOAT_BITS?=64 -.PATH: ${MACHINE_CPUARCH}/softfloat \ +.PATH: ${LIBC_ARCH}/softfloat \ ${.CURDIR}/softfloat/bits${SOFTFLOAT_BITS} ${.CURDIR}/softfloat -CFLAGS+= -I${.CURDIR}/${MACHINE_CPUARCH}/softfloat -I${.CURDIR}/softfloat +CFLAGS+= -I${.CURDIR}/${LIBC_ARCH}/softfloat -I${.CURDIR}/softfloat CFLAGS+= -DSOFTFLOAT_FOR_GCC SRCS+= softfloat.c Modified: head/lib/libc/stdlib/Makefile.inc ============================================================================== --- head/lib/libc/stdlib/Makefile.inc Tue Aug 24 20:50:08 2010 (r211773) +++ head/lib/libc/stdlib/Makefile.inc Tue Aug 24 20:54:43 2010 (r211774) @@ -2,7 +2,7 @@ # $FreeBSD$ # machine-independent stdlib sources -.PATH: ${.CURDIR}/${MACHINE_CPUARCH}/stdlib ${.CURDIR}/stdlib +.PATH: ${.CURDIR}/${LIBC_ARCH}/stdlib ${.CURDIR}/stdlib MISRCS+=_Exit.c a64l.c abort.c abs.c atexit.c atof.c atoi.c atol.c atoll.c \ bsearch.c div.c exit.c getenv.c getopt.c getopt_long.c \ @@ -16,7 +16,7 @@ MISRCS+=_Exit.c a64l.c abort.c abs.c ate SYM_MAPS+= ${.CURDIR}/stdlib/Symbol.map # machine-dependent stdlib sources -.sinclude "${.CURDIR}/${MACHINE_CPUARCH}/stdlib/Makefile.inc" +.sinclude "${.CURDIR}/${LIBC_ARCH}/stdlib/Makefile.inc" MAN+= a64l.3 abort.3 abs.3 alloca.3 atexit.3 atof.3 atoi.3 atol.3 bsearch.3 \ div.3 exit.3 getenv.3 getopt.3 getopt_long.3 getsubopt.3 \ Modified: head/lib/libc/string/Makefile.inc ============================================================================== --- head/lib/libc/string/Makefile.inc Tue Aug 24 20:50:08 2010 (r211773) +++ head/lib/libc/string/Makefile.inc Tue Aug 24 20:54:43 2010 (r211774) @@ -1,7 +1,7 @@ # @(#)Makefile.inc 8.1 (Berkeley) 6/4/93 # $FreeBSD$ -.PATH: ${.CURDIR}/${MACHINE_CPUARCH}/string ${.CURDIR}/string +.PATH: ${.CURDIR}/${LIBC_ARCH}/string ${.CURDIR}/string CFLAGS+= -I${.CURDIR}/locale @@ -26,9 +26,7 @@ SYM_MAPS+= ${.CURDIR}/string/Symbol.map # machine-dependent string sources -.if exists(${.CURDIR}/${MACHINE_CPUARCH}/string/Makefile.inc) -.include "${.CURDIR}/${MACHINE_CPUARCH}/string/Makefile.inc" -.endif +.sinclude "${.CURDIR}/${LIBC_ARCH}/string/Makefile.inc" MAN+= bcmp.3 bcopy.3 bstring.3 bzero.3 ffs.3 index.3 memccpy.3 memchr.3 \ memcmp.3 memcpy.3 memmem.3 memmove.3 memset.3 strcasecmp.3 strcat.3 \ Modified: head/lib/libc/sys/Makefile.inc ============================================================================== --- head/lib/libc/sys/Makefile.inc Tue Aug 24 20:50:08 2010 (r211773) +++ head/lib/libc/sys/Makefile.inc Tue Aug 24 20:54:43 2010 (r211774) @@ -2,7 +2,7 @@ # $FreeBSD$ # sys sources -.PATH: ${.CURDIR}/${MACHINE_CPUARCH}/sys ${.CURDIR}/sys +.PATH: ${.CURDIR}/${LIBC_ARCH}/sys ${.CURDIR}/sys # Include the generated makefile containing the *complete* list # of syscall names in MIASM. @@ -13,9 +13,7 @@ # MDASM names override the default syscall names in MIASM. # NOASM will prevent the default syscall code from being generated. # -.if exists(${.CURDIR}/${MACHINE_CPUARCH}/sys/Makefile.inc) -.include "${.CURDIR}/${MACHINE_CPUARCH}/sys/Makefile.inc" -.endif +.sinclude "${.CURDIR}/${LIBC_ARCH}/sys/Makefile.inc" # Sources common to both syscall interfaces: SRCS+= stack_protector.c stack_protector_compat.c __error.c