From owner-svn-src-all@FreeBSD.ORG Tue Dec 18 07:26:56 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5DD1EF9F; Tue, 18 Dec 2012 07:26:56 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4314B8FC0A; Tue, 18 Dec 2012 07:26:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBI7QuGS083973; Tue, 18 Dec 2012 07:26:56 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBI7Qt7T083968; Tue, 18 Dec 2012 07:26:55 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201212180726.qBI7Qt7T083968@svn.freebsd.org> From: Andrew Turner Date: Tue, 18 Dec 2012 07:26:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244382 - in head: gnu/lib/libgcc lib/libcompiler_rt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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, 18 Dec 2012 07:26:56 -0000 Author: andrew Date: Tue Dec 18 07:26:55 2012 New Revision: 244382 URL: http://svnweb.freebsd.org/changeset/base/244382 Log: Get libcompiler-rt and libgcc building on ARM with clang. * Don't provide clear_cache or the __sync_* functions on ARM with clang as they are provided by clang as builtin functions. * Tell clang it is aloud to compile some libgcc code using heinous GCC extensions. Modified: head/gnu/lib/libgcc/Makefile head/lib/libcompiler_rt/Makefile Modified: head/gnu/lib/libgcc/Makefile ============================================================================== --- head/gnu/lib/libgcc/Makefile Tue Dec 18 07:15:03 2012 (r244381) +++ head/gnu/lib/libgcc/Makefile Tue Dec 18 07:26:55 2012 (r244382) @@ -38,13 +38,16 @@ OBJS= # added to below in various ways # # Library members defined in libgcc2.c. LIB2FUNCS= _muldi3 _negdi2 _lshrdi3 _ashldi3 _ashrdi3 \ - _cmpdi2 _ucmpdi2 _clear_cache \ + _cmpdi2 _ucmpdi2 \ _enable_execute_stack _trampoline __main _absvsi2 _absvdi2 _addvsi3 \ _addvdi3 _subvsi3 _subvdi3 _mulvsi3 _mulvdi3 _negvsi2 _negvdi2 _ctors \ _ffssi2 _ffsdi2 _clz _clzsi2 _clzdi2 _ctzsi2 _ctzdi2 _popcount_tab \ _popcountsi2 _popcountdi2 _paritysi2 _paritydi2 _powisf2 _powidf2 \ _powixf2 _powitf2 _mulsc3 _muldc3 _mulxc3 _multc3 _divsc3 _divdc3 \ _divxc3 _divtc3 +.if ${COMPILER_TYPE} != "clang" || ${TARGET_CPUARCH} != "arm" +LIB2FUNCS+= _clear_cache +.endif # The floating-point conversion routines that involve a single-word integer. .for mode in sf df xf @@ -106,6 +109,10 @@ LIB2_DIVMOD_FUNCS = _divdi3 _moddi3 _udi .if ${TARGET_CPUARCH} == "arm" # from config/arm/t-strongarm-elf CFLAGS+= -Dinhibit_libc -fno-inline +.if ${COMPILER_TYPE} == "clang" +CFLAGS+= -fheinous-gnu-extensions +.endif + LIB1ASMSRC = lib1funcs.asm LIB1ASMFUNCS = _dvmd_tls _bb_init_func LIB2FUNCS_EXTRA = floatunsidf.c floatunsisf.c Modified: head/lib/libcompiler_rt/Makefile ============================================================================== --- head/lib/libcompiler_rt/Makefile Tue Dec 18 07:15:03 2012 (r244381) +++ head/lib/libcompiler_rt/Makefile Tue Dec 18 07:26:55 2012 (r244382) @@ -28,7 +28,6 @@ SRCF= absvdi2 \ ashlti3 \ ashrdi3 \ ashrti3 \ - clear_cache \ clzdi2 \ clzsi2 \ clzti2 \ @@ -126,6 +125,11 @@ SRCF= absvdi2 \ umoddi3 \ umodti3 +# Don't build clear_cache on ARM with clang as it is a builtin there. +.if ${MACHINE_CPUARCH} != "arm" || ${COMPILER_TYPE} != "clang" +SRCF+= clear_cache +.endif + # These are already shipped by libc.a on arm and mips .if ${MACHINE_CPUARCH} != "arm" && ${MACHINE_CPUARCH} != "mips" SRCF+= adddf3 \ @@ -148,8 +152,9 @@ SRCF+= adddf3 \ umodsi3 .endif -# FreeBSD-specific atomic intrinsics. -.if ${MACHINE_CPUARCH} == "arm" || ${MACHINE_CPUARCH} == "mips" +# FreeBSD-specific atomic intrinsics. Clang provides them as a builtin. +.if (${MACHINE_CPUARCH} == "arm" && ${COMPILER_TYPE} != "clang") || \ + ${MACHINE_CPUARCH} == "mips" SRCF+= __sync_fetch_and_add_4 \ __sync_fetch_and_and_4 \ __sync_fetch_and_or_4 \