From owner-svn-src-all@freebsd.org Fri Jan 22 16:59:07 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A10EAA8DD30; Fri, 22 Jan 2016 16:59:07 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6561E1D39; Fri, 22 Jan 2016 16:59:07 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0MGx6EB049626; Fri, 22 Jan 2016 16:59:06 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0MGx6RB049624; Fri, 22 Jan 2016 16:59:06 GMT (envelope-from br@FreeBSD.org) Message-Id: <201601221659.u0MGx6RB049624@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Fri, 22 Jan 2016 16:59:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294577 - in head/contrib/compiler-rt/lib: builtins sanitizer_common 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.20 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: Fri, 22 Jan 2016 16:59:07 -0000 Author: br Date: Fri Jan 22 16:59:06 2016 New Revision: 294577 URL: https://svnweb.freebsd.org/changeset/base/294577 Log: Add support for RISC-V ISA. Reviewed by: emaste Sponsored by: DARPA, AFRL Sponsored by: HEIF5 Differential Revision: https://reviews.freebsd.org/D5021 Modified: head/contrib/compiler-rt/lib/builtins/int_lib.h head/contrib/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h Modified: head/contrib/compiler-rt/lib/builtins/int_lib.h ============================================================================== --- head/contrib/compiler-rt/lib/builtins/int_lib.h Fri Jan 22 16:47:36 2016 (r294576) +++ head/contrib/compiler-rt/lib/builtins/int_lib.h Fri Jan 22 16:59:06 2016 (r294577) @@ -74,11 +74,13 @@ * global header to prevent other C files from making the detour * through __c?zdi2() as well. * - * This problem has only been observed on FreeBSD for sparc64 and - * mips64 with GCC 4.2.1. + * This problem has been observed on FreeBSD for sparc64 and + * mips64 with GCC 4.2.1, and for riscv with GCC 5.2.0. + * Presumably it's any version of GCC, and targeting an arch that + * does not have dedicated bit counting instructions. */ #if defined(__FreeBSD__) && (defined(__sparc64__) || \ - defined(__mips_n64) || defined(__mips_o64)) + defined(__mips_n64) || defined(__mips_o64) || defined(__riscv__)) si_int __clzsi2(si_int); si_int __ctzsi2(si_int); #define __builtin_clz __clzsi2 Modified: head/contrib/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h ============================================================================== --- head/contrib/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h Fri Jan 22 16:47:36 2016 (r294576) +++ head/contrib/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h Fri Jan 22 16:59:06 2016 (r294577) @@ -76,6 +76,10 @@ namespace __sanitizer { #elif defined(__powerpc64__) const unsigned struct_kernel_stat_sz = 144; const unsigned struct_kernel_stat64_sz = 104; +#elif defined(__riscv__) + /* RISCVTODO: check that these values are correct */ + const unsigned struct_kernel_stat_sz = 128; + const unsigned struct_kernel_stat64_sz = 128; #elif defined(__mips__) #if SANITIZER_WORDSIZE == 64 const unsigned struct_kernel_stat_sz = 216; @@ -103,7 +107,7 @@ namespace __sanitizer { #if SANITIZER_LINUX || SANITIZER_FREEBSD -#if defined(__powerpc64__) +#if defined(__powerpc64__) || defined(__riscv__) const unsigned struct___old_kernel_stat_sz = 0; #else const unsigned struct___old_kernel_stat_sz = 32; @@ -481,7 +485,7 @@ namespace __sanitizer { typedef long __sanitizer___kernel_off_t; #endif -#if defined(__powerpc__) || defined(__mips__) +#if defined(__powerpc__) || defined(__mips__) || defined(__riscv__) typedef unsigned int __sanitizer___kernel_old_uid_t; typedef unsigned int __sanitizer___kernel_old_gid_t; #else